/* Juliette Armand Israel · לפי ספר המותג 2026
   מותג־אם בשחור (#231F20), אלמנטס בסגול (#6D276C), רקע לבן ונייר. יחס: 60% לבן, 22% טקסט שחור, 12% סגול, 6% אפורים. */
:root {
  --bg: #F4F2F4;
  --panel: #ffffff;
  --ink: #231F20;
  --ink2: #3E3A3C;
  --muted: #696A6C;
  --faint: #9A969A;
  --line: #E2DDE2;
  --line2: #EFEBEF;
  --hover: #FAF7FA;
  --accent: #6D276C;
  --accent-2: #5E1866;
  --accent-light: #9A58A0;
  --accent-soft: #F3E9F2;
  --danger: #C62828;
  --danger-soft: #FDF1F1;
  --ok: #2E7D32;
  --warn: #9A5B00;
  --warn-soft: #FFF8EC;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(35, 31, 32, .05), 0 1px 3px rgba(35, 31, 32, .06);
  --shadow-lg: 0 14px 36px rgba(35, 31, 32, .18);
  --side-w: 240px;
  --f-he: "Noto Sans Hebrew", "Heebo", Arial, sans-serif;
  --f-lat: "Open Sans", "Noto Sans Hebrew", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--f-he);
  font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.005em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.eyebrow { font-family: var(--f-lat); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.lat { font-family: var(--f-lat); direction: ltr; unicode-bidi: isolate; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.err-box { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecaca; padding: 12px 14px; border-radius: 8px; }
.hint { background: var(--warn-soft); border: 1px solid #fde68a; color: #92400e; padding: 10px 12px; border-radius: 8px; font-size: 13px; }

/* ── Shell ── */
.shell { display: flex; min-height: 100vh; overflow-x: clip; }
.side {
  width: var(--side-w); flex-shrink: 0; background: #231F20; color: #CFCACF; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; padding: 22px 12px 24px; z-index: 30; scrollbar-width: thin; scrollbar-color: #4a4446 transparent;
}
.brand { display: block; padding: 4px 10px 22px; color: #fff; text-decoration: none; border-bottom: 1px solid #3a3436; margin-bottom: 10px; }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: 156px; height: auto; }
.brand .sub { display: block; margin-top: 10px; font-family: var(--f-lat); font-size: 9.5px; letter-spacing: .22em; color: #A9A3A9; text-transform: uppercase; }
.nav-sec { margin-top: 16px; }
.nav-sec .t { font-size: 11px; color: #8E888E; padding: 0 12px 6px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.nav-sec .t::after { content: ""; flex: 1; height: 1px; background: #3a3436; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; border-radius: 6px; color: #D9D4D9; text-decoration: none; font-size: 13.5px;
  border-inline-start: 2px solid transparent;
}
.nav a:hover { background: #2E292A; color: #fff; text-decoration: none; }
.nav a.on { background: #3A2539; color: #fff; border-inline-start-color: #C9A3C8; font-weight: 500; }
.nav a .cnt { background: var(--danger); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 6px; min-width: 18px; text-align: center; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 56px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.burger { display: none; border: 0; background: none; font-size: 22px; cursor: pointer; padding: 4px 8px; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--bg); }
.search input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); background: #fff; }
.search-res { position: absolute; top: 40px; right: 0; left: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto; }
.search-res a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; color: var(--ink); border-bottom: 1px solid var(--line2); }
.search-res a:hover, .search-res a.on { background: var(--hover); text-decoration: none; }
.search-res .m { font-size: 11.5px; color: var(--muted); }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; border: 0; background: none; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; color: var(--ink2); }
.icon-btn:hover { background: var(--hover); }
.icon-btn .dot { position: absolute; top: 4px; left: 4px; background: var(--danger); color: #fff; font-size: 10.5px; border-radius: 9px; padding: 0 5px; min-width: 16px; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 3px 4px 3px 12px; cursor: pointer; }
.user-btn .av { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.dropdown { position: absolute; top: 48px; left: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 220px; z-index: 50; overflow: hidden; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: right; padding: 9px 14px; border: 0; background: none; color: var(--ink); cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--hover); text-decoration: none; }
.dropdown .hd { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.notif-list { width: 360px; max-height: 440px; overflow: auto; }
.notif-list .n { padding: 10px 14px; border-bottom: 1px solid var(--line2); font-size: 13px; }
.notif-list .n.unread { background: #faf7ff; }
.notif-list .n small { color: var(--faint); display: block; }
#view { padding: 22px 24px 60px; max-width: 1400px; width: 100%; }

/* ── Buttons & inputs ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.inp, select.inp, textarea.inp {
  width: 100%; height: 36px; border: 1px solid #d6dae3; border-radius: 8px; padding: 0 10px; background: #fff;
}
textarea.inp { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; }
.inp:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.inp[readonly] { background: var(--line2); color: var(--muted); }
.inp.sm { height: 30px; font-size: 13px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 0; }
.checks label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.fld { display: flex; flex-direction: column; gap: 4px; }
.fld > label { font-size: 12.5px; color: var(--ink2); font-weight: 500; }
.fld > label .req { color: var(--danger); }
.fld .help { font-size: 11.5px; color: var(--faint); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px 18px; }
.form-grid .wide { grid-column: 1 / -1; }

/* picker */
.picker { position: relative; }
.picker .picker-text { padding-left: 26px; }
.picker .picker-clear { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px; }
.picker-menu { position: absolute; top: calc(100% + 3px); right: 0; left: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); max-height: 260px; overflow: auto; z-index: 70; }
.picker-opt { padding: 7px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.picker-opt small { color: var(--muted); }
.picker-opt:hover, .picker-opt.on { background: var(--accent-soft); }
.picker-empty { padding: 8px 10px; color: var(--muted); }

/* ── Cards, tables ── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-b { padding: 16px; }
.page-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-h p { margin: 4px 0 0; color: var(--muted); max-width: 760px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.toolbar .inp { width: auto; }
.chips { display: inline-flex; gap: 4px; background: var(--line2); padding: 3px; border-radius: 9px; }
.chips button { border: 0; background: none; padding: 4px 12px; border-radius: 7px; cursor: pointer; color: var(--ink2); font-size: 13px; }
.chips button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); font-weight: 500; }
.tbl-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: right; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 9px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: #fafbfc; position: sticky; top: 0;
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--ink); }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.table.list td { white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: var(--hover); }
.table td.n, .table th.n { text-align: left; }
.table .empty { text-align: center; color: var(--muted); padding: 28px; }
.table tfoot td { background: #fafbfc; border-top: 1px solid var(--line); }
.list-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; color: var(--muted); font-size: 13px; }

/* tags */
.tag { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 500; background: #eef0f4; color: #4b5563; white-space: nowrap; }
.t-green { background: #e8f7ee; color: #15803d; }
.t-red { background: #fdecec; color: #b91c1c; }
.t-amber { background: #fef6e4; color: #a16207; }
.t-orange { background: #fff1e6; color: #c2410c; }
.t-blue { background: #e8f0fe; color: #1d4ed8; }
.t-purple { background: #F3E9F2; color: #6D276C; }
.t-teal { background: #e5f6f6; color: #0f766e; }
.t-gray { background: #eef0f4; color: #4b5563; }
.src { font-size: 10.5px; padding: 0 6px; border-radius: 4px; margin-inline-start: 6px; vertical-align: middle; font-weight: 500; }
.src-m { background: #eef2ff; color: #4338ca; }
.src-a { background: #ecfdf5; color: #047857; }
.src-f { background: #fff7ed; color: #c2410c; }
.neg { color: var(--danger); font-weight: 600; }
.pos { color: var(--ok); }

/* ── Record ── */
.rec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.avatar { width: 48px; height: 48px; border-radius: 12px; background: var(--c, var(--accent)); color: #fff; display: grid; place-items: center; font-size: 21px; font-weight: 600; flex-shrink: 0; }
.rec-title { flex: 1; min-width: 200px; }
.rec-title .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.rec-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.keyfields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.kf { background: #fff; padding: 10px 14px; min-height: 62px; border-inline-start: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-inline-start: -1px; margin-bottom: -1px; }
.kf .l { font-size: 12px; color: var(--muted); display: flex; align-items: center; }
.kf .v { margin-top: 3px; font-weight: 500; font-size: 14.5px; word-break: break-word; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .c { background: var(--line2); color: var(--muted); border-radius: 10px; font-size: 11.5px; padding: 0 7px; margin-inline-start: 5px; }
.tabs button.on .c { background: var(--accent-soft); color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.kv { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; }
.kv > div { padding: 8px 0; border-bottom: 1px solid var(--line2); }
.kv > .k { color: var(--muted); font-size: 13px; display: flex; align-items: center; flex-wrap: wrap; }
.kv > .v { word-break: break-word; }
.kv .v .inp, .kv .v .picker, .kv .v select { max-width: 380px; }
.rel-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rel-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: #fff; color: var(--ink); cursor: pointer; font-size: 13px; }
.rel-chip:hover { border-color: var(--accent); text-decoration: none; }
.rel-chip small { color: var(--muted); }
.rel-chip b { color: var(--accent); }

.lines td:first-child { min-width: 170px; }
.lines tr.short td { background: #fff5f5; }
.lines tr.short td.gap { color: var(--danger); font-weight: 600; }
.lines tr.cancelled td { color: var(--faint); text-decoration: line-through; }
.lines tr.cancelled td.act { text-decoration: none; }
.lines .add td { vertical-align: top; }
.totals-box { display: grid; grid-template-columns: 1fr minmax(260px, 340px); gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.totals { font-size: 14px; }
.totals .r { display: flex; justify-content: space-between; padding: 4px 0; gap: 12px; }
.totals .r.grand { font-weight: 700; font-size: 16px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.stock-hint { font-size: 12px; margin-top: 3px; }

/* timeline */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.tl .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; background: var(--line2); }
.tl .ic.sys { background: #eef2ff; }
.tl .ic.wa { background: #e8f7ee; }
.tl .ic.mail { background: #fff1e6; }
.tl .meta { font-size: 12px; color: var(--faint); }
.tl .d { white-space: pre-wrap; word-break: break-word; }

.task { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.task:last-child { border-bottom: 0; }
.task .chk { width: 20px; height: 20px; border: 2px solid #c5cad5; border-radius: 6px; background: #fff; cursor: pointer; flex-shrink: 0; margin-top: 1px; display: grid; place-items: center; color: #fff; font-size: 12px; }
.task .chk:hover { border-color: var(--ok); }
.task.done .chk { background: var(--ok); border-color: var(--ok); }
.task.done .tt { text-decoration: line-through; color: var(--muted); }
.task .tt { font-weight: 500; }
.task .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.task .late { color: var(--danger); font-weight: 500; }
.grp-t { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 14px 0 2px; }
.grp-t.late { color: var(--danger); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; display: block; }
a.kpi:hover { border-color: var(--accent); text-decoration: none; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi .v { font-size: 24px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .v.warn { color: var(--danger); }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.cal .dh { padding: 8px; font-size: 12.5px; color: var(--muted); text-align: center; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbfc; }
.cal .day { min-height: 112px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; position: relative; background: #fff; }
.cal .day.out { background: #fafbfc; }
.cal .day.out .dn { color: var(--faint); }
.cal .day.today .dn { background: var(--accent); color: #fff; }
.cal .dn { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; font-size: 12.5px; font-weight: 500; }
.cal .add { position: absolute; top: 6px; left: 6px; border: 0; background: none; color: var(--faint); cursor: pointer; opacity: 0; font-size: 16px; }
.cal .day:hover .add { opacity: 1; }
.cal .ev { display: block; margin-top: 4px; padding: 3px 6px; border-radius: 6px; font-size: 12px; color: #fff; background: var(--c); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev:hover { filter: brightness(.92); text-decoration: none; }
.cal .ev.cancel { opacity: .45; text-decoration: line-through; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: middle; }

/* reports */
.reports { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 16px; }
.reports .card-b { min-height: 120px; }
.rep-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; margin-inline-end: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: inherit; }
.bars-h .b { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.bars-h .track { background: var(--line2); border-radius: 4px; height: 14px; overflow: hidden; }
.bars-h .fill { height: 100%; border-radius: 4px; background: var(--c, var(--accent)); }
.bars-h .val { font-variant-numeric: tabular-nums; color: var(--ink2); min-width: 44px; text-align: left; }
.funnel .st { display: grid; grid-template-columns: 130px 1fr 70px; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.boot img { opacity: .9; }
.funnel .bar { height: 26px; background: var(--accent); border-radius: 4px; margin-inline-start: auto; margin-inline-end: auto; }
.funnel .pct { color: var(--muted); font-size: 12px; text-align: left; }
.chart-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: middle; }
.chart-tip { position: fixed; pointer-events: none; background: #1d2230; color: #fff; font-size: 12.5px; padding: 6px 9px; border-radius: 6px; z-index: 200; white-space: nowrap; }

/* modal & toast */
.overlay { position: fixed; inset: 0; background: rgba(17, 20, 32, .45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { max-width: 760px; }
.modal .mh { padding: 16px 20px 10px; display: flex; justify-content: space-between; align-items: center; }
.modal .mb { padding: 6px 20px 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal .mf { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-start; }
.modal .x { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal .m-err { color: var(--danger); font-size: 13px; }
.toasts { position: fixed; bottom: 18px; left: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 300; max-width: min(440px, calc(100vw - 36px)); }
.toast { background: #1d2230; color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: tin .18s ease-out; }
.toast.err { background: var(--danger); }
.toast.ok { background: #166534; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* login – שער בסגנון כריכת ספר המותג */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: #fff; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login .mono { width: 54px; height: auto; margin-bottom: 6px; }
.login h1 { font-size: 30px; }
.login .btn.primary { height: 44px; justify-content: center; font-size: 15px; }
.login-art { position: relative; background: #231F20 url('/brand/photos/el-hero.jpg') center / cover no-repeat; min-height: 100vh; }
.login-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(35, 31, 32, 0) 45%, rgba(35, 31, 32, .82) 100%); }
.login-art .cap { position: absolute; z-index: 1; inset-inline: 40px; bottom: 40px; color: #fff; }
.login-art .cap img { width: 260px; max-width: 80%; height: auto; display: block; }
.login-art .cap p { margin: 14px 0 0; color: #E6E0E6; font-size: 14.5px; max-width: 42ch; }

/* home hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 38%); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; min-height: 168px; }
.hero .txt { padding: 24px 26px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.hero .txt h1 { font-size: 28px; }
.hero .txt p { margin: 0; color: var(--muted); }
.hero .txt .row { margin-top: 10px; }
.hero .art { background: var(--accent-soft) url('/brand/photos/el-flatlay.jpg') center / cover no-repeat; }

/* מוצרים: תמונות וסדרות */
.thumb { width: 40px; height: 40px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; display: block; }
.thumb.sm { width: 30px; height: 30px; }
.thumb.ph { display: grid; place-items: center; background: var(--accent-soft) url('/brand/logos/ja-monogram-purple.png') center / 55% no-repeat; border-color: transparent; }
.table.list td.img-cell { padding-top: 5px; padding-bottom: 5px; width: 52px; }
.ltag { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; }
.ltag i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.ltag .en { font-family: var(--f-lat); font-size: 9.5px; letter-spacing: .18em; color: var(--muted); font-weight: 600; }
.avatar.img { background: #fff; border: 1px solid var(--line); padding: 4px; width: 64px; height: 64px; }
.avatar.img img { width: 100%; height: 100%; object-fit: contain; }
.prod-hero { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: center; }
.prod-hero .pic { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 1; display: grid; place-items: center; padding: 14px; }
.prod-hero .pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.line-band { height: 4px; border-radius: 2px; background: var(--c); width: 56px; margin-bottom: 8px; }
.picker-opt .po { display: flex; align-items: center; gap: 8px; min-width: 0; }
.picker-opt .po img { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; }
.img-pick { display: flex; align-items: center; gap: 10px; }
.img-pick img { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav button { text-align: right; border: 0; background: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--ink2); }
.settings-nav button.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.settings-layout { display: grid; grid-template-columns: 210px 1fr; gap: 18px; align-items: start; }
.code { font-family: Consolas, "Courier New", monospace; background: var(--line2); padding: 6px 10px; border-radius: 6px; direction: ltr; text-align: left; word-break: break-all; font-size: 12.5px; display: block; }

/* ── קופה ── */
.nav-pill { background: #6D276C; color: #fff; font-size: 10.5px; border-radius: 10px; padding: 0 7px; line-height: 18px; }
body.pos-mode #view { max-width: none; padding: 14px 16px; }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 16px; height: calc(100vh - 56px - 28px); min-height: 520px; }
.pos-products { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pos-top { display: flex; gap: 8px; margin-bottom: 10px; }
.pos-search { flex: 1; position: relative; }
.pos-search .inp { height: 44px; font-size: 15px; padding-inline-start: 40px; border-radius: 22px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236D276C' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat right 14px center; }
.pos-top .btn { height: 44px; border-radius: 22px; }
.pos-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pos-chips button { border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 5px 13px; cursor: pointer; font-size: 13px; color: var(--ink2); display: inline-flex; align-items: center; gap: 6px; }
.pos-chips button i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.pos-chips button span { color: var(--faint); font-size: 11.5px; }
.pos-chips button:hover { border-color: var(--accent-light); }
.pos-chips button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pos-chips button.on span { color: #CFCACF; }
.pos-chips.sub button { font-size: 12.5px; padding: 3px 11px; background: transparent; }
.pos-chips.sub button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.pos-chips.sub button.on span { color: var(--accent-light); }
.pos-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; align-content: start; padding: 2px 2px 20px; scrollbar-width: thin; }
.pcard { position: relative; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 8px; padding: 12px 10px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; cursor: pointer; font: inherit; color: inherit; transition: box-shadow .12s, transform .12s, border-color .12s; }
.pcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.pcard:active { transform: translateY(0); }
.pcard.in { background: #FCF8FC; border-color: #D9C1D8; border-top-color: var(--c); }
.pcard .pic { height: 112px; width: 100%; display: grid; place-items: center; margin-bottom: 6px; }
.pcard .pic img { max-height: 112px; max-width: 100%; object-fit: contain; }
.pcard .pic .ph, .cl .ph { width: 56px; height: 56px; background: var(--accent-soft) url('/brand/logos/ja-monogram-purple.png') center / 55% no-repeat; border-radius: 50%; display: block; }
.pcard .nm { font-weight: 600; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pcard .meta { font-family: var(--f-lat); font-size: 11px; color: var(--faint); direction: ltr; }
.pcard .pr { font-size: 16px; font-weight: 800; color: var(--accent); margin-top: 2px; }
.stk { position: absolute; top: 8px; left: 8px; font-size: 11px; background: var(--line2); color: var(--muted); border-radius: 10px; padding: 0 7px; line-height: 18px; font-variant-numeric: tabular-nums; }
.stk.low { background: #FFF1DC; color: #8A5300; }
.stk.out { background: #FDECEC; color: #B3261E; font-weight: 600; }
.qty-pill { position: absolute; top: 8px; right: 8px; background: var(--accent); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 8px; line-height: 18px; }
.pos-cart { background: #fff; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; box-shadow: var(--shadow); }
.pos-cust { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pos-cust .cav { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 17px; flex-shrink: 0; }
.pos-cust .cn { font-weight: 700; font-size: 15px; color: var(--ink); }
.pts-card { margin-top: 12px; background: #6D276C url('/brand/logos/ja-monogram-white.png') no-repeat left 12px center / 30px; color: #fff; border-radius: 8px; padding: 10px 14px; padding-inline-end: 54px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pts-card b { font-size: 22px; font-weight: 800; line-height: 1.1; }
.pts-card .small { opacity: .88; }
.pos-lines { flex: 1; overflow-y: auto; padding: 4px 16px; min-height: 120px; scrollbar-width: thin; }
.cl { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line2); }
.cl > img { width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; }
.cl .ph { width: 42px; height: 42px; flex-shrink: 0; }
.cl .cn { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl.short { background: linear-gradient(90deg, transparent, #FFF6F6); }
.step { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.step button { border: 0; background: var(--line2); width: 26px; height: 28px; cursor: pointer; font-size: 15px; color: var(--ink); }
.step button:hover { background: var(--accent-soft); color: var(--accent); }
.step input { width: 34px; height: 28px; border: 0; text-align: center; font: inherit; font-weight: 600; }
.cl .lt { min-width: 66px; text-align: left; font-weight: 700; font-variant-numeric: tabular-nums; }
.cl .rm { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 18px; padding: 0 2px; }
.cl .rm:hover { color: var(--danger); }
.empty-cart { text-align: center; color: var(--accent-light); padding: 40px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.empty-cart .small { color: var(--faint); }
.pos-sum { border-top: 1px solid var(--line); padding: 12px 16px 14px; background: #FCFAFC; display: flex; flex-direction: column; gap: 10px; }
.mini { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.mini .inp { width: 90px; }
.mini.grow .inp { width: 100%; }
.tot .r { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: 13.5px; }
.tot .r.pts { color: var(--accent); }
.tot .r.grand { font-size: 22px; font-weight: 800; color: var(--ink); border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.tot .r.grand span:last-child { color: var(--accent); }
.earn { margin-top: 8px; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 8px 10px; display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; flex-wrap: wrap; }
.btn.pay { flex: 1; justify-content: center; height: 48px; font-size: 15.5px; font-weight: 700; border-radius: 8px; }
.btn.icon { width: 48px; height: 48px; justify-content: center; padding: 0; font-size: 18px; }
.pos-sum .btn:not(.pay):not(.icon) { height: 48px; }
.pos-done { padding: 28px 22px; text-align: center; overflow-y: auto; }
.pos-done .ok-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 32px; display: grid; place-items: center; margin: 0 auto 12px; }
.pos-done .tot { text-align: right; }
.pos-bar { display: none; }
.pay-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-sum > div { background: var(--bg); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.pay-sum b { font-size: 17px; }
.pay-head, .pay-row { display: grid; grid-template-columns: 1.3fr 1fr 80px 1.1fr 32px; gap: 8px; align-items: center; }
.pay-head { font-size: 12px; color: var(--muted); }
.pay-row { margin-bottom: 6px; }

@media (max-width: 1100px) {
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { min-height: 220px; order: -1; }
  .login-art .cap { inset-inline: 20px; bottom: 18px; }
  .login-art .cap img { width: 190px; }
  .login-art .cap p { display: none; }
  .pos-layout { grid-template-columns: 1fr; height: auto; }
  .pos-grid { overflow: visible; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .pcard .pic { height: 90px; }
  .pcard .pic img { max-height: 90px; }
  .pos-cart { margin-bottom: 70px; }
  .pos-bar { display: block; position: fixed; bottom: 0; inset-inline: 0; padding: 10px 16px; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); z-index: 25; }
  .pos-bar .btn { width: 100%; justify-content: center; height: 46px; }
  .pay-head { display: none; }
  .pay-row { grid-template-columns: 1fr 1fr; }
  .pay-sum { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero .art { min-height: 120px; order: -1; }
  .prod-hero { grid-template-columns: 1fr; }
  .prod-hero .pic { max-width: 220px; }
  .side { position: fixed; right: 0; transform: translateX(100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .burger { display: block; }
  .grid2, .grid3, .settings-layout { grid-template-columns: 1fr; }
  .reports { grid-template-columns: 1fr; }
  .totals-box { grid-template-columns: 1fr; }
  #view { padding: 16px 16px 60px; }
  .top { padding: 0 12px; }
  .user-btn .nm { display: none; }
  .cal .day { min-height: 70px; padding: 3px; }
  .cal .ev { font-size: 10.5px; padding: 2px 3px; }
  .cal .dh { font-size: 11px; padding: 6px 2px; }
  .kv { grid-template-columns: 1fr; }
  .kv > .k { border-bottom: 0; padding-bottom: 0; }
  .rec-actions { width: 100%; }
}
@media print {
  .side, .top, .rec-actions, .tabs { display: none !important; }
  #view { padding: 0; }
}

/* ── וואטסאפ ── */
.nowrap { flex-wrap: nowrap; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; height: calc(100vh - 210px); min-height: 460px; }
.wa-list, .wa-thread { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.wa-tools { padding: 12px; border-bottom: 1px solid var(--line2); display: flex; flex-direction: column; gap: 8px; }
.wa-tools .chips { flex-wrap: wrap; }
#waRows { overflow-y: auto; flex: 1; }
.wa-row { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line2); color: inherit; text-decoration: none; }
.wa-row:hover { background: var(--hover); }
.wa-row.on { background: var(--accent-soft); }
.wa-av { width: 36px; height: 36px; border-radius: 50%; background: var(--line2); color: var(--ink2); display: grid; place-items: center; font-weight: 700; flex: none; }
.wa-av.cust { background: var(--accent-soft); color: var(--accent); }
.wa-unread { background: #25A244; color: #fff; border-radius: 10px; font-size: 11px; padding: 0 6px; min-width: 18px; text-align: center; }
.wa-empty { padding: 30px; text-align: center; }
.wa-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line2); }
.wa-back { display: none; }
.wa-esc { background: var(--danger-soft); color: var(--danger); padding: 8px 14px; font-size: 13px; }
.wa-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line2); }
.wa-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: #F7F4F7; }
.wa-mini { max-height: 520px; border-radius: 0 0 var(--radius) var(--radius); }
.wa-msg { max-width: min(78%, 560px); padding: 7px 11px 5px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); white-space: pre-wrap; word-break: break-word; }
.wa-msg.in { align-self: flex-start; border-top-right-radius: 4px; }
.wa-msg.out { align-self: flex-end; background: #EEDCEC; border-top-left-radius: 4px; }
.wa-msg.s-bot { background: #E6EEF9; }
.wa-msg.s-system { background: #FFF3DC; }
.wa-meta { font-size: 11px; color: var(--muted); margin-top: 3px; text-align: left; }
.wa-meta .err-t { color: var(--danger); font-weight: 600; }
.wa-img { max-width: 240px; max-height: 240px; border-radius: 8px; display: block; margin-bottom: 4px; }
.wa-file { display: inline-block; margin-bottom: 4px; }
.wa-day { align-self: center; font-size: 11.5px; color: var(--muted); background: #fff; border-radius: 10px; padding: 1px 10px; margin: 6px 0; }
.wa-ev { align-self: center; font-size: 12px; color: var(--muted); }
.wa-reply { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line2); align-items: flex-end; }
.wa-reply textarea { flex: 1; resize: none; min-height: 42px; }
@media (max-width: 900px) {
  .wa-layout { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 180px); }
  .wa-layout.has-conv .wa-list { display: none; }
  .wa-layout:not(.has-conv) .wa-thread { display: none; }
  .wa-back { display: inline-flex; }
}

/* ── קבצים בשיחות וואטסאפ ── */
.wa-media { margin-bottom: 4px; }
.wa-img { max-width: min(260px, 100%); max-height: 300px; border-radius: 8px; display: block; background: var(--line2); min-height: 60px; min-width: 80px; object-fit: cover; }
.wa-img.sticker { max-width: 130px; max-height: 130px; background: none; min-height: 0; }
.wa-audio { width: 260px; max-width: 100%; height: 40px; display: block; }
.wa-video { width: 280px; max-width: 100%; max-height: 360px; border-radius: 8px; display: block; background: #000; }
.wa-doc { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-width: 220px; }
.wa-doc .ic { font-size: 22px; }
.wa-doc .btn { white-space: nowrap; }
