/* GEFEN – מערכת הניהול. אותה משפחה של האתר (צבעים, פונטים, צורות עגולות), אבל שקטה וממוקדת בעבודה. */
:root {
  --ink: #2B1519;
  --olive: #3C462D;
  --olive-d: #2C3421;
  --wine: #7A1F2B;
  --wine-l: #9E3442;
  --leaf: #687B43;
  --gold: #B8955A;
  --bg: #F6F1E7;
  --card: #FFFFFF;
  --line: #E7DFD0;
  --muted: #76695F;
  --ok: #2F7D4F;
  --bad: #B42318;
  --wait: #A86A10;
  --shadow: 0 14px 36px -22px rgb(43 21 25 / .35);
  --r: 22px;
  --font-head: 'Rubik', 'Heebo', system-ui, sans-serif;
  --font-body: 'Heebo', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.2; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 3px solid var(--leaf); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.warn { color: var(--wait); font-weight: 700; }
.okc { color: var(--ok); }
.pre { white-space: pre-line; }
.tl { text-align: right; }
.boot, .loading { padding: 40px 20px; color: var(--muted); text-align: center; }
body.locked { overflow: hidden; }

/* ---------- מבנה ---------- */
.app { min-height: 100vh; }
.side { position: fixed; z-index: 30; inset-inline: 0; bottom: 0; background: var(--olive-d); color: #fff; }
.side__brand, .side__foot { display: none; }
.side__nav { display: flex; overflow-x: auto; scrollbar-width: none; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 2px; }
.side__btn { position: relative; flex: 1 0 auto; min-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; color: rgb(255 255 255 / .7); padding: 8px 8px; border-radius: 14px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.side__btn.on { color: #fff; background: rgb(255 255 255 / .12); }
.side__count { position: absolute; top: 2px; inset-inline-end: 8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--wine-l); color: #fff; font-size: 12px; display: grid; place-items: center; }
.main { padding: 22px 16px 110px; max-width: 1240px; margin-inline: auto; outline: none; }
@media (min-width: 960px) {
  .side { inset-block: 0; inset-inline-start: 0; inset-inline-end: auto; width: 250px; display: flex; flex-direction: column; padding: 22px 14px; }
  .side__brand { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; text-decoration: none; padding: 4px 10px 22px; }
  .side__brand img { width: 26px; height: auto; grid-row: span 2; }
  .side__brand span { font-size: 20px; letter-spacing: .3em; }
  .side__brand small { font-size: 13px; color: rgb(255 255 255 / .6); }
  .side__nav { flex-direction: column; overflow: visible; padding: 0; gap: 4px; }
  .side__btn { flex-direction: row; gap: 12px; min-width: 0; padding: 12px 14px; font-size: 16px; text-align: start; }
  .side__btn:hover { background: rgb(255 255 255 / .07); color: #fff; }
  .side__count { position: static; margin-inline-start: auto; }
  .side__foot { display: block; margin-top: auto; padding: 14px 10px 0; font-size: 13px; color: rgb(255 255 255 / .65); word-break: break-all; }
  .main { margin-inline-start: 250px; margin-inline-end: 0; padding: 34px 40px 60px; max-width: none; }
}
.demo-badge { display: inline-block; background: var(--gold); color: var(--ink); font-weight: 700; border-radius: 999px; padding: 4px 12px; }

/* ---------- כותרות וכפתורים ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; }
.page-head--card h1 { font-size: clamp(28px, 4vw, 40px); }
.eyebrow { font-size: 14px; font-weight: 700; color: var(--leaf); margin-bottom: 4px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: 999px; border: 2px solid transparent; font-family: var(--font-head); font-weight: 700; font-size: 15px; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); }
.btn--sm { min-height: 40px; padding: 7px 16px; font-size: 14px; }
.btn--block { width: 100%; }
.btn--primary { color: #fff; background: linear-gradient(135deg, var(--wine-l), var(--wine)); box-shadow: 0 10px 22px -10px rgb(122 31 43 / .6); }
.btn--ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn--wa { background: #25D366; color: #fff; }
.iconbtn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); }
.link { background: none; border: 0; padding: 4px 0; color: var(--wine); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.link--strong { color: var(--ink); text-decoration: none; font: inherit; font-weight: 800; padding: 0; text-align: start; }
.link--strong:hover { color: var(--wine); text-decoration: underline; }
.back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font-weight: 700; padding: 6px 0; margin-bottom: 8px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- כרטיסים ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card h2 { font-size: 19px; font-weight: 700; }
.grid2 { display: grid; gap: 0 16px; }
@media (min-width: 1000px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.note { border-radius: 18px; padding: 14px 18px; margin-bottom: 16px; font-size: 15px; }
.note--demo { background: #F8EEDC; border: 1px dashed var(--gold); }
.empty { color: var(--muted); text-align: center; padding: 28px 10px; }
.empty--sm { padding: 10px 0 12px; text-align: start; }
.hint { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* ---------- לוח בקרה ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { display: grid; gap: 2px; text-align: start; background: var(--card); border: 0; border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); transition: transform .15s; }
.kpi:hover { transform: translateY(-2px); }
.kpi span { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi b { font-family: var(--font-head); font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; line-height: 1.1; }
.kpi small { font-size: 13px; color: var(--muted); }
.kpi--main { background: var(--olive); color: #fff; }
.kpi--main span, .kpi--main small { color: rgb(255 255 255 / .75); }
.kpi--wine { background: linear-gradient(135deg, var(--wine-l), var(--wine)); color: #fff; }
.kpi--wine span, .kpi--wine small { color: rgb(255 255 255 / .8); }
.kpi--alert { box-shadow: inset 0 0 0 2px var(--bad), var(--shadow); }
.kpi--alert b { color: var(--bad); }
.alerts { display: grid; gap: 8px; }
.alerts h2 { margin-bottom: 4px; }
.alert { display: grid; gap: 2px; text-align: start; border: 0; border-radius: 16px; padding: 12px 16px; border-inline-start: 5px solid; }
.alert span { font-size: 14px; color: var(--muted); }
.alert--bad { background: #FDF0EF; border-color: var(--bad); }
.alert--wait { background: #FBF3E4; border-color: var(--wait); }
.charts { display: grid; gap: 16px; }
.charts .card { margin: 0; }
@media (min-width: 1000px) { .charts { grid-template-columns: 1fr 1.3fr 1.2fr; } }
.chart h2 { margin-bottom: 16px; }
.donut { --p: 50; width: 170px; aspect-ratio: 1; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--wine) calc(var(--p) * 1%), var(--leaf) 0); }
.donut > div { width: 64%; aspect-ratio: 1; border-radius: 50%; background: var(--card); display: grid; place-content: center; text-align: center; }
.donut b { font-family: var(--font-head); font-size: 32px; line-height: 1; }
.donut small { color: var(--muted); }
.legend { display: grid; gap: 6px; font-size: 15px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend b { margin-inline-start: auto; }
.sw { width: 14px; height: 14px; border-radius: 4px; }
.sw--wine { background: var(--wine); } .sw--leaf { background: var(--leaf); }
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; height: 190px; }
.bars__col { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; height: 100%; gap: 4px; font-size: 13px; }
.bars__col i { align-self: end; width: 70%; min-height: 4px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--leaf), var(--olive)); }
.bars__col:last-child i { background: linear-gradient(180deg, var(--wine-l), var(--wine)); }
.bars__col small { color: var(--muted); }
.hbars { display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: 96px 1fr 28px; align-items: center; gap: 10px; font-size: 14px; }
.hbars i { height: 12px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.hbars em { display: block; height: 100%; border-radius: 999px; background: var(--leaf); }
.hbars li:last-child em { background: var(--ok); }

/* ---------- תגיות סטטוס ---------- */
.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pill--ok { background: #E3F2E8; color: var(--ok); }
.pill--bad { background: #FDE7E5; color: var(--bad); }
.pill--wait { background: #FBEFD9; color: var(--wait); }
.pill--info { background: #EEF0E4; color: var(--olive); }
.pill--go { background: #E7EEF8; color: #2C5A8C; }
.pill--muted { background: #EFEBE4; color: var(--muted); }
.pill--plan { background: #F4E7E9; color: var(--wine); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- טבלה ומסננים ---------- */
.filters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; align-items: end; }
.filters label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.filters .search, .filters .btn { grid-column: 1 / -1; }
@media (min-width: 1100px) { .filters { grid-template-columns: 2.2fr repeat(5, 1fr) auto; } .filters .search, .filters .btn { grid-column: auto; } }
input, select, textarea { width: 100%; min-height: 44px; border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 12px; background: #FDFBF7; font-size: 16px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--leaf); background: #fff; }
textarea { resize: vertical; }
.search input { padding-inline-start: 40px; background: #FDFBF7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2376695F' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat right 12px center / 18px; }
.result-count { font-size: 14px; color: var(--muted); margin: -4px 4px 8px; min-height: 1em; }
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 1080px; }
.table--compact { min-width: 560px; }
.table th { position: sticky; top: 0; background: #FBF7EF; text-align: start; font-size: 13px; color: var(--muted); font-weight: 700; padding: 0; border-bottom: 1px solid var(--line); }
.table th button { width: 100%; display: flex; align-items: center; gap: 4px; border: 0; background: none; padding: 12px 12px; font-weight: 700; text-align: start; white-space: nowrap; }
.table th[aria-sort="ascending"] i::after { content: "▲"; font-size: 10px; }
.table th[aria-sort="descending"] i::after { content: "▼"; font-size: 10px; }
.table td { padding: 12px; border-bottom: 1px solid #F1EBE0; white-space: nowrap; }
.table tbody tr[data-card] { cursor: pointer; }
.table tbody tr[data-card]:hover { background: #FBF6EE; }
.table--compact th { padding: 10px 12px; }

/* ---------- כרטיס לקוח ---------- */
.kvs { display: grid; gap: 10px; }
.kvs--wide { grid-template-columns: 1fr; }
@media (min-width: 800px) { .kvs--wide { grid-template-columns: 1fr 1fr; gap: 12px 28px; } }
.kv { display: grid; gap: 1px; }
.kv span { font-size: 13px; color: var(--muted); }
.kv b { font-weight: 500; word-break: break-word; }
.manage { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.manage label, .fgrid label, .payform label, .report label, .modal label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
.form { display: grid; gap: 14px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fgrid .wide, .modal .wide { grid-column: 1 / -1; }
.form__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips legend { font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 6px; padding: 0; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; width: 1px; min-height: 0; }
.chips span { display: inline-flex; min-height: 38px; align-items: center; padding: 4px 14px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 14px; cursor: pointer; }
.chips input:checked + span { background: var(--olive); border-color: var(--olive); color: #fff; }
.chips input:focus-visible + span { outline: 3px solid var(--leaf); }
.payform { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.payform__btns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.noteform { display: grid; gap: 8px; justify-items: start; margin-bottom: 8px; }
.timeline { display: grid; gap: 0; margin-top: 12px; }
.timeline li { display: grid; gap: 2px; padding: 10px 0 10px; border-top: 1px solid #F1EBE0; }
.timeline li span, .timeline li small { font-size: 13px; color: var(--muted); }
.hist { display: grid; gap: 10px; }
.hist__row { background: #FBF7EF; border-radius: 16px; padding: 12px 16px; }
.hist__row > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.hist__row small { color: var(--muted); }
.hist ol { list-style: decimal; padding-inline-start: 22px; display: grid; gap: 2px; }
.log summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.log summary::-webkit-details-marker { display: none; }
.log summary span { background: var(--bg); border-radius: 999px; padding: 2px 10px; font-size: 13px; }

/* ---------- משלוחים ---------- */
.monthpick { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.monthpick b { min-width: 120px; text-align: center; font-family: var(--font-head); }
.monthpick .iconbtn { border: 0; background: var(--bg); }
.shipsum { display: grid; gap: 12px; }
.shipsum__main { display: flex; align-items: baseline; gap: 10px; }
.shipsum__main b { font-family: var(--font-head); font-size: 40px; font-weight: 800; color: var(--wine); line-height: 1; }
.shipsum__main span { color: var(--muted); }
.progress { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf), var(--ok)); border-radius: 999px; }
.chipsbar { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: center; min-height: 38px; padding: 4px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-size: 14px; font-weight: 500; }
.chip b { background: var(--bg); border-radius: 999px; padding: 0 8px; font-size: 13px; }
.chip.on { background: var(--olive); color: #fff; border-color: var(--olive); }
.chip.on b { background: rgb(255 255 255 / .2); }
.shiplist { display: grid; gap: 12px; }
@media (min-width: 1100px) { .shiplist { grid-template-columns: 1fr 1fr; } }
.ship { margin: 0; display: grid; gap: 10px; border-inline-start: 5px solid var(--wait); }
.ship--done { border-color: var(--ok); opacity: .82; }
.ship__top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ship h3 { font-size: 19px; }
.ship__top p { font-size: 14px; color: var(--muted); }
.ship__top a { text-decoration: none; font-weight: 700; color: var(--ink); }
.ship__plan { flex: none; display: grid; justify-items: center; background: #F4E7E9; color: var(--wine); border-radius: 16px; padding: 6px 12px; font-family: var(--font-head); font-size: 26px; font-weight: 800; line-height: 1; }
.ship__plan small { font-size: 12px; font-weight: 500; font-family: var(--font-body); }
.ship__prefs { font-size: 15px; background: #FBF7EF; border-radius: 14px; padding: 10px 14px; }
.ship__note { font-size: 14px; color: var(--muted); }
.ship__note--bad { color: var(--bad); font-weight: 700; }
.ship__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ship__actions select { width: auto; min-width: 150px; }

/* ---------- חלון תיעוד בקבוקים ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: end center; background: rgb(25 16 14 / .5); backdrop-filter: blur(4px); }
.modal__panel { width: 100%; max-width: 680px; max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 26px 26px 0 0; padding: 20px; display: grid; gap: 14px; }
@media (min-width: 800px) { .modal { place-items: center; } .modal__panel { border-radius: 26px; padding: 26px 30px; } }
.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.modal__head h2 { font-size: 22px; }
.bottles { display: grid; gap: 8px; }
.bottle { display: grid; grid-template-columns: 32px 1fr; gap: 6px 8px; align-items: center; background: var(--card); border-radius: 16px; padding: 8px 10px; }
.bottle__n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--wine); color: #fff; font-weight: 700; font-size: 14px; grid-row: span 2; }
.bottle .dup { grid-column: 2; color: var(--wait); font-weight: 700; font-size: 13px; }
@media (min-width: 600px) { .bottle { grid-template-columns: 32px 1.4fr 1fr; } .bottle__n { grid-row: auto; } .bottle .dup { grid-column: 2 / -1; } }
.past summary { cursor: pointer; font-weight: 700; color: var(--wine); }
.past ul { display: grid; gap: 4px; margin-top: 8px; font-size: 14px; }

/* ---------- יינות ---------- */
.big { font-family: var(--font-head); font-size: 44px; font-weight: 800; color: var(--wine); line-height: 1.1; margin-bottom: 10px; }
.big small { font-family: var(--font-body); font-size: 15px; font-weight: 500; color: var(--muted); }
.doclist li, .toplist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #F1EBE0; }
.toplist { counter-reset: t; }
.toplist li::before { counter-increment: t; content: counter(t); width: 26px; height: 26px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.toplist li span { flex: 1; }
.card .search { display: block; margin-bottom: 12px; }
.card .table-wrap { box-shadow: none; border: 1px solid var(--line); }

/* ---------- דוחות ---------- */
.reports { display: grid; gap: 14px; }
@media (min-width: 800px) { .reports { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1250px) { .reports { grid-template-columns: repeat(3, 1fr); } }
.report { margin: 0; display: grid; gap: 10px; align-content: start; }
.report p { color: var(--muted); font-size: 15px; }
.report .btn { justify-self: start; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.links { display: grid; gap: 8px; margin-bottom: 14px; }
.links a { color: var(--wine); font-weight: 700; }

/* ---------- כניסה ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(80% 60% at 50% 0%, #EDE3CF, var(--bg)); }
.login__card { width: min(420px, 100%); background: var(--card); border-radius: 28px; padding: 30px 26px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.login__card img { width: 130px; height: auto; justify-self: center; }
.login__card h1 { text-align: center; font-size: 24px; }
.login__card label { display: grid; gap: 4px; font-size: 14px; font-weight: 500; color: var(--muted); }
.login__note { background: #EEF0E4; border-radius: 14px; padding: 10px 14px; font-size: 15px; }
.login__note--bad { background: #FDE7E5; color: var(--bad); }
.login__back { text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- הודעה קופצת ---------- */
.toast { position: fixed; z-index: 200; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }
.toast--bad { background: var(--bad); }
@media (min-width: 960px) { .toast { bottom: 30px; left: calc(50% - 125px); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
.donut--empty { background: #EFEBE4; }

/* ---------- מחיקה וקישורי הפניה ---------- */
.btn--danger { color: #fff; background: var(--bad); }
.card.danger { border: 1.5px solid #F4C7C2; }
.manage .wide { grid-column: 1 / -1; }
.reflink { display: flex; gap: 6px; align-items: center; min-width: 320px; }
.reflink input { font-size: 14px; min-height: 40px; }
.reftable td { white-space: normal; vertical-align: middle; }
