:root {
  --brand: #EB710C;
  --brand-2: #F28C38;
  --brand-soft: #FEF1E4;
  --ink: #16172B;
  --muted: #6B7280;
  --line: #ECE6DE;
  --bg: #FAFAFA;
  --card: #ffffff;
  --ok: #15803d;
  --warn: #B45309;
  --danger: #b91c1c;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Poppins', 'Cairo', system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; }
button, input, select, textarea { font: inherit; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

/* Auth screens */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 85% 15%, rgba(235,113,12,.35), transparent 45%), #16172B; }
.auth-card { background: var(--card); width: 100%; max-width: 420px; border-radius: 20px; padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(30, 10, 70, .35); }
.auth-card .logo { font-weight: 800; font-size: 26px; color: var(--brand); margin-bottom: 4px; }
.auth-card h1 { font-size: 20px; margin: 0 0 6px; }
.auth-card p.sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 14px; }
.field input, .field select { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.field input:focus, .field select:focus { outline: 2px solid var(--brand-2); outline-offset: 1px; border-color: transparent; }
.field .hint { color: var(--muted); font-size: 12px; }
.ltr { direction: ltr; text-align: left; }

.btn { border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; cursor: pointer; background: var(--brand-soft); color: #B4560A; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: #B4560A; }
.btn.danger { background: #fee2e2; color: var(--danger); }
.btn.block { width: 100%; padding: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.error-box { background: #fee2e2; color: var(--danger); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }

/* Shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: #16172B; color: #E5E7EB; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { font-weight: 800; font-size: 22px; padding: 4px 10px 16px; color: #fff; }
.side a { display: flex; justify-content: space-between; align-items: center; color: inherit; text-decoration: none;
  padding: 9px 12px; border-radius: 10px; font-weight: 600; }
.side a:hover { background: rgba(255,255,255,.07); }
.side a.active { background: var(--brand); color: #fff; }
.side a.soon { opacity: .5; pointer-events: none; }
.side .tag { font-size: 11px; background: rgba(255,255,255,.12); border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.side .spacer { flex: 1; }
.side .who { font-size: 13px; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.1); margin-top: 8px; }
.side .who b { display: block; color: #fff; }

.main { padding: 24px 28px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: 22px; }
.tb-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid var(--line, #e5e5e5); border-radius: 12px; background: #fff; color: var(--ink, #16172B); cursor: pointer; align-items: center; justify-content: center; flex: none; padding: 0; }
.menu-btn svg, .side-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.menu-btn:focus-visible, .side-close:focus-visible { outline: 3px solid #F5B47E; outline-offset: 2px; }
.side-close { display: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; align-items: center; justify-content: center; padding: 0; }
.side-backdrop { position: fixed; inset: 0; background: rgba(22,23,43,.45); z-index: 39; }
.side .brand { display: flex; justify-content: space-between; align-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 22px; font-weight: 800; }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.list th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; background: var(--brand-soft); color: var(--brand); }
.pill.off { background: #eee; color: #777; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 10, 40, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 460px; padding: 22px; max-height: 92vh; overflow: auto; }
.modal h3 { margin: 0 0 14px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-start; margin-top: 8px; }

.toasts { position: fixed; top: 16px; left: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 14px; max-width: 340px; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 0 0 auto; width: 260px; transform: translateX(100%); transition: transform .2s; z-index: 40; }
  .side.open { transform: none; }
  .main { padding: 16px; }
  .menu-btn, .side-close { display: inline-flex; }
  .side { overflow-y: auto; }
  .side.open { box-shadow: -8px 0 30px rgba(0,0,0,.25); }
  body.menu-open { overflow: hidden; }
  /* phone top bar: menu + title on one side, mic on the other, search under them */
  .topbar { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; }
  .topbar .tb-title { grid-column: 1; grid-row: 1; }
  .topbar .zv-host { grid-column: 2; grid-row: 1; }
  .topbar .gsearch-host { grid-column: 1 / -1; grid-row: 2; }
  .topbar h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.mt { margin-top: 14px; }
.mb { margin-bottom: 12px; }
.muted { color: var(--muted); }
.ink { color: var(--ink); }
.small { font-size: 14px; }
.tight { margin: 6px 0 0; }

/* ---------- M1 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .search { flex: 1 1 260px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; }
.toolbar select { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; color: var(--muted); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
table.clickable tbody tr[data-id], table.clickable tbody tr[data-oid] { cursor: pointer; }
table.clickable tbody tr:hover { background: var(--brand-soft); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-confirmed { background: #E8E9F0; color: #16172B; }
.st-out { background: #fef3c7; color: #92400e; }
.st-returned { background: #dcfce7; color: #166534; }
.st-cancelled { background: #f3f4f6; color: #6b7280; }
.due { color: var(--danger); font-weight: 700; }
.ltr-inline { direction: ltr; unicode-bidi: isolate; }
.modal.wide { max-width: 860px; }
.modal h4 { margin: 18px 0 8px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.modal-head h3 { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 14px; }
.grid2 .full { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 4px; margin: 0 0 12px; }
legend { font-weight: 700; padding: 0 6px; }
.item-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.item-row select, .item-row input { border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-width: 0; }
.item-row .lt { font-weight: 700; font-size: 14px; }
.small-btn { padding: 5px 10px; font-size: 13px; }
.totals { display: grid; gap: 4px; background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.totals > div { display: flex; justify-content: space-between; }
.totals .grand { border-top: 1px solid var(--line); padding-top: 6px; font-size: 17px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.inline-form .error-box { flex-basis: 100%; }
.inline-form input, .inline-form select { border: 1px solid var(--line); border-radius: 8px; padding: 8px; flex: 1 1 120px; min-width: 0; }
.actions.spread { margin-top: 16px; flex-wrap: wrap; }
tr.voided td { text-decoration: line-through; color: var(--muted); }
@media (max-width: 820px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .item-row { grid-template-columns: 1fr 1fr; }
  .item-row select { grid-column: 1 / -1; }
}
fieldset { min-width: 0; }
.field input, .field select { width: 100%; min-width: 0; }

/* ---------- M1.5 smart paste + voice ---------- */
.smart { border: 2px dashed var(--brand-2); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; background: #FFFAF5; display: grid; gap: 8px; }
.smart textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; resize: vertical; width: 100%; }
.smart-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.smart-warn { margin: 0; padding: 8px 26px 8px 12px; background: #fff7ed; border-radius: 10px; color: var(--warn); font-size: 14px; }
.auto { background: #fef9c3 !important; border-color: #eab308 !important; }
#smartMic.rec { background: #fee2e2; color: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { #smartMic.rec { animation: none; } }

/* ---------- prices & costs ---------- */
.item-head { margin-bottom: 4px; }
.item-head span { font-size: 12px; color: var(--muted); font-weight: 600; }
.with-cost .item-row { grid-template-columns: 2fr .8fr 1fr 1fr 1fr auto; }
.item-row input.edited { border-color: var(--brand-2); background: var(--brand-soft); }
.totals .cost-line { color: var(--muted); }
.totals .profit { border-top: 1px dashed var(--line); padding-top: 6px; color: var(--ok); font-weight: 700; }
.totals .profit.loss { color: var(--danger); }
@media (max-width: 820px) {
  .item-head { display: none; }
  .with-cost .item-row { grid-template-columns: 1fr 1fr; }
}
.cell-edit { width: 100px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #fff; }
.cell-edit:focus { outline: 2px solid var(--brand-2); border-color: transparent; }
.cell-edit.saved { background: #dcfce7; border-color: var(--ok); transition: background .3s; }

/* ---------- M2: operations, stock, calendar ---------- */
.warn { color: var(--warn); }
.op-title { margin: 22px 0 10px; font-size: 18px; display: flex; gap: 8px; align-items: center; }
.op-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.op-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 6px; }
.op-card.late { border-color: #fdba74; background: #fffaf5; }
.op-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.op-items { display: flex; flex-wrap: wrap; gap: 6px; }
.op-items span { background: var(--brand-soft); color: var(--brand); border-radius: 8px; padding: 2px 8px; font-weight: 700; font-size: 14px; }
.op-card .actions { margin-top: 4px; }
.st-late { background: #ffedd5; color: #9a3412; }
table.ret input { width: 80px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
table.cal { font-size: 13px; }
table.cal th, table.cal td { text-align: center; padding: 6px 4px; min-width: 34px; }
table.cal .stick { position: sticky; right: 0; background: var(--card); text-align: right; min-width: 150px; z-index: 1; }
table.cal td.some { background: #E8E9F0; }
table.cal td.zero { background: #fef3c7; color: #92400e; font-weight: 700; }
table.cal td.neg { background: #fee2e2; color: var(--danger); font-weight: 800; }
table.cal .today { outline: 2px solid var(--brand-2); outline-offset: -2px; }

/* voice bar on products */
.vc-bar { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.vc-mic { flex: none; width: 64px; height: 64px; border-radius: 50%; border: 0; font-size: 28px; cursor: pointer; background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(235,113,12,.35); }
.vc-mic:focus-visible { outline: 3px solid #F5B47E; outline-offset: 3px; }
.vc-mic.rec { background: var(--danger, #dc2626); animation: pulse 1.2s infinite; }
.vc-mic:disabled { opacity: .4; cursor: not-allowed; }
.vc-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.vc-title { font-weight: 700; font-size: 1.05rem; }
.vc-main input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.vc-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: #fff; }
.vc-row.bad { border-color: #fecaca; background: #fef2f2; }
.vc-row s { color: #9ca3af; }
.vc-x { border: 0; background: none; font-size: 18px; cursor: pointer; color: #6b7280; padding: 4px 8px; }
.vc-tag { display: inline-block; font-size: .8rem; padding: 2px 8px; border-radius: 999px; margin-inline-end: 4px; }
.vc-tag.edit { background: #FEF1E4; color: #B4560A; }
.vc-tag.new { background: #dcfce7; color: #166534; }
.vc-opt { display: inline-flex; gap: 4px; align-items: center; margin-inline-end: 10px; }
.vc-actions { display: flex; gap: 8px; margin: 4px 0 16px; }
@media (prefers-reduced-motion: reduce) { .vc-mic.rec { animation: none; } }

/* pricing tiers */
.hint-card { margin-bottom: 12px; display: grid; gap: 4px; }
.tier-chip { display: inline-block; background: #FEF1E4; border-radius: 999px; padding: 3px 10px; margin: 2px; font-size: .9rem; }
.tier-head, .tier-row { display: grid; grid-template-columns: 1fr 1fr 1.3fr 1.3fr auto; gap: 8px; align-items: center; }
.tier-head { font-size: .85rem; color: #6b7280; margin: 6px 0; }
.tier-row { margin-bottom: 8px; }
.tier-row input { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; min-width: 0; }
.ipr.tiered { background: #FEF1E4; }
.mt10 { margin-top: 10px; }
.search.w180 { flex: 0 1 180px; }
.search.w200 { flex: 0 1 200px; }

/* M4 dashboard + reports */
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat .sub { margin-top: 4px; line-height: 1.5; }
.stat.owe .value { color: var(--warn); }
.sec { margin: 22px 0 10px; font-size: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.alerts { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.alert-card { border-inline-start: 4px solid var(--warn); }
.alert-card.tone-crit { border-inline-start-color: var(--danger); }
.alert-title { font-weight: 700; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.ok-card { color: var(--ok); font-weight: 700; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.up-list li { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.up-day { background: var(--brand-soft); color: var(--brand); border-radius: 8px; padding: 1px 8px; font-size: 13px; font-weight: 700; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 700; cursor: pointer; font: inherit; text-decoration: underline; }
.due { color: var(--danger); font-weight: 700; }
.filters { flex-wrap: wrap; gap: 8px; align-items: center; }
/* chart */
.chart { position: relative; }
.ch-svg { width: 100%; height: auto; display: block; overflow: visible; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-axis { stroke: #D6D3CF; stroke-width: 1; }
.ch-tick, .ch-x { fill: var(--muted); font-size: 13px; font-family: inherit; }
.ch-val { fill: var(--ink); font-size: 13px; font-weight: 700; font-family: inherit; }
.ch-mark { fill: var(--brand); }
.ch-hit { fill: transparent; }
.ch-bar { cursor: default; outline: none; }
.ch-bar.dim .ch-mark { opacity: .45; }
.ch-bar:focus-visible .ch-hit { stroke: var(--brand-2); stroke-width: 2; }
.ch-tip { position: absolute; background: var(--ink); color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 13px; line-height: 1.6; pointer-events: none; white-space: nowrap; z-index: 2; }

/* M5: search box */
.gsearch-host { flex: 1 1 320px; max-width: 520px; }
.gsearch { position: relative; }
.gsearch input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff; font: inherit; }
.gsearch input:focus { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.gres { position: absolute; inset-inline: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(22,23,43,.12); z-index: 30; max-height: 420px; overflow: auto; padding: 6px; }
.ghead { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; }
.gitem { display: block; width: 100%; text-align: right; background: none; border: 0; border-radius: 8px; padding: 9px 10px; cursor: pointer; font: inherit; color: var(--ink); }
.gitem:hover, .gitem.on { background: var(--brand-soft); }
.gempty { padding: 10px; }
/* M5: share / print buttons */
.actions.share { flex-wrap: wrap; justify-content: flex-start; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
a.btn { text-decoration: none; display: inline-block; }
.btn.wa { background: #e8f8ee; color: #166534; }
/* print */
#printArea { display: none; }
@media print {
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing #printArea { display: block; }
  body.printing { background: #fff; }
  #printArea { color: #000; font-size: 13px; }
  @page { size: A4; margin: 14mm; }
}
.pr-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 12px; }
.pr-brand { font-size: 22px; font-weight: 800; }
.pr-muted { color: #555; }
.pr-title { text-align: left; font-size: 18px; font-weight: 800; }
.pr-no { font-size: 14px; font-weight: 600; }
.pr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-bottom: 14px; }
.pr-grid div { display: flex; gap: 8px; }
.pr-grid .wide { grid-column: 1 / -1; }
.pr-grid span { color: #555; min-width: 70px; }
.pr-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.pr-table th, .pr-table td { border: 1px solid #999; padding: 7px 8px; text-align: right; }
.pr-table th { background: #f0f0f0; }
.pr-table td.box { width: 70px; }
.pr-totals { width: 280px; margin-inline-start: auto; display: grid; gap: 4px; }
.pr-totals div { display: flex; justify-content: space-between; }
.pr-totals .grand { border-top: 1px solid #000; padding-top: 4px; font-weight: 800; }
.pr-sign { display: grid; gap: 28px; margin-top: 36px; }
.pr-foot { margin-top: 28px; text-align: center; color: #555; }

/* M6 telegram */
.tg-status { border-inline-start: 4px solid var(--muted); }
.tg-status.on { border-inline-start-color: var(--ok); }
.tg-status.off { border-inline-start-color: var(--warn); }
.tg-steps h4 { margin: 14px 0 6px; }
.tg-steps h4:first-child { margin-top: 0; }
.tg-steps ol { margin: 0 0 8px; padding-inline-start: 20px; line-height: 1.9; }
.ok-text { color: var(--ok); font-weight: 700; margin: 0 0 6px; }
.tg-preview { white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.8; background: #FAFAFA; border-radius: 10px; padding: 12px; margin: 0; max-height: 520px; overflow: auto; }
.chat-pick { margin: 4px; }

/* installable app */
.install-btn { margin: 8px 0; border: 1px dashed rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: #fff; border-radius: 10px; padding: 9px 12px; font: inherit; font-weight: 700; cursor: pointer; text-align: right; }
.install-btn:hover { background: rgba(255,255,255,.16); }
.install-steps { line-height: 2.2; padding-inline-start: 22px; }
@media (display-mode: standalone) { body { padding-top: env(safe-area-inset-top); } }

/* brand: icons drawn in SVG (no emoji) */
.ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; fill: currentColor; }
.vc-mic .ico { width: 30px; height: 30px; vertical-align: middle; }
.alert-ico { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; background: var(--warn); }
.alert-ico.crit { background: var(--danger); }

/* right-click menu + multi-select */
.ctx { position: fixed; z-index: 100; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(22,23,43,.18); padding: 6px; }
.ctx-title { font-size: 12px; color: var(--muted); padding: 4px 10px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-item { display: block; width: 100%; text-align: right; background: none; border: 0; padding: 9px 12px; border-radius: 8px; font: inherit; color: var(--ink); cursor: pointer; }
.ctx-item:hover, .ctx-item:focus { background: var(--brand-soft); outline: none; }
.ctx-item.danger { color: var(--danger); }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; }
th.sel, td.sel { width: 36px; padding-inline: 6px !important; }
td.sel input, th.sel input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
tr.picked td { background: var(--brand-soft); }
.bulkbar { position: sticky; top: 8px; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.bulkbar .btn { background: rgba(255,255,255,.12); color: #fff; }
.bulkbar .btn.danger { background: #fee2e2; color: var(--danger); }
.bulkbar .btn.ghost { background: transparent; text-decoration: underline; }
.rule { display: grid; grid-template-columns: 130px 1fr; gap: 8px; }
.rule select, .rule input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; }
@media print { .pr-page { break-after: page; } .pr-page:last-child { break-after: auto; } }
.bulkbar[hidden] { display: none; }

/* tentative booking + customer confirmation */
.st-pending { background: #FEF3C7; color: #92400E; }
.check-line { display: flex; gap: 8px; align-items: center; font-weight: 600; margin: 4px 0 10px; }
.check-line input { width: 18px; height: 18px; accent-color: var(--brand); }
.confirm-line { margin-top: 12px; padding: 10px 12px; border-radius: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.confirm-line.yes { background: #dcfce7; color: #166534; }
.confirm-line.no { background: #FEF3C7; color: #92400E; }
.flag-no { color: #92400E; font-weight: 700; }

.kv { display: inline-block; margin-inline-end: 10px; color: var(--muted); }
.kv b { color: var(--ink); font-weight: 600; }

/* price offer */
.pr-head.brand { border-bottom: 4px solid #EB710C; }
.pr-head.brand .pr-brand { color: #16172B; }
.pr-tag { color: #EB710C; font-weight: 700; font-size: 13px; }
.pr-terms { margin-top: 18px; font-size: 12px; color: #333; }
.pr-terms ul { margin: 6px 0 0; padding-inline-start: 18px; line-height: 1.8; }
.pr-foot { font-size: 11px; line-height: 1.7; }
@media print { .pr-head.brand { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

.exp-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.exp-form .full, .exp-form .actions, .exp-form .error-box { grid-column: 1 / -1; }
@media (max-width: 600px) { .exp-form { grid-template-columns: 1fr; } }

/* system-wide voice */
.zv-host { flex: none; }
.zv-mic { width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; background: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(235,113,12,.3); display: inline-flex; align-items: center; justify-content: center; }
.zv-mic .ico { width: 22px; height: 22px; fill: currentColor; }
.zv-mic:focus-visible { outline: 3px solid #F5B47E; outline-offset: 3px; }
.zv-mic.rec { background: var(--danger, #dc2626); animation: pulse 1.2s infinite; }
@media (prefers-reduced-motion: reduce) { .zv-mic.rec { animation: none; } }
.zv-panel { position: fixed; top: 76px; inset-inline-end: 16px; width: min(520px, calc(100vw - 32px)); z-index: 60; box-shadow: 0 12px 40px rgba(22,23,43,.22); }
.zv-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.zv-panel #zvText { width: 100%; }
.zv-out { margin: 10px 0; }
.zv-out:empty { display: none; }
.zv-confirm { background: #FFF4EA; border: 1px solid #F5C9A0; border-radius: 10px; padding: 10px 12px; }
.zv-confirm .actions { margin-top: 10px; display: flex; gap: 8px; }
.zv-help { line-height: 1.9; }
.zv-panel #zvText { padding: 10px 12px; border: 1px solid var(--line, #e5e5e5); border-radius: 10px; font: inherit; background: #fff; }
.zv-panel #zvText:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.row3 { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.value.due { color: var(--danger, #dc2626); }
/* help videos */
.help-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-top: 14px; }
.help-card { display: flex; flex-direction: column; gap: 6px; text-align: start; background: var(--card, #fff); border: 1px solid var(--line, #eee); border-radius: 14px; padding: 10px; cursor: pointer; font: inherit; color: inherit; }
.help-card:hover, .help-card:focus-visible { border-color: var(--brand); box-shadow: 0 6px 18px rgba(235,113,12,.15); outline: none; }
.help-thumb { position: relative; display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--ink, #16172B); }
.help-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.help-play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.help-play svg { width: 26px; height: 26px; fill: #fff; margin-inline-start: 3px; }
.help-t { font-weight: 800; }
.help-video { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; display: block; margin: 8px 0; }
.tile-btn { display: block; padding: 0; border: 0; background: none; text-align: inherit; font: inherit; color: inherit; cursor: pointer; border-radius: 16px; }
.tile-btn .card { height: 100%; transition: box-shadow .15s, border-color .15s; }
.tile-btn:hover .card, .tile-btn:focus-visible .card { border-color: var(--brand); box-shadow: 0 6px 18px rgba(235,113,12,.15); }
.tile-btn:focus-visible { outline: none; }

/* customers period filter */
.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px; margin-top: 10px; }
.period-head { display: flex; flex-direction: column; gap: 2px; }
.period-dates { display: flex; gap: 10px; flex-wrap: wrap; }
.period-dates label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.period-dates input { padding: 8px 10px; border: 1px solid var(--line, #e5e5e5); border-radius: 10px; font: inherit; background: #fff; }
.stats4 { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 820px) { .stats4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .period-bar .chips { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; } }
.period-bar .chip { white-space: nowrap; flex: none; }
.period-bar .chips { scrollbar-width: none; }

/* who spent what */
.people-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line, #eee); }
.people-list li:last-child { border-bottom: 0; }
.people-list .people-total { font-weight: 800; border-top: 2px solid var(--ink, #16172B); border-bottom: 0; margin-top: 4px; }
.people-list .people-total b { color: var(--brand); font-size: 1.1em; }
/* month-end: ticks for settled expenses and closing the month */
.month-settle .settle-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.settle-bar { height: 8px; background: #eef0f4; border-radius: 99px; overflow: hidden; margin: 6px 0 8px; }
.settle-bar span { display: block; height: 100%; background: var(--brand, #EB710C); transition: width .2s; }
.month-closed { border-inline-start: 4px solid #166534; }
.settle-cell { width: 1%; white-space: nowrap; text-align: center; }
.settle-tick { display: inline-flex; padding: 6px; cursor: pointer; }
.settle-tick input { width: 20px; height: 20px; accent-color: #166534; cursor: pointer; }
tr.settled td:not(.settle-cell):not(.sel) { color: var(--muted, #6b7280); }
.small-select { margin-inline-start: 8px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line, #ddd); font: inherit; font-size: .85em; }
