/* אלבז מזרחי | מרכז שליטה — עיצוב בהיר ונקי, סרגל צד כחול-לילה וזהב, לפי צבעי הלוגו הרשמי.
   כחול הרקע של הלוגו: #010a1b · זהב הלוגו: #e7a544 (טווח #c98a2e–#f0be6a) */
:root {
  --navy: #010a1b;
  --navy-2: #0b1a33;
  --navy-3: #142a4d;
  --gold: #e0a447;
  --gold-2: #c98a2e;
  --gold-light: #f0c06e;
  --gold-soft: #f8eedb;
  --gold-ink: #8a5f17;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #0f1a2c;
  --ink-2: #47536a;
  --ink-3: #6f7b90;
  --line: #e3e7ee;
  --primary: #1b3f78;
  --primary-ink: #ffffff;
  --ok: #0f7a4a; --ok-bg: #e3f5ec;
  --warn: #9a5b00; --warn-bg: #fdf1dc;
  --bad: #b42318; --bad-bg: #fde8e6;
  --info: #1e4f9c; --info-bg: #e5eefb;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 8%);
  --sidebar-w: 248px;
  --tap: 48px;
  font-family: "Segoe UI", "Assistant", "Heebo", Arial, "Noto Sans Hebrew", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); font-size: 16px; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- מבנה ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--navy); color: #dfe6f1;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-inline-start: 3px solid var(--gold);
}
.brand { padding: 18px 16px 14px; border-bottom: 1px solid rgb(255 255 255 / 8%); }
.brand { padding: 14px 18px 12px; text-align: center; }
.brand img { display: block; width: 100%; max-width: 196px; height: auto; object-fit: contain; margin: 0 auto; }
.nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 8px;
  color: #cfd8e6; font-weight: 500;
}
.nav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--navy-3); color: #fff; box-shadow: inset -3px 0 0 var(--gold); }
.nav .sep { margin: 10px 12px 4px; font-size: .75rem; color: #8ea0bd; letter-spacing: .5px; }
.nav .soon { margin-inline-start: auto; font-size: .7rem; color: var(--gold); border: 1px solid rgb(224 164 71 / 50%); border-radius: 99px; padding: 0 7px; }
.icon { width: 22px; height: 22px; flex: 0 0 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid rgb(255 255 255 / 8%); font-size: .875rem; }
.sidebar-foot .who { color: #fff; font-weight: 600; }
.sidebar-foot .role { color: var(--gold); font-size: .8rem; }
.sidebar-foot a { color: #b8c5da; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 24px 28px 48px; max-width: 1240px; width: 100%; margin: 0 auto; }
.demo-banner {
  background: repeating-linear-gradient(-45deg, #fff6df, #fff6df 12px, #fdf0cc 12px, #fdf0cc 24px);
  color: #6b4e0a; border-bottom: 1px solid #ecd9a6; padding: 6px 16px; font-size: .875rem; text-align: center; font-weight: 600;
}

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--ink-3); margin-top: 4px; }
.crumbs { font-size: .875rem; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a { color: var(--ink-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- רכיבים ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-body { padding: 14px 18px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  color: inherit; box-shadow: var(--shadow); position: relative; transition: border-color .15s, transform .15s;
}
.kpi:hover { text-decoration: none; border-color: var(--gold); transform: translateY(-1px); }
.kpi .label { color: var(--ink-2); font-size: .9rem; }
.kpi .value { font-size: 2rem; font-weight: 700; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .hint { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
.kpi.bad .value { color: var(--bad); }
.kpi.warn .value { color: var(--warn); }
.kpi::after { content: "‹"; position: absolute; left: 14px; top: 14px; color: var(--ink-3); font-size: 1.2rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: #c5cfdc; background: #f9fafc; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.gold:hover { background: #f0c06e; }
.btn.danger { color: var(--bad); border-color: #f1c1bb; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .875rem; }
.btn.block { width: 100%; }
.btn .icon { width: 20px; height: 20px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: #eef1f5; color: var(--ink-2); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.gold { background: var(--gold-soft); color: var(--gold-ink); }
.badge.demo { background: #fff3cf; color: #7a5a00; border: 1px dashed #d9b85c; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.row-link { display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: inherit; min-height: 56px; }
.row-link:hover { background: #f8fafc; text-decoration: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-meta { font-size: .85rem; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }

table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; color: var(--ink-3); font-weight: 600; background: #fafbfc; }
.table-wrap { overflow-x: auto; }

.empty { text-align: center; padding: 36px 18px; color: var(--ink-3); }
.empty .icon { width: 40px; height: 40px; color: #b6c1d1; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; }

/* ---------- טפסים ---------- */
.form { display: grid; gap: 14px; }
.form-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field label, .field .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--ink-2); }
.field .req { color: var(--bad); }
.field .help { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid #cfd7e2; border-radius: 10px; background: #fff;
  font-size: 16px; /* מונע זום אוטומטי ב-iOS */
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 3px solid rgb(224 164 71 / 55%); outline-offset: 1px; border-color: var(--gold);
}
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--navy); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters .field { min-width: 150px; flex: 1 1 150px; }
.filters .field label { font-size: .8rem; margin-bottom: 4px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; z-index: 5; }
.form-error { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.seg { display: inline-flex; background: #e9edf3; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; color: var(--ink-2); font-weight: 600; cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; }
.seg a.active, .seg button.active { background: #fff; color: var(--navy); box-shadow: var(--shadow); text-decoration: none; }

.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 12px 16px; color: var(--ink-2); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--gold); }
.tabs a:hover { text-decoration: none; color: var(--navy); }

/* קבצים ותמונות */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #e9edf3; border: 1px solid var(--line); display: block; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .tag { position: absolute; bottom: 6px; inset-inline-start: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); max-width: 100%; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker { display: flex; gap: 10px; flex-wrap: wrap; }
.picker input[type=file] { display: none; }
.pending-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pending-files .file-chip button { border: 0; background: none; color: var(--bad); cursor: pointer; font-size: 1.1rem; padding: 0 4px; }
.thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; }

.viewer { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: var(--radius); background: #525659; }
.viewer-img { max-height: 72vh; display: block; margin: 0 auto; border-radius: var(--radius); }

/* ציר זמן */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 22px 16px 0; border-inline-start: 0; }
.timeline li::before { content: ""; position: absolute; right: 5px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; right: 0; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--gold); }
.timeline .when { font-size: .8rem; color: var(--ink-3); }
.comment { background: #f6f8fb; border-radius: 10px; padding: 10px 12px; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--ink-3); font-size: .875rem; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.section-title { font-size: .8rem; color: var(--ink-3); font-weight: 700; letter-spacing: .4px; margin: 0 0 6px; }

.later { border: 1px dashed #d4c08c; background: linear-gradient(180deg, #fffdf6, #fff); }
.later ul { margin: 8px 0 0; padding-inline-start: 20px; color: var(--ink-2); }

/* חלון קופץ */
.modal-back { position: fixed; inset: 0; background: rgb(1 10 27 / 45%); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 50px rgb(0 0 0 / 25%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-body { padding: 18px; }
.x { border: 0; background: none; font-size: 1.6rem; cursor: pointer; line-height: 1; padding: 4px 10px; color: var(--ink-3); min-height: 44px; }

#toasts { position: fixed; bottom: 20px; left: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 40px); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgb(0 0 0 / 20%); font-weight: 600; border-inline-start: 4px solid var(--gold); animation: pop .2s ease-out; }
.toast.error { background: var(--bad); border-color: #ffb4ab; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

.boot, .loading { display: flex; align-items: center; justify-content: center; min-height: 40vh; }
.boot { min-height: 100vh; background: var(--navy); }
.spinner { width: 34px; height: 34px; border: 3px solid rgb(224 164 71 / 30%); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { background: var(--bad-bg); color: var(--bad); padding: 16px; border-radius: var(--radius); }

/* מסך התחברות */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--navy); }
.auth-card { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; padding: 28px 24px; box-shadow: 0 20px 60px rgb(0 0 0 / 30%); border-top: 4px solid var(--gold); }
.auth-card .logo { display: block; width: calc(100% + 48px); max-width: none; height: auto; max-height: 300px; object-fit: contain; margin: -28px -24px 20px; background: var(--navy); padding: 18px 24px 10px; border-radius: 12px 12px 0 0; }
.auth-card h1 { font-size: 1.25rem; text-align: center; margin-bottom: 18px; }
.demo-hint { background: #fff8e6; border: 1px dashed #d9b85c; border-radius: 10px; padding: 10px 12px; font-size: .85rem; color: #6b4e0a; margin-top: 16px; }
.demo-hint button { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 2px 0; font-size: .85rem; text-decoration: underline; }

/* כפתור תוכניות במסך הבית */
.plans-btn {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px 16px; min-height: 76px;
  background: var(--navy); color: #fff; border-radius: 16px; border: 1px solid var(--navy-3);
  box-shadow: 0 6px 18px rgb(1 10 27 / 18%); border-inline-start: 4px solid var(--gold);
}
.plans-btn:hover { text-decoration: none; background: var(--navy-2); }
.plans-icon {
  flex: 0 0 48px; width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--gold-light), var(--gold-2)); color: var(--navy);
}
.plans-icon .icon { width: 28px; height: 28px; stroke-width: 2.2; }
.plans-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plans-text b { font-size: 1.15rem; }
.plans-text span { font-size: .85rem; color: #c7d0de; }
.plans-go { font-size: 1.8rem; color: var(--gold); line-height: 1; }

/* שדות מתקפלים בטופס היומן */
.folds { display: flex; flex-direction: column; gap: 8px; }
.fold { border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.fold summary {
  list-style: none; cursor: pointer; min-height: 48px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; color: var(--ink-2);
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "+"; font-size: 1.3rem; color: var(--gold-2); font-weight: 700; }
.fold[open] summary::after { content: "−"; }
.fold[open] { background: #fff; }
.fold > input, .fold > textarea { margin: 0 12px 12px; width: calc(100% - 24px); }

/* ---------- גיליונות תחתונים (תפריט ופעולה חדשה) ---------- */
.bottom-nav { display: none; }
.sheet-back { display: none; }
.sheet-back.open { display: block; position: fixed; inset: 0; z-index: 60; background: rgb(1 10 27 / 50%); animation: fade .15s ease-out; }
.sheet {
  position: absolute; bottom: 0; left: 0; right: 0; max-height: 88vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 8px 14px calc(18px + env(safe-area-inset-bottom));
  animation: slide-up .2s ease-out; max-width: 640px; margin: 0 auto;
}
.sheet-nav { background: var(--navy); color: #dfe6f1; border-top: 3px solid var(--gold); }
.sheet-nav .nav a { min-height: 52px; font-size: 1.05rem; }
.sheet-light { background: var(--bg); }
.sheet-handle { width: 42px; height: 5px; border-radius: 99px; background: rgb(127 140 160 / 45%); margin: 4px auto 12px; }
.sheet-title { font-size: 1.1rem; margin: 0 4px 12px; }
.sheet-user { display: flex; align-items: center; gap: 12px; padding: 4px 12px 12px; border-bottom: 1px solid rgb(255 255 255 / 10%); }
.sheet-user b { color: #fff; }
.sheet-user .small { color: var(--gold); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold); color: var(--navy); font-weight: 800; font-size: .85rem; letter-spacing: .5px;
}
.avatar.lg { width: 46px; height: 46px; font-size: 1.05rem; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 14px; min-height: 112px; border-radius: 16px;
  background: #fff; border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow);
}
.quick:hover { text-decoration: none; border-color: var(--gold); }
.quick .icon { width: 30px; height: 30px; color: var(--navy); margin-bottom: 4px; }
.quick b { font-size: 1.05rem; }
.quick span { font-size: .8rem; color: var(--ink-3); line-height: 1.35; }
.quick.gold { background: linear-gradient(160deg, var(--gold-light), var(--gold)); border-color: var(--gold); }
.quick.gold span { color: #4d3a12; }
@keyframes slide-up { from { transform: translateY(40px); opacity: .6; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- טלפון וטאבלט ---------- */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  body { font-size: 15.5px; }
  .sidebar { display: none; }
  .demo-banner { font-size: .75rem; padding: 3px 12px; }

  /* פס עליון דק: לוגו מלא + תפריט */
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: var(--navy); color: #fff; padding: 4px 10px 4px 12px; padding-top: max(4px, env(safe-area-inset-top));
    position: sticky; top: 0; z-index: 20; border-bottom: 2px solid var(--gold); min-height: 58px;
  }
  .topbar-logo { display: block; line-height: 0; }
  .topbar img { height: 52px; width: auto; object-fit: contain; display: block; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgb(224 164 71 / 40%); background: rgb(255 255 255 / 6%);
    color: #fff; border-radius: 99px; padding: 4px 6px 4px 12px; min-height: 44px; cursor: pointer;
  }
  .menu-btn .icon { width: 22px; height: 22px; }

  .content { padding: 14px 12px calc(104px + env(safe-area-inset-bottom)); }
  .grid-2, .grid-3, .form-2 { grid-template-columns: 1fr; }
  .grid, .stack { gap: 12px; }

  /* כותרות ופעולות בשורה אחת */
  .page-head { margin-bottom: 12px; gap: 10px; }
  .page-head h1 { font-size: 1.25rem; }
  .page-head .sub { font-size: .85rem; }
  .page-head .actions { width: 100%; flex-wrap: nowrap; }
  .page-head .actions .btn { flex: 1 1 0; min-width: 0; padding: 0 10px; font-size: .9rem; }
  .crumbs { font-size: .8rem; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dash-actions { display: none; }

  /* מדדים קומפקטיים */
  .kpis { gap: 10px; margin-bottom: 14px; }
  .kpi { padding: 12px 12px 10px; border-radius: 14px; }
  .kpi::after { display: none; }
  .kpi .label { font-size: .8rem; }
  .kpi .value { font-size: 1.6rem; margin-top: 2px; }
  .kpi .hint { font-size: .72rem; margin-top: 2px; }

  /* כרטיסים ורשימות */
  .card { border-radius: 14px; }
  .card-head { padding: 12px 14px; }
  .card-head h2 { font-size: 1.02rem; }
  .card-body { padding: 12px 14px; }
  .row-link { padding: 12px 14px; min-height: 60px; }
  .row-link::after { content: ""; width: 8px; height: 8px; border-top: 2px solid #b6c1d1; border-left: 2px solid #b6c1d1; transform: rotate(-45deg); flex: 0 0 8px; margin-inline-start: 4px; }
  .empty { padding: 20px 14px; }
  .empty .icon { width: 30px; height: 30px; margin-bottom: 4px; }
  li.row-link::after { display: none; }
  .row-title { font-size: .98rem; }
  .row-meta { font-size: .8rem; gap: 8px; }

  /* לשוניות האתר כצ'יפים נגללים */
  .tabs { border-bottom: 0; gap: 6px; margin: 0 -12px 14px; padding: 0 12px 2px; }
  .tabs a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 99px; background: #fff; margin: 0; font-size: .9rem; }
  .tabs a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
  .seg { display: flex; width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .seg a, .seg button { flex: 1 0 auto; justify-content: center; white-space: nowrap; }

  /* סינון בשתי עמודות */
  .filters { gap: 8px; }
  .filters .field { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .filters .field:has(input[type=search]) { flex-basis: 100%; }
  .filters > .btn { flex: 1 1 100%; }

  /* ניווט תחתון עם כפתור פעולה מרכזי */
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 18px rgb(1 10 27 / 10%);
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 62px; color: var(--ink-3); font-size: .72rem; font-weight: 600;
  }
  .bottom-nav a.active { color: var(--navy); }
  .bottom-nav a.active .icon { color: var(--gold-2); }
  .bottom-nav a.active span { font-weight: 800; }
  .bottom-nav a:hover { text-decoration: none; }
  .fab {
    justify-self: center; width: 60px; height: 60px; margin-bottom: 14px; border-radius: 50%; border: 4px solid #fff;
    background: linear-gradient(160deg, var(--gold-light), var(--gold-2)); color: var(--navy); cursor: pointer;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgb(201 138 46 / 45%);
  }
  .fab .icon { width: 28px; height: 28px; stroke-width: 2.6; }

  /* חלונות כגיליון תחתון */
  .modal-back { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 94vh; animation: slide-up .2s ease-out; padding-bottom: env(safe-area-inset-bottom); }
  .modal-head { padding: 12px 16px; }
  .modal-head h2 { font-size: 1.05rem; }
  .modal-body { padding: 14px 16px 20px; }

  /* טפסים */
  .field label, .field .label { font-size: .88rem; margin-bottom: 4px; }
  textarea { min-height: 80px; }
  .form-actions .btn { flex: 1 1 0; }
  .sticky-actions { bottom: calc(66px + env(safe-area-inset-bottom)); margin: 0 -12px; padding: 10px 12px; box-shadow: 0 -6px 14px rgb(245 246 248 / 95%); }
  .picker .btn { flex: 1 1 0; }

  .viewer { height: 64vh; }
  #toasts { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table.responsive td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 12px; }
  .table.responsive td::before { content: attr(data-label); color: var(--ink-3); font-size: .85rem; }
}
@media (display-mode: standalone) {
  .install-btn { display: none !important; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .actions, .demo-banner { display: none !important; }
  .content { padding: 0; }
}
