/* Makti Kabalan – import projects. Plain CSS, right-to-left, no external files. */
:root {
  --navy: #1a365d; --navy-2: #24477a; --ink: #1d2433; --muted: #5f6b7e; --line: #dfe3ea;
  --bg: #f4f6f9; --card: #ffffff; --accent: #c8642a; --accent-soft: #fbeee5;
  --ok: #2f7d4f; --ok-soft: #e3f3e9; --risk: #a96a08; --risk-soft: #fdf3dc;
  --late: #c0392b; --late-soft: #fbe5e2; --block: #6b2c91; --block-soft: #f1e6f7;
  --done: #7a8699; --done-soft: #eef1f5; --radius: 10px;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink); direction: rtl;
  font-family: "Segoe UI", "Assistant", Arial, sans-serif; line-height: 1.5; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0 0 4px; }
h2 { font-size: 1.2rem; margin: 22px 0 10px; }
h3 { font-size: 1.02rem; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }

/* top bar */
.topbar { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 18px;
  padding: 0 20px; height: 56px; position: sticky; top: 0; z-index: 20; }
.topbar .brand { font-weight: 700; font-size: 1.05rem; color: #fff; white-space: nowrap; }
.topbar .brand span { color: #f6c7a6; font-weight: 600; }
.topbar nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.topbar nav::-webkit-scrollbar { height: 4px; } .topbar nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 4px; }
.topbar nav a { color: #dbe4f3; padding: 6px 9px; border-radius: 7px; white-space: nowrap; font-size: .9rem; }
.topbar nav a.on, .topbar nav a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.topbar .right { display: flex; align-items: center; gap: 10px; }
.bell { position: relative; color: #fff; font-size: 1.15rem; padding: 6px 8px; }
.bell b { position: absolute; top: -2px; left: -4px; background: var(--accent); color: #fff;
  font-size: .7rem; border-radius: 10px; padding: 1px 6px; }
.usermenu { position: relative; }
.usermenu > button { background: rgba(255,255,255,.12); border: 0; color: #fff; border-radius: 8px;
  padding: 7px 12px; cursor: pointer; font: inherit; }
.usermenu .menu { display: none; position: absolute; left: 0; top: 40px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; min-width: 190px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.usermenu.open .menu { display: block; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: right; padding: 9px 14px;
  color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--bg); text-decoration: none; }

main { max-width: 1320px; margin: 0 auto; padding: 22px 20px 60px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px; }

/* flash */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; border: 1px solid; }
.flash.ok { background: var(--ok-soft); border-color: #b9e0c7; color: #1e5a37; }
.flash.error { background: var(--late-soft); border-color: #f2bdb6; color: #8a2419; }
.flash.warn { background: var(--risk-soft); border-color: #f0d48f; color: #7a4b04; }

/* cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { font-size: 1.9rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.kpi.late { color: var(--late); } .kpi.risk { color: var(--risk); }
.section-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 8px; font-size: 1.05rem; font-weight: 700; }
.section-title .count { background: var(--done-soft); color: var(--muted); border-radius: 12px; padding: 0 9px; font-size: .85rem; }
.section-title.late { color: var(--late); } .section-title.risk { color: var(--risk); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); border-radius: 8px; padding: 7px 13px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: var(--navy-2); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.danger { color: var(--late); border-color: #f0c2bc; }
.btn.sm { padding: 3px 9px; font-size: .85rem; }
.btn.link { border: 0; background: none; color: var(--navy-2); padding: 0; }
input, select, textarea { font: inherit; border: 1px solid #c9d0db; border-radius: 8px; padding: 7px 10px;
  background: #fff; color: var(--ink); max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9bb4d8; border-color: #9bb4d8; }
textarea { width: 100%; min-height: 70px; }
label { display: block; font-size: .86rem; color: var(--muted); margin-bottom: 3px; }
.field { margin-bottom: 12px; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; }
.inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inline label { margin: 0; }
form.inline { margin: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: .95rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; margin-bottom: 14px; }
.filters input[type=search] { min-width: 230px; }

/* badges */
.badge { display: inline-block; border-radius: 12px; padding: 1px 9px; font-size: .8rem; font-weight: 600;
  background: var(--done-soft); color: var(--muted); white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-risk { background: var(--risk-soft); color: var(--risk); }
.b-overdue, .b-late { background: var(--late-soft); color: var(--late); }
.b-blocked { background: var(--block-soft); color: var(--block); }
.b-done { background: var(--done-soft); color: var(--done); }
.b-navy { background: #e4ebf6; color: var(--navy); }
.b-accent { background: var(--accent-soft); color: var(--accent); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--done); }
.dot.ok { background: var(--ok); } .dot.risk { background: #e0a526; } .dot.overdue { background: var(--late); }
.dot.blocked { background: var(--block); }

/* tables */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f0f3f8; font-size: .84rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:hover td { background: #fafbfd; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.tablewrap table { border: 0; }

/* my tasks */
.task { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: #fff;
  border: 1px solid var(--line); border-right: 5px solid var(--done); border-radius: var(--radius);
  padding: 11px 14px; margin-bottom: 8px; }
.task.overdue { border-right-color: var(--late); } .task.risk { border-right-color: #e0a526; }
.task.ok { border-right-color: var(--ok); } .task.blocked { border-right-color: var(--block); }
.task .title { font-weight: 600; }
.task .meta { color: var(--muted); font-size: .86rem; display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.task .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.approval { background: #fff; border: 1px solid #f0d2bd; border-right: 5px solid var(--accent);
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 8px; }

/* kanban */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; }
.col { background: #e9edf3; border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col h3 { display: flex; justify-content: space-between; font-size: .95rem; color: var(--navy); margin: 2px 4px 10px; }
.pcard { display: block; background: #fff; border-radius: 9px; padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-right: 5px solid var(--ok); color: var(--ink); }
.pcard:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(26,54,93,.12); }
.pcard.risk { border-right-color: #e0a526; } .pcard.overdue { border-right-color: var(--late); }
.pcard.blocked { border-right-color: var(--block); }
.pcard .num { font-size: .78rem; color: var(--muted); }
.pcard .name { font-weight: 650; margin: 2px 0 4px; }
.pcard .pstage { font-size: .85rem; }
.pcard .foot { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.progress { height: 5px; background: #e4e8ef; border-radius: 4px; overflow: hidden; margin-top: 6px; display: flex; }
.progress span { display: block; height: 100%; background: var(--navy-2); }

/* project page */
.phead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 8px; color: var(--muted); font-size: .92rem; }
.facts b { color: var(--ink); font-weight: 600; }
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin: 18px 0 14px; overflow-x: auto; }
.tabs a { padding: 9px 16px; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--navy); }

.timeline { position: relative; margin-top: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px 8px; margin-bottom: 14px; }
.tl-row { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 10px; height: 24px; }
.tl-row .lbl { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; height: 12px; }
.tl-bar { position: absolute; height: 12px; border-radius: 6px; background: #c7d3e6; min-width: 4px; }
.tl-bar.done { background: #b6c0cf; } .tl-bar.ok { background: #7fa6d6; } .tl-bar.risk { background: #e8b74d; }
.tl-bar.overdue { background: #df7366; } .tl-bar.blocked { background: #a87cc6; }
.tl-base { position: absolute; height: 2px; top: 5px; background: #8a94a6; opacity: .5; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--accent); }
.tl-scale { display: grid; grid-template-columns: 190px 1fr; gap: 10px; font-size: .75rem; color: var(--muted); margin-top: 4px; }
.tl-scale div:last-child { display: flex; justify-content: space-between; }

.stage { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; scroll-margin-top: 70px; }
.stage > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 34px 1fr auto;
  gap: 10px; align-items: center; padding: 11px 14px; }
.stage > summary::-webkit-details-marker { display: none; }
.stage .seq { width: 30px; height: 30px; border-radius: 50%; background: #e4ebf6; color: var(--navy);
  display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.stage.s-done .seq { background: var(--ok-soft); color: var(--ok); }
.stage.s-overdue .seq { background: var(--late-soft); color: var(--late); }
.stage.s-na { opacity: .6; }
.stage .sname { font-weight: 650; }
.stage .smeta { font-size: .85rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.stage .sbody { border-top: 1px solid var(--line); padding: 14px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.stage .box { background: #f8f9fb; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.stage .box h4 { margin: 0 0 8px; font-size: .9rem; color: var(--navy); }
.tasks { list-style: none; padding: 0; margin: 0; }
.tasks li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.tasks li.done span { color: var(--muted); text-decoration: line-through; }
.tasks button.tick { width: 20px; height: 20px; border: 2px solid #9aa6b8; border-radius: 5px; background: #fff;
  cursor: pointer; padding: 0; line-height: 1; color: #fff; font-size: 13px; }
.tasks li.done button.tick { background: var(--ok); border-color: var(--ok); }
.req { color: var(--late); font-size: .8rem; }
.lockmsg { background: var(--risk-soft); color: #7a4b04; border-radius: 8px; padding: 8px 10px; font-size: .88rem; margin-bottom: 10px; }
.missing { font-size: .85rem; color: var(--late); margin: 4px 0 0; padding-right: 18px; }
.changes { font-size: .82rem; color: var(--muted); max-height: 130px; overflow-y: auto; margin: 0; padding-right: 16px; }

.comment { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; }
.comment .who { font-weight: 600; } .comment .when { color: var(--muted); font-size: .82rem; }
.comment p { margin: 6px 0 0; white-space: pre-wrap; }
.log td { font-size: .88rem; }

/* notifications */
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px; color: var(--ink); }
.notif.unread { border-right: 4px solid var(--accent); background: #fffaf6; }
.notif:hover { text-decoration: none; background: #f8f9fb; }

/* product photos */
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; vertical-align: middle; }
.thumb.lg { width: 72px; height: 72px; }
.prodstrip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.prodchip { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 4px 10px 4px 4px; font-size: .88rem; color: var(--ink); }
.prodchip .ph { width: 44px; height: 44px; border-radius: 6px; background: #eef1f5; display: grid; place-items: center; color: var(--muted); font-size: .7rem; }
.pcard .pimg { float: left; width: 46px; height: 46px; object-fit: cover; border-radius: 6px; margin-right: 8px; border: 1px solid var(--line); }

/* login */
.login { max-width: 380px; margin: 9vh auto; }
.login .card { padding: 26px; }
.login h1 { color: var(--navy); }

.empty { color: var(--muted); background: #fff; border: 1px dashed #cdd4df; border-radius: var(--radius);
  padding: 18px; text-align: center; }
.funnel-bar { height: 26px; background: var(--navy-2); border-radius: 4px; color: #fff; font-size: .85rem;
  display: flex; align-items: center; padding: 0 8px; white-space: nowrap; min-width: 34px; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 18px; max-width: 460px; width: 92vw; }
dialog::backdrop { background: rgba(20,30,50,.35); }
.hide { display: none !important; }

@media (max-width: 900px) {
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage .sbody { grid-template-columns: 1fr; }
  .tl-row, .tl-scale { grid-template-columns: 110px 1fr; }
  .board { grid-template-columns: repeat(4, 260px); }
}
@media (max-width: 600px) {
  html { font-size: 14px; }
  main { padding: 14px 12px 50px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .topbar { padding: 0 10px; gap: 8px; }
  .topbar .brand { display: none; }
  .task { grid-template-columns: 1fr; }
  .task .actions { justify-content: flex-start; }
  .stage > summary { grid-template-columns: 30px 1fr; }
  .stage > summary > :last-child { grid-column: 2; }
}
@media print {
  .topbar, .tabs, .btn, form { display: none !important; }
  body { background: #fff; }
}

/* searchable select (select[data-search]) */
.combo { position: relative; }
.combo-native { display: none !important; }
.field .combo .combo-input, .combo .combo-input { width: 100%; }
.combo-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.combo.multi .combo-chips:not(:empty) { margin-bottom: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #e8eef7; color: var(--navy);
  border-radius: 999px; padding: 2px 6px 2px 10px; font-size: .88rem; }
.chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem;
  line-height: 1; padding: 0 4px; border-radius: 50%; }
.chip button:hover { background: #d3dceb; color: var(--ink); }
.combo-list { display: none; position: absolute; inset-inline: 0; top: 100%; margin-top: 2px; z-index: 30;
  background: #fff; border: 1px solid #c9d0db; border-radius: 8px; box-shadow: 0 6px 18px rgba(20,30,50,.12);
  max-height: 280px; overflow-y: auto; }
.combo.open .combo-list { display: block; }
.combo-opt { padding: 7px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.combo-opt.act, .combo-opt[data-i]:hover { background: #eef3fa; }
.combo-opt.sel { font-weight: 600; }
.combo-opt.muted { cursor: default; }
.combo-tag { font-size: .75rem; color: var(--accent); background: var(--accent-soft); border-radius: 999px;
  padding: 0 8px; white-space: nowrap; align-self: center; }

/* data panel of receiving / Hashavshevet stages */
.stage .spanel { border-top: 1px solid var(--line); padding: 12px 14px 4px; background: #fbfcfe; }
.stage .spanel h4 { margin: 0 0 8px; font-size: .95rem; color: var(--navy); }
.ptable { font-size: .9rem; margin-bottom: 8px; }
.ptable td, .ptable th { vertical-align: middle; }
.ptable input.qty { width: 80px; }
.ptable td.late { color: var(--late); font-weight: 600; }
.hashbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* "what was decided" note on a task */
.tasks li { flex-wrap: wrap; }
.tasks .tnote { flex-basis: 100%; margin: 2px 34px 4px 0; padding: 5px 10px; background: #fff;
  border: 1px solid var(--line); border-inline-start: 3px solid var(--navy-2); border-radius: 6px;
  font-size: .9rem; color: var(--ink); white-space: pre-wrap; text-decoration: none; }
.tasks .tnote[data-note-open] { cursor: pointer; }
.tasks .tnote[data-note-open]:hover { background: #f1f5fb; }
.tasks .tnote-add { border: 0; background: transparent; color: var(--navy-2); font-size: .8rem;
  cursor: pointer; padding: 0 4px; opacity: .75; }
.tasks .tnote-add:hover { opacity: 1; text-decoration: underline; }
.tasks .tnote-form { flex-basis: 100%; margin: 4px 34px 6px 0; }
.tasks .tnote-form textarea { width: 100%; margin-bottom: 4px; }

/* suppliers: segmented radio, filter chips, bulk bar */
.seg { display: inline-flex; border: 1px solid #c9d0db; border-radius: 8px; overflow: hidden; }
.seg label { margin: 0; cursor: pointer; position: relative; }
.seg input, .field .seg input { position: absolute; inset: 0; width: 1px !important; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; background: #fff; }
.seg label + label span { border-inline-start: 1px solid #c9d0db; }
.seg input:checked + span { background: var(--navy); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid #9bb4d8; }
.filters-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.filters-row .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.chip-f { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 12px; font-size: .88rem; color: var(--ink); }
.chip-f b { color: var(--muted); font-weight: 600; margin-inline-start: 4px; }
.chip-f.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-f.on b { color: #cfd9ea; }
.chip-f:hover { text-decoration: none; border-color: var(--navy-2); }
.bulkbar { margin-bottom: 8px; }

/* ---------------------------------------------------------------- free tasks */
.quickadd input { width: 230px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: #fff; padding: 6px 10px; border-radius: 8px; }
.quickadd input::placeholder { color: #c9d5ea; }
.quickadd input:focus { background: #fff; color: var(--ink); outline: none; width: 320px; }
.quickadd-m { display: none; color: #fff; font-size: 1.5rem; line-height: 1; padding: 2px 10px; border-radius: 8px;
  background: var(--accent); }
.quickadd-m:hover { text-decoration: none; }
.bigadd { display: flex; gap: 8px; padding: 10px; margin-bottom: 16px; }
.bigadd input { flex: 1; font-size: 1.05rem; padding: 10px 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 6px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px; color: var(--muted); border-top: 3px solid var(--line); }
.tile:hover { text-decoration: none; border-color: var(--navy-2); }
.tile .kpi { color: var(--navy); }
.tile.late { border-top-color: var(--late); } .tile.late .kpi { color: var(--late); }
.tile.accent { border-top-color: var(--accent); } .tile.accent .kpi { color: var(--accent); }
.tiles.flat .tile { border-top-width: 1px; }
.kpi.ok { color: var(--ok); }
.breakdown h3 { margin-bottom: 8px; }
.breakdown table { width: 100%; font-size: .92rem; }
.breakdown td, .breakdown th { padding: 5px 6px; }
.breakdown td + td, .breakdown th + th { text-align: center; width: 70px; }
.breakdown a.late { color: var(--late); font-weight: 700; }
.task.todo .title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task.todo .tick { width: 20px; height: 20px; border: 2px solid #9aa6b8; border-radius: 50%; background: #fff;
  cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; }
.task.todo .tick:hover { border-color: var(--ok); background: var(--ok-soft); }
.task.todo .tick.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.task.todo.closed .title a { color: var(--muted); }
.task.todo.done { border-right-color: var(--done); }
.task .nextstep { font-size: .88rem; color: var(--navy-2); margin-top: 3px; }
.task .meta .late { color: var(--late); font-weight: 600; }
.dchip { background: #eef2f8; color: var(--navy); border-radius: 999px; padding: 0 8px; }
.st-inbox { background: var(--accent-soft); color: var(--accent); }
.st-todo { background: #eef1f5; color: var(--muted); }
.st-in_progress { background: #e4ebf6; color: var(--navy); }
.st-waiting { background: var(--risk-soft); color: var(--risk); }
.st-done { background: var(--ok-soft); color: var(--ok); }
.st-cancelled { background: var(--done-soft); color: var(--done); text-decoration: line-through; }
.statusbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.spill { border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; cursor: pointer; font: inherit;
  font-size: .9rem; opacity: .75; }
.spill:hover { opacity: 1; }
.spill.on { opacity: 1; outline: 2px solid currentColor; font-weight: 700; cursor: default; }
.phone { max-width: 520px; margin: 0 auto; }
.phone textarea { width: 100%; font-size: 1.15rem; padding: 12px; margin-bottom: 10px; }
.btn.big { width: 100%; justify-content: center; padding: 12px; font-size: 1.1rem; }
.phone-links { display: flex; gap: 8px; margin-top: 12px; }
.phone-links .btn { flex: 1; justify-content: center; }
.phone-recent { list-style: none; padding: 0; margin: 0; }
.phone-recent li { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
@media (max-width: 900px) {
  .quickadd { display: none; }
  .quickadd-m { display: inline-block; }
}
@media (max-width: 600px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bigadd { flex-direction: column; }
  .task.todo .actions { display: none; }
}
.pgoal { background: #fff; border: 1px solid var(--line); border-inline-start: 3px solid var(--accent);
  border-radius: 8px; padding: 8px 12px; margin-top: 10px; display: grid; gap: 3px; }
.pcard .foot b.late { color: var(--late); }
.filterbox > summary { list-style: none; margin-bottom: 10px; cursor: pointer; }
.filterbox > summary::-webkit-details-marker { display: none; }
@media (min-width: 701px) { .filterbox > summary { display: none; } }
@media (max-width: 600px) { .topbar nav a { padding: 8px 8px; } }

/* project groups: one closed line per project, its stages open on click */
.pgroup { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.pgroup > summary { list-style: none; cursor: pointer; padding: 10px 14px; display: flex; flex-wrap: wrap;
  align-items: center; gap: 8px; }
.pgroup > summary::-webkit-details-marker { display: none; }
.pgroup > summary::before { content: "◂"; color: var(--muted); transition: transform .15s; }
.pgroup[open] > summary::before { transform: rotate(-90deg); }
.pgroup > summary:hover { background: #f8f9fb; }
.pgroup .pg-name { font-weight: 650; color: var(--navy); }
.pgroup .pg-body { padding: 0 10px 4px; }
.pgroup .pg-body .task { margin-bottom: 8px; }
.pg-stages { list-style: none; margin: 0; padding: 0 14px 10px; }
.pg-stages li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }

/* eye button on password fields */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; padding-inline-end: 40px; }
.pw-eye { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); border: 0;
  background: transparent; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 6px;
  display: inline-flex; align-items: center; }
.pw-eye:hover { color: var(--navy); background: #eef2f8; }
.pw-eye[aria-pressed="true"] { color: var(--navy); }
.logincard { margin-bottom: 14px; border-inline-start: 3px solid var(--accent); }
.logincard pre { background: #f8f9fb; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font-family: inherit; white-space: pre-wrap; direction: rtl; unicode-bidi: plaintext; margin: 8px 0; }

/* ---------------------------------------------------------------- legal */
.lcase { display: flex; justify-content: space-between; gap: 14px; background: #fff; border: 1px solid var(--line);
  border-inline-start: 4px solid var(--navy-2); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px;
  color: var(--ink); }
.lcase:hover { text-decoration: none; border-color: var(--navy-2); }
.lcase.late { border-inline-start-color: var(--late); }
.lcase.closed { border-inline-start-color: var(--done); opacity: .8; }
.lc-title { font-weight: 650; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lcase .meta { color: var(--muted); font-size: .86rem; display: flex; gap: 12px; flex-wrap: wrap; margin-top: 3px; }
.lc-note { font-size: .88rem; color: var(--ink); margin-top: 4px; }
.lc-date { display: flex; flex-direction: column; align-items: flex-end; text-align: end; gap: 2px; white-space: nowrap; }
.lc-date .late, .lc-status .late { color: var(--late); }
.lc-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.lc-status > div { display: flex; flex-direction: column; gap: 2px; }
.lc-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.ltimeline { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--line); }
.ltimeline li { padding: 6px 12px; position: relative; }
.ltimeline li::before { content: ""; position: absolute; inset-inline-start: -6px; top: 12px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--navy-2); }
.ltimeline li.lt-change::before, .ltimeline li.lt-file::before { background: #c9d0db; }
.ltimeline li.lt-change > div:last-child, .ltimeline li.lt-file > div:last-child { color: var(--muted); font-size: .9rem; }
.ls-open { background: #e4ebf6; color: var(--navy); }
.ls-lawyer { background: var(--block-soft); color: var(--block); }
.ls-negotiation { background: var(--accent-soft); color: var(--accent); }
.ls-court { background: var(--late-soft); color: var(--late); }
.ls-waiting { background: var(--risk-soft); color: var(--risk); }
.ls-closed { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 900px) { .lc-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .lcase { flex-direction: column; } .lc-date { align-items: flex-start; text-align: start; } }
.nowrap-inline { flex-wrap: nowrap; width: 100%; }
.field .nowrap-inline select { width: auto; }
.seriesnote { background: #eef3fa; border: 1px solid #d3dceb; border-radius: 8px; padding: 7px 12px; margin-bottom: 10px; font-size: .92rem; }
.card.steps .tasks li { padding: 5px 0; }
.card.steps textarea { min-height: 38px; }
.task.todo.prio-high { box-shadow: inset 3px 0 0 var(--late); }
.task.todo.prio-low { opacity: .72; }
.task.todo.prio-low:hover { opacity: 1; }

/* arrivals board */
.arow { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid var(--navy-2);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.arow.st-port, .arow.st-released { border-inline-start-color: var(--accent); }
.arow.st-received { border-inline-start-color: var(--ok); }
.arow.st-planned { border-inline-start-color: var(--done); }
.ar-date { flex: 0 0 74px; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: .78rem; color: var(--muted); }
.ar-date b { font-size: 1.35rem; color: var(--navy); line-height: 1.2; }
.ar-main { flex: 1; min-width: 0; }
.ar-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 600; }
.ar-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); margin-top: 2px; }
.ar-lines summary { cursor: pointer; color: var(--navy-2); margin-top: 4px; }
.ar-lines table { margin-top: 6px; }
.ar-lines tr.late td { color: var(--late); }
.ar-week h3 { margin: 14px 0 8px; font-size: 1.02rem; }
.ar-week h3 .muted { font-weight: 400; margin-inline-start: 6px; }
.badge.ar-s-planned { background: var(--done-soft); color: var(--done); }
.badge.ar-s-sea { background: #e8eef7; color: var(--navy-2); }
.badge.ar-s-port, .badge.ar-s-released { background: var(--accent-soft); color: var(--accent); }
.badge.ar-s-received { background: var(--ok-soft); color: var(--ok); }
.badge.ar-cold { background: #e0f2fb; color: #0f6a93; }
.sto { border-radius: 6px; padding: 0 6px; background: var(--done-soft); color: var(--ink); }
.sto-chilled { background: #e0f2fb; color: #0f6a93; } .sto-frozen { background: #dde6fb; color: #2c4fa3; }
.accent-t { color: var(--accent); }
@media (max-width: 600px) { .arow { padding: 8px; gap: 8px; } .ar-date { flex-basis: 54px; } }
@media print { .filters-row, .tiles { display: none; } .arow { break-inside: avoid; } .ar-lines { display: block; } }
.ar-main .late { color: var(--late); }

/* manufacturer / dealer badge next to supplier names */
.stype { display: inline-block; border-radius: 6px; padding: 0 6px; font-size: .74rem; font-weight: 600;
  line-height: 1.5; vertical-align: 1px; white-space: nowrap; }
.stype-supplier { background: #e7f2ec; color: #2f7d4f; }
.stype-dealer { background: #f3e9f8; color: #6b2c91; }

/* agriculture */
.afarmer { display: flex; gap: 14px; justify-content: space-between; color: var(--ink); margin-bottom: 8px; padding: 12px 14px; }
.afarmer:hover { text-decoration: none; border-color: var(--navy-2); }
.af-main { min-width: 0; flex: 1; }
.af-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.af-nums { display: flex; gap: 14px; align-items: center; }
.af-nums div { display: flex; flex-direction: column; align-items: center; min-width: 54px; }
.af-nums b { font-size: 1.15rem; color: var(--navy); }
.af-nums span { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.badge.agap-b { background: var(--risk-soft); color: var(--risk); }
.badge.b-ok { background: var(--ok-soft); color: var(--ok); }
.agaps { border-inline-start: 4px solid var(--risk); margin: 12px 0; }
.agaps ul { margin: 6px 0 8px; padding-inline-start: 18px; }
.agap { padding: 8px 12px; margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.acrop { display: block; color: var(--ink); margin-bottom: 8px; padding: 10px 14px; border-inline-start: 4px solid var(--ok); }
.acrop:hover { text-decoration: none; border-color: var(--navy-2); }
.acrop.ended { opacity: .6; border-inline-start-color: var(--done); }
.ac-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ac-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; color: var(--muted); margin-top: 3px; }
.badge.cs-planning { background: var(--done-soft); color: var(--done); }
.badge.cs-planted, .badge.cs-growing { background: #e8eef7; color: var(--navy-2); }
.badge.cs-harvest { background: var(--ok-soft); color: var(--ok); }
.aplot { display: flex; margin-bottom: 6px; }
.agrid-wrap { max-width: 100%; overflow-x: auto; }
.agrid { font-size: .8rem; border-collapse: separate; border-spacing: 2px; background: transparent; }
.agrid th, .agrid td { padding: 3px 5px; text-align: center; white-space: nowrap; }
.agrid thead th { color: var(--muted); font-weight: 600; background: transparent; }
.agrid thead th.now { color: var(--accent); }
.agrid th.sticky { position: sticky; right: 0; background: var(--bg); text-align: start; z-index: 1; min-width: 110px; }
.agrid td { background: #fff; border-radius: 5px; min-width: 52px; line-height: 1.25; }
.agrid td b { font-weight: 700; } .agrid td span { color: var(--muted); }
.agrid td i, .agrid td em { display: block; font-style: normal; font-size: .68rem; color: var(--muted); }
.agrid td i.one { color: var(--risk); } .agrid td em { color: var(--ok); }
.ac-short { background: var(--late-soft) !important; } .ac-short b { color: var(--late); }
.ac-ok { background: var(--ok-soft) !important; }
.ac-surplus { background: var(--risk-soft) !important; }
.ac-supply { background: #eef2f8 !important; }
.ac-none { background: #fafbfc !important; }
.alegend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; }
.alegend span { padding: 0 8px; border-radius: 5px; }
.aalerts { margin-bottom: 12px; } .aalerts h3 { margin: 0 0 6px; font-size: .95rem; }
.arow-mini { margin-bottom: 4px; } .arow-mini > span:first-child { display: inline-block; min-width: 82px; color: var(--muted); }
.arow-mini > span.late { color: var(--late); }
.agroup { margin-bottom: 12px; }
.ag-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.ag-head h3 { margin: 0; }
.tl-months { display: flex; margin-inline-start: 220px; border-bottom: 1px solid var(--line); }
.tl-months span { flex: 1; font-size: .72rem; color: var(--muted); text-align: center; }
.ag-row { display: flex; align-items: center; border-bottom: 1px dashed #eef1f5; min-height: 40px; }
.ag-who { flex: 0 0 220px; display: flex; flex-direction: column; color: var(--ink); padding: 3px 0; line-height: 1.3; }
.ag-track { flex: 1; position: relative; height: 22px; }
.ag-bar { position: absolute; top: 4px; height: 14px; border-radius: 7px; background: var(--ok); }
.ag-bar.cs-planning { background: #b9c3d3; } .ag-bar.cs-ended { background: var(--done); }
.ag-track .tl-today { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--accent); }
.weeknav { display: flex; gap: 10px; align-items: center; justify-content: center; margin-bottom: 12px; }
.areceive { margin-bottom: 10px; } .areceive h3 { margin: 0 0 6px; }
.ar-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #eef1f5; margin: 0; }
.ar-line input { width: 110px; font-size: 1.05rem; text-align: center; }
.dev-board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.dev-col { background: #eaeef4; border-radius: var(--radius); padding: 8px; min-height: 120px; }
.dev-col h3 { margin: 2px 4px 8px; font-size: .92rem; }
.dev-item { display: block; color: var(--ink); padding: 8px 10px; margin-bottom: 6px; }
.dev-item:hover { text-decoration: none; border-color: var(--navy-2); }
@media (max-width: 900px) { .dev-board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .afarmer { flex-direction: column; } .af-nums { justify-content: space-between; }
  .tl-months { margin-inline-start: 0; } .ag-row { flex-direction: column; align-items: stretch; padding: 4px 0; }
  .ag-who { flex-basis: auto; } .dev-board { grid-template-columns: 1fr; }
}

/* self update */
.upstate { border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; background: #eef2f8; }
.upstate.up-ok, .upstate.up-uptodate { background: var(--ok-soft); }
.upstate.up-failed, .upstate.up-rolled_back, .upstate.up-down { background: var(--late-soft); }
.upnew { background: var(--accent-soft); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; }
.upnew ul { margin: 6px 0 0; padding-inline-start: 18px; }
.uplog { max-height: 360px; overflow: auto; font-size: .75rem; white-space: pre-wrap; background: #f6f7f9; padding: 8px; }
.ok-t { color: var(--ok); }

/* ================================================================ mobile shell */
.mbrand, .mnav, .msheet { display: none; }
.ico { width: 22px; height: 22px; flex: none; }
.bell .ico { width: 21px; height: 21px; vertical-align: -4px; }
@media (max-width: 760px) {
  html { font-size: 15px; }
  .topbar { height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; gap: 8px; }
  .topbar .brand, .topbar .dnav, .usermenu, .quickadd, .quickadd-m, .brandcol { display: none !important; }
  .mbrand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; flex: 1; }
  .mbrand:hover { text-decoration: none; }
  .mbrand i { font-style: normal; font-weight: 800; font-size: .78rem; background: var(--accent); color: #fff;
    border-radius: 8px; width: 30px; height: 30px; display: grid; place-items: center; flex: none; letter-spacing: .02em; }
  .mbrand span { font-weight: 650; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bell { padding: 8px; }

  .mnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; right: 0; left: 0; z-index: 30;
    background: rgba(255,255,255,.97); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  .mnav a, .mnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--muted); font: inherit; font-size: .7rem; background: none; border: 0; padding: 6px 2px; border-radius: 10px;
    min-height: 52px; -webkit-tap-highlight-color: transparent; }
  .mnav a:hover { text-decoration: none; }
  .mnav .on { color: var(--navy); font-weight: 700; }
  .mnav .on .ico { stroke: var(--accent); }
  .mnav span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .mnav .madd { align-self: center; justify-self: center; width: 52px; height: 52px; min-height: 0; border-radius: 16px;
    background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(200,100,42,.35); margin-top: -18px; }
  .mnav .madd .ico { width: 26px; height: 26px; stroke-width: 2.4; }
  body.authed main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body.noscroll { overflow: hidden; }

  .msheet { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(15,25,45,0); transition: background .2s; }
  .msheet[hidden] { display: none; }
  .msheet.open { background: rgba(15,25,45,.45); }
  .ms-panel { position: absolute; bottom: 0; right: 0; left: 0; background: #fff; border-radius: 20px 20px 0 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s ease-out;
    max-height: 85vh; overflow-y: auto; }
  .msheet.open .ms-panel { transform: none; }
  .ms-grip { width: 40px; height: 4px; border-radius: 4px; background: #d5dbe4; margin: 2px auto 12px; }
  .ms-user { display: flex; align-items: center; gap: 10px; padding: 0 4px 12px; border-bottom: 1px solid var(--line); }
  .ms-user .ico { width: 34px; height: 34px; padding: 6px; border-radius: 50%; background: var(--done-soft); color: var(--navy); }
  .ms-user div { display: flex; flex-direction: column; line-height: 1.3; } .ms-user span { color: var(--muted); font-size: .85rem; }
  .ms-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 0; }
  .ms-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px;
    background: var(--bg); color: var(--ink); font-size: .84rem; text-align: center; }
  .ms-grid a:hover { text-decoration: none; }
  .ms-grid a .ico { width: 26px; height: 26px; color: var(--navy); }
  .ms-grid a.on { background: var(--navy); color: #fff; } .ms-grid a.on .ico { color: #f6c7a6; }
  .ms-list { border-top: 1px solid var(--line); padding-top: 6px; }
  .ms-list a, .ms-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 6px; color: var(--ink);
    background: none; border: 0; font: inherit; text-align: right; }
  .ms-list .ico { color: var(--muted); }

  /* page content */
  main { padding: 14px 12px; }
  h1 { font-size: 1.32rem; }
  .pagehead { align-items: flex-start; margin-bottom: 12px; gap: 10px; }
  .pagehead .toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
  .pagehead .toolbar .btn { padding: 7px 11px; }
  input, select, textarea { font-size: 16px; }          /* no zoom-in on iPhone */
  .btn { min-height: 38px; }
  .btn.sm, .btn.link { min-height: 0; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 9px 10px; }
  .tile .kpi, .kpi { font-size: 1.45rem; }
  .tile > span:last-child, .tile span:not(.kpi) { font-size: .8rem; line-height: 1.25; }
  .board { display: flex; flex-direction: column; gap: 10px; overflow: visible; }
  .board .col { min-height: 0; padding: 8px; }
  .board .col:not(:has(.pcard)) { display: none; }
  .tabs { margin: 10px -12px 12px; padding: 0 12px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 9px 12px; }
  .filters-row { flex-wrap: nowrap; overflow-x: auto; margin-inline: -12px; padding: 0 12px 4px; scrollbar-width: none; }
  .filters-row::-webkit-scrollbar { display: none; }
  .chip-f { white-space: nowrap; padding: 5px 12px; }
  .card { padding: 13px; }
  table { font-size: .88rem; }
  main > table, .card > table, .grid table { display: block; overflow-x: auto; }
  dialog { width: 94vw; }
}
@media (max-width: 380px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid > * { min-width: 0; }
input[type=file] { max-width: 100%; }
@media (max-width: 760px) { main table:not(.agrid) { display: block; overflow-x: auto; max-width: 100%; } }
@media (max-width: 760px) { form.inline { flex-wrap: wrap; max-width: 100%; } form.inline input[type=file] { flex: 1 1 100%; } }
@media (max-width: 1450px) and (min-width: 761px) {
  .topbar { gap: 10px; padding: 0 14px; } .topbar .brand span { font-size: .8rem; }
  .topbar nav a { padding: 5px 6px; font-size: .82rem; } .quickadd input { width: 125px; font-size: .82rem; }
  .quickadd input:focus { width: 260px; }
  .topbar .usermenu > button { padding: 6px 9px; font-size: .85rem; }
}

/* ================================================================ management reports (sales / debtors) */
.mg-hero { position: relative; border-radius: 18px; padding: 20px 22px 14px; margin-bottom: 14px; color: #fff; overflow: hidden;
  background: radial-gradient(120% 90% at 85% 0%, #2a5089 0%, #1a365d 45%, #0f2240 100%);
  box-shadow: 0 18px 40px rgba(16,35,63,.28); }
.mg-hero::before { content: ""; position: absolute; inset: 0; opacity: .12; pointer-events: none;
  background-image: radial-gradient(#cfdcf0 1px, transparent 1.3px); background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(#000, transparent 70%); mask-image: linear-gradient(#000, transparent 70%); }
.mg-head { position: relative; display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: flex-end; justify-content: space-between; }
.mg-big { display: flex; flex-direction: column; gap: 4px; }
.mg-cap { color: #f6c7a6; font-size: .9rem; font-weight: 600; }
.mg-big b { font-size: clamp(2.3rem, 6vw, 3.4rem); font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.mg-big b small { font-size: .45em; font-weight: 600; color: #b8c7dd; }
.mg-chip { align-self: flex-start; border-radius: 999px; padding: 2px 10px; font-size: .82rem; font-weight: 700; background: rgba(255,255,255,.12); }
.mg-kpis { display: grid; grid-template-columns: repeat(4, minmax(120px, auto)); gap: 10px; }
.mg-kpis > div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 9px 12px;
  display: flex; flex-direction: column; gap: 1px; backdrop-filter: blur(4px); }
.mg-kpis span { font-size: .78rem; color: #b8c7dd; } .mg-kpis b { font-size: 1.3rem; } .mg-kpis i { font-style: normal; font-size: .76rem; color: #b8c7dd; }
.mg-hero .up, .mg-months .up, .c3-tip .up, .mg-list .up { color: #6fe39b; } .mg-hero .down, .mg-months .down, .c3-tip .down, .mg-list .down { color: #ff8f80; }
.mg-mode { position: relative; display: inline-flex; gap: 4px; margin: 16px 0 0; background: rgba(255,255,255,.08); padding: 4px; border-radius: 10px; }
.mg-mode button { background: none; border: 0; color: #c9d5ea; font: inherit; font-size: .88rem; padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.mg-mode button.on { background: #fff; color: var(--navy); font-weight: 700; }
.mg-chart { position: relative; perspective: 1100px; margin-top: 4px; }
.c3-wrap { position: relative; transform: rotateX(10deg); transform-origin: 50% 80%; transition: transform .35s ease-out; }
.c3 { width: 100%; height: auto; display: block; overflow: visible; }
.c3-bar { cursor: pointer; transform-box: fill-box; transform-origin: 50% 100%; animation: c3-grow .9s cubic-bezier(.2, 1.1, .3, 1) var(--d) both;
  transition: opacity .2s; outline: none; }
.c3-bar.dim { opacity: .45; }
.c3-bar.best rect { filter: drop-shadow(0 0 8px rgba(246,199,166,.55)); }
.c3-emoji { font-size: 21px; text-anchor: middle; animation: c3-pop .5s cubic-bezier(.2, 1.6, .4, 1) calc(var(--d) + .75s) both; }
.c3-val { font-size: 12.5px; font-weight: 700; fill: #fff; text-anchor: middle; }
.c3-lbl { font-size: 13px; fill: #c9d5ea; text-anchor: middle; }
.c3-axis { font-size: 10.5px; fill: rgba(255,255,255,.4); }
.c3-avg { stroke: #f6c7a6; stroke-width: 2; stroke-dasharray: 7 6; animation: c3-dash 1.2s linear infinite; }
.c3-avgt { font-size: 12px; fill: #f6c7a6; font-weight: 700; }
.c3-tip { position: absolute; z-index: 5; min-width: 170px; background: #fff; color: var(--ink); border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.3); font-size: .86rem; line-height: 1.5; pointer-events: none; }
.c3-tip .t-row { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); }
.c3-tip .t-row i { font-style: normal; font-weight: 700; }
.c3-tip .up { color: var(--ok) !important; } .c3-tip .down { color: var(--late) !important; }
@keyframes c3-grow { from { transform: scaleY(0); opacity: 0; } 30% { opacity: 1; } to { transform: scaleY(1); } }
@keyframes c3-pop { from { opacity: 0; transform: translateY(10px) scale(.4); } to { opacity: 1; transform: none; } }
@keyframes c3-dash { to { stroke-dashoffset: -26; } }
.mg-legend { position: relative; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: #c9d5ea; margin-top: 6px; }
.mg-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.mg-legend .muted { color: #9fb3d1; }

.mg-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.mg-month { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column;
  align-items: center; gap: 1px; text-align: center; animation: sp-up .45s ease-out calc(.3s + var(--i) * 45ms) both; }
.mg-month .mm-name { font-size: .78rem; color: var(--muted); } .mg-month .mm-emo { font-size: 1.35rem; line-height: 1.3; }
.mg-month b { font-size: .95rem; } .mg-month i { font-style: normal; font-size: .74rem; font-weight: 700; }
.mg-month .up { color: var(--ok) !important; } .mg-month .down { color: var(--late) !important; }
.mg-month.empty { opacity: .45; background: transparent; border-style: dashed; }
.mg-month.best { border-color: #e7a46e; box-shadow: 0 0 0 2px rgba(231,164,110,.25); }
.mg-month.worst { border-color: #9fc4e8; }
@keyframes sp-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.mg-insight { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; margin-bottom: 8px; border-inline-start: 4px solid var(--navy-2); animation: sp-up .45s ease-out calc(.5s + var(--i) * 80ms) both; }
.mg-insight .mi-ico { font-size: 1.4rem; line-height: 1.2; }
.mg-insight div { display: flex; flex-direction: column; gap: 2px; } .mg-insight span:not(.mi-ico) { color: var(--muted); font-size: .88rem; }
.mg-insight.t-good { border-inline-start-color: var(--ok); } .mg-insight.t-bad { border-inline-start-color: var(--late); }
.mg-insight.t-tip { border-inline-start-color: var(--accent); background: #fffaf5; }

.mg-donut-card { display: flex; gap: 22px; align-items: center; perspective: 700px; }
.mg-donut { --p: 70; width: 170px; height: 170px; border-radius: 50%; flex: none; position: relative;
  background: conic-gradient(#4a7cc0 0 calc(var(--p) * 1%), #4fbf7f 0 100%);
  transform: rotateX(48deg); box-shadow: 0 9px 0 #2a5288, 0 18px 24px rgba(0,0,0,.18);
  animation: mg-spin 1.2s cubic-bezier(.2, 1, .3, 1) .3s both; }
.mg-donut-in { position: absolute; inset: 30px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center;
  justify-content: center; transform: rotateX(-48deg) translateZ(30px); box-shadow: inset 0 4px 10px rgba(0,0,0,.12); }
.mg-donut-in b { font-size: 1.6rem; color: var(--navy); } .mg-donut-in span { font-size: .8rem; color: var(--muted); }
@keyframes mg-spin { from { transform: rotateX(48deg) rotateZ(-200deg) scale(.6); opacity: 0; } to { transform: rotateX(48deg); opacity: 1; } }
.mg-split { display: flex; flex-direction: column; gap: 12px; }
.mg-split div { display: flex; flex-direction: column; font-size: .88rem; color: var(--muted); }
.mg-split i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; }
.mg-split b { font-size: 1.25rem; color: var(--ink); }
.mg-targets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.mg-targets label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); margin: 0; }
.mg-targets input { width: 100%; }

@media (max-width: 900px) { .mg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; } .mg-months { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .mg-hero { margin-inline: -12px; border-radius: 0; padding: 16px 14px 12px; }
  .mg-chart { overflow-x: auto; margin-inline: -14px; padding: 0 14px; scrollbar-width: none; }
  .mg-chart::-webkit-scrollbar { display: none; }
  .mg-chart .c3-wrap { min-width: 680px; }
  .mg-months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mg-donut-card { flex-direction: column; } .mg-targets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .c3-bar, .c3-emoji, .mg-month, .mg-insight, .mg-donut { animation: none !important; } .c3-avg { animation: none; } }
.mg-sub { position: relative; margin-top: 16px; font-weight: 700; font-size: .95rem; } .mg-sub .muted { color: #9fb3d1; font-weight: 400; font-size: .82rem; }
.mg-top { padding: 8px 12px; }
.mt-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #eef1f5; }
.mt-row:last-child { border-bottom: 0; }
.mt-rank { width: 22px; height: 22px; border-radius: 7px; background: var(--done-soft); display: grid; place-items: center; font-size: .78rem; font-weight: 700; flex: none; }
.mt-em { font-size: 1.05rem; } .mt-main { flex: 1; min-width: 0; } .mt-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.mt-val { font-size: 1rem; white-space: nowrap; }
.mt-bar { height: 6px; border-radius: 4px; background: #eef1f5; margin-top: 4px; overflow: hidden; }
.mt-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(270deg, #f3ab78, #c8642a);
  transform-origin: right; animation: mt-grow .9s cubic-bezier(.2, 1, .3, 1) calc(.3s + var(--i, 0) * 70ms) both; }
@keyframes mt-grow { from { transform: scaleX(0); } }
.mg-move div { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; } .mg-move span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.mg-filters input[type=search] { width: 100%; max-width: 420px; }
.mg-filters .chip-f { cursor: pointer; } .mg-filters .chip-f b { margin-inline-start: 6px; font-weight: 600; color: var(--muted); font-size: .78rem; }
.mg-filters .chip-f.on b { color: inherit; }
.mg-list { padding: 4px 12px; }
.ml-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef1f5; }
.ml-row:last-child { border-bottom: 0; }
.ml-em { font-size: 1.15rem; width: 26px; text-align: center; }
.ml-main { flex: 1; min-width: 0; display: flex; flex-direction: column; } .ml-main b { font-size: .95rem; }
.ml-main .mt-bar { max-width: 320px; height: 5px; } .ml-main .mt-bar i { animation: none; }
.ml-val { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.ml-val b { font-size: 1.02rem; } .ml-val i { font-style: normal; font-size: .76rem; font-weight: 700; }
.mg-list .up { color: var(--ok) !important; } .mg-list .down { color: var(--late) !important; }
.mg-upload .mg-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px dashed #c9d3e2; border-radius: 14px;
  padding: 26px 14px; text-align: center; cursor: pointer; background: #fafbfd; margin: 0; }
.mg-drop-ico { font-size: 2.2rem; } .mg-drop input { margin-top: 6px; }
.mg-teaser { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mg-tz { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; color: #fff;
  background: radial-gradient(120% 120% at 90% 0%, #2a5089, #1a365d 60%, #10233f); box-shadow: 0 8px 20px rgba(16,35,63,.2); }
.mg-tz:hover { text-decoration: none; transform: translateY(-1px); }
.mg-tz.debt { background: radial-gradient(120% 120% at 90% 0%, #d9773a, #a95722 60%, #7d3f17); }
.mg-tz .tz-ico { font-size: 1.9rem; }
.mg-tz div { flex: 1; display: flex; flex-direction: column; } .mg-tz span { font-size: .82rem; opacity: .85; }
.mg-tz b { font-size: 1.35rem; } .mg-tz i { font-style: normal; font-size: .8rem; font-weight: 700; }
.mg-tz .up { color: #8ff0b4; } .mg-tz .down { color: #ffd0c4; }
.mg-tz .tz-go { font-size: .82rem; opacity: .9; white-space: nowrap; }
.mg-net { font-size: .85rem; color: #c9d5ea; }
.ml-legal { border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 8px; padding: 3px 8px; font: inherit;
  font-size: .78rem; white-space: nowrap; cursor: pointer; opacity: .55; transition: opacity .15s; }
.ml-row:hover .ml-legal, .ml-legal:focus { opacity: 1; }
.ml-legal.on { opacity: 1; background: #f1ecfa; border-color: #c9b6ea; color: #5b2f99; font-weight: 700; }
.ml-legal.on:hover { text-decoration: none; }
@media (max-width: 760px) { .ml-legal { opacity: 1; padding: 3px 6px; } }
.ag-split { display: flex; height: 8px; width: min(320px, 70vw); border-radius: 6px; overflow: hidden; margin: 6px 0 2px; background: rgba(255,255,255,.1); }
.ag-split i { display: block; height: 100%; } .ag-split .f { background: #c3ccd8; } .ag-split .o { background: linear-gradient(270deg, #f0a03c, #c9302c); }
.ag-agents { padding: 10px 14px; }
.aa-row { padding: 6px 0; border-bottom: 1px solid #eef1f5; } .aa-row:last-of-type { border-bottom: 0; }
.aa-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.aa-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: #eef1f5; margin-top: 5px; }
.aa-bar i { display: block; height: 100%; } .aa-bar.sm { height: 6px; max-width: 360px; margin-top: 4px; }
.aa-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .76rem; color: var(--muted); margin-top: 8px; }
.aa-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: 4px; }
.up-row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 10px; align-items: center; padding: 5px 0; font-size: .9rem; }
.up-row .mt-bar { margin: 0; height: 9px; } .up-row b { text-align: left; }
.ml-main:hover { text-decoration: none; } .ml-main:hover b { color: var(--navy-2); text-decoration: underline; }
a.ml-main { color: var(--ink); }
.ag-cbuckets { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.agb { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--c, var(--navy)); border-radius: 12px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 2px; }
.agb span { font-size: .78rem; color: var(--muted); } .agb b { font-size: 1.15rem; } .agb.zero { opacity: .5; }
.agb.total { background: var(--navy); color: #fff; border-color: var(--navy); } .agb.total span { color: #c9d5ea; }
.agd { display: inline-block; padding: 1px 8px; border-radius: 999px; font-weight: 700; color: #fff; background: var(--c); white-space: nowrap; }
@media (max-width: 760px) { .ag-cbuckets { grid-template-columns: repeat(3, minmax(0, 1fr)); } .up-row { grid-template-columns: 90px 1fr 60px; } }
.fbox { margin-bottom: 8px; padding: 12px 14px; }
.fbox summary { cursor: pointer; }
.fgrid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin-top: 10px; }
.fgrid .field { margin: 0; }
.frow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.frow .flbl { font-size: .82rem; color: var(--muted); min-width: 70px; font-weight: 600; }
.frow input { width: 90px; } .frow select { width: auto; }
.frow .chip-f { cursor: pointer; }
.fsum { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 4px; font-size: .9rem; }
.fsum-act { display: flex; gap: 6px; }
@media (max-width: 760px) {
  .fgrid { grid-template-columns: 1fr 1fr; } .fgrid .field:first-child { grid-column: 1 / -1; }
  .frow { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; } .frow::-webkit-scrollbar { display: none; }
  .frow .flbl { min-width: auto; white-space: nowrap; } .frow input { width: 74px; flex: none; }
}
a.ml-name { font-weight: 700; color: var(--ink); } a.ml-name:hover { color: var(--navy-2); text-decoration: underline; }
.mt-main a.ml-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.ml-inv { font-size: .72rem; font-weight: 600; color: var(--navy-2); background: #eef2f8; border-radius: 6px; padding: 0 6px; margin-inline-start: 4px; }
/* elements hidden by the filters (display: flex on a class must not override the hidden attribute) */
[hidden] { display: none !important; }
.ml-note-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 2px 7px; cursor: pointer; font-size: .95rem;
  opacity: .45; position: relative; } .ml-note-btn.has { opacity: 1; background: #fff8e6; border-color: #f0d48a; }
.ml-row:hover .ml-note-btn { opacity: 1; }
.ml-note-btn sup { font-size: .62rem; font-weight: 700; color: var(--accent); margin-inline-start: 1px; }
.ml-note { font-size: .82rem; margin-top: 3px; color: var(--ink); background: #fffaf0; border-inline-start: 3px solid #f0c75e; padding: 2px 8px;
  border-radius: 4px; max-width: 560px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-note .hold, .hold { color: #7a4b00; font-weight: 700; }
.ml-row[data-hold="1"] { background: linear-gradient(270deg, rgba(240,199,94,.12), transparent 60%); }
.note-dlg { width: min(520px, 94vw); }
.nd-hist { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; margin-bottom: 10px; background: #fafbfd; }
.nd-item { padding: 7px 0; border-bottom: 1px solid #eef1f5; } .nd-item:last-child { border-bottom: 0; }
.note-card { border-inline-start: 4px solid #f0c75e; } .note-card.held { background: #fffaf0; }
@media (max-width: 760px) { .ml-note-btn { opacity: 1; } .ml-note { white-space: normal; } }

/* ================================================================ customers */
.cu-av { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #2a5089, #1a365d); color: #fff; display: grid;
  place-items: center; font-weight: 700; flex: none; }
.cu-av.lg { width: 52px; height: 52px; font-size: 1.4rem; }
.cu-title { display: flex; gap: 12px; align-items: center; }
a.cu-row { color: var(--ink); } a.cu-row:hover { text-decoration: none; background: #f8fafc; }
.cu-tags { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .78rem; margin-top: 2px; }
.cu-tags i { font-style: normal; } .cu-tags .warn { color: var(--risk); font-weight: 700; } .cu-tags .lg { color: #5b2f99; font-weight: 700; }
.badge.cs-pending { background: var(--risk-soft); color: var(--risk); } .badge.cs-inactive { background: var(--done-soft); color: var(--done); }
.cu-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.cu-strip .card { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; } .cu-strip b { font-size: 1.15rem; }
.cu-strip .cu-debt { border-inline-start: 4px solid var(--late); }
.cu-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; } .cu-alerts .card { padding: 10px 14px; }
.cu-grid { grid-template-columns: 1.4fr 1fr; gap: 14px; }
.cu-log textarea { width: 100%; margin: 8px 0; }
.cu-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.cu-kinds label { margin: 0; cursor: pointer; } .cu-kinds input { display: none; }
.cu-kinds span { display: inline-block; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: .86rem; background: #fff; }
.cu-kinds input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.cu-promise { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #fff8e6; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.cu-promise input { width: 130px; }
.cu-more { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; align-items: center; }
.cu-more label { margin: 0; display: flex; align-items: center; gap: 6px; }
.cu-timeline { position: relative; }
.ct-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef1f5; }
.ct-ico { width: 34px; height: 34px; border-radius: 50%; background: #eef2f8; display: grid; place-items: center; flex: none; font-size: 1rem; }
.ct-item.k-collection .ct-ico { background: #fff1d6; } .ct-item.k-complaint .ct-ico { background: var(--risk-soft); }
.ct-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cu-prom { background: #fff8e6; border-radius: 8px; padding: 4px 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cu-prom.p-kept { background: var(--ok-soft); } .cu-prom.p-broken { background: var(--late-soft); }
.cu-task { padding: 7px 0; border-bottom: 1px solid #eef1f5; display: flex; flex-direction: column; gap: 2px; }
.cu-task:last-child { border-bottom: 0; } .cu-task.done { opacity: .55; }
.badge.pst-open { background: var(--risk-soft); color: var(--risk); } .badge.pst-in_progress { background: #e8eef7; color: var(--navy-2); }
.badge.pst-waiting_us, .badge.pst-waiting_customer { background: #f1ecfa; color: #5b2f99; } .badge.pst-closed { background: var(--ok-soft); color: var(--ok); }
.statusbar label.spill { cursor: pointer; margin: 0; }
.cp-files { display: flex; flex-wrap: wrap; gap: 8px; } .cp-files img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
@media (max-width: 900px) { .cu-strip { grid-template-columns: 1fr 1fr; } .cu-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .cu-head .toolbar .btn { flex: 1 1 auto; } }

/* ================================================================ smart search */
.brandcol { display: flex; flex-direction: column; gap: 3px; justify-content: center; flex: none; }
.brandcol .brand { line-height: 1.15; font-size: .98rem; }
.brandcol .gsearch input { width: 100%; height: 25px; padding: 2px 9px; font-size: .8rem; border-radius: 6px; }
.brandcol .gsearch input:focus { width: 100%; }
.gsearch { position: relative; }
.gsearch input { width: 170px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff;
  padding: 6px 10px; border-radius: 8px; transition: width .15s; }
.gsearch input::placeholder { color: #c9d5ea; }
.gsearch input:focus { background: #fff; color: var(--ink); outline: none; width: 250px; }
.gs-drop { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; width: min(440px, 92vw); max-height: 70vh; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(20,40,80,.18); z-index: 60; padding: 6px; color: var(--ink); }
.gs-g { font-size: .76rem; color: var(--muted); font-weight: 700; padding: 8px 8px 2px; }
.gs-g i { font-style: normal; font-weight: 500; }
.gs-i, .sr-item { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 8px; color: var(--ink); }
.gs-i span { font-size: .8rem; color: var(--muted); }
.gs-i:hover, .gs-i:focus, .sr-item:hover { background: #eef3fb; text-decoration: none; outline: none; }
.gs-all { display: block; text-align: center; padding: 8px; font-weight: 600; border-top: 1px solid var(--line); margin-top: 4px; }
.gs-empty { padding: 10px; color: var(--muted); font-size: .9rem; }
.msearch { display: none; color: #fff; padding: 8px; }
.sr-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.sr-item { border-bottom: 1px solid #eef1f5; } .sr-item:last-of-type { border-bottom: 0; }
tr:target { background: #fff6d8 !important; outline: 2px solid var(--accent); }
@media (max-width: 1100px) { .topbar .brand span { display: none; } }
@media (max-width: 760px) { .gsearch { display: none; } .msearch { display: inline-flex; } .sr-groups { grid-template-columns: 1fr; } }
.cu-more label, #files form { max-width: 100%; min-width: 0; flex-wrap: wrap; }
.cu-more input[type=file], #files input[type=file] { max-width: 100%; min-width: 0; flex: 1 1 180px; }

/* ================================================================ sales: year comparison */
.mg-view { position: relative; display: inline-flex; gap: 4px; margin: 16px 0 0 10px; background: rgba(255,255,255,.08); padding: 4px; border-radius: 10px; }
.mg-view button { background: none; border: 0; color: #c9d5ea; font: inherit; font-size: .9rem; padding: 6px 14px; border-radius: 7px; cursor: pointer; }
.mg-view button.on { background: #f5c766; color: #3a2a00; font-weight: 700; }
.mg-years { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; color: #c9d5ea; }
.mg-yr { margin: 0; cursor: pointer; } .mg-yr input { display: none; }
.mg-yr span { --yc: #8a96a8; display: inline-block; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--yc); color: #fff; font-weight: 600; font-size: .88rem; opacity: .55; }
.mg-yr input:checked + span { background: var(--yc); opacity: 1; }
.c3-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: 5px; }
.mg-cmp { margin: 14px 0; }
.mg-cmp-head { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; margin-bottom: 10px; }
.mg-cmp-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.mg-cmp-head select { font-size: 1rem; font-weight: 700; padding: 2px 6px; }
.mg-cmp-kpi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; } .mg-cmp-kpi b { font-size: 1.25rem; }
.mg-cmp .mg-chip { position: static; } .mg-cmp .mg-chip.up { background: var(--ok-soft); color: var(--ok); } .mg-cmp .mg-chip.down { background: var(--late-soft); color: var(--late); }
.mg-delta { position: relative; display: inline-block; min-width: 92px; padding: 2px 8px; border-radius: 6px; font-weight: 700; z-index: 0; overflow: hidden; }
.mg-delta::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); z-index: -1; opacity: .22; }
.mg-delta.up { color: var(--ok); } .mg-delta.up::before { background: var(--ok); }
.mg-delta.down { color: var(--late); } .mg-delta.down::before { background: var(--late); }
@media (max-width: 700px) { .mg-view { margin-inline-start: 0; display: flex; } .mg-view button { flex: 1; } }
.mg-cmp-sum td { font-weight: 700; border-top: 2px solid var(--line); }

/* stage documents */
.sdoc { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 3px 0; }
.sdoc.just-up { background: #e9f8ef; border-radius: 6px; padding: 3px 6px; animation: justup 2.5s ease-out; }
@keyframes justup { from { background: #b9ecc9; } to { background: #e9f8ef; } }
.doc-type select { font-size: .76rem; padding: 1px 4px; max-width: 150px; opacity: .7; }
.doc-type select:hover, .doc-type select:focus { opacity: 1; }
.up-hint { color: var(--risk) !important; font-weight: 600; margin-top: 4px; }
.btn.pulse { animation: btnpulse 1.2s ease-in-out infinite; }
@keyframes btnpulse { 50% { box-shadow: 0 0 0 5px rgba(240,160,40,.35); } }
.doc-del { background: none; border: 0; cursor: pointer; padding: 0 4px; opacity: .45; font-size: .85rem; }
.doc-del:hover { opacity: 1; }

/* agro products */
.ap-filters input[type=search] { min-width: 200px; }
.ap-group { margin-bottom: 12px; } .ap-group h3 { margin-top: 0; }
.ap-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 6px 14px; }
.ap-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid #eef1f5;
  border-inline-start: 4px solid #d6dbe3; position: relative; }
.ap-row.st-multi { border-inline-start-color: var(--ok); } .ap-row.st-single { border-inline-start-color: var(--risk); }
.ap-who, .ap-num { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ap-x { position: absolute; top: 4px; inset-inline-end: 4px; }
@media (max-width: 700px) { .ap-list { grid-template-columns: 1fr; } }
.ap-add { font-weight: 600; margin-inline-start: auto; }
.mg-lastup { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: .86rem; color: var(--muted);
  background: #f3f6fa; border-radius: 10px; padding: 7px 12px; margin: -4px 0 12px; }
.mg-lastup b { color: var(--ink); font-weight: 600; }
.mg-lastup.stale { background: #fff6e0; }

/* cheques in custody */
.ck-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 6px 0; border-bottom: 1px solid #eef1f5; }
.ck-row:last-child { border-bottom: 0; }
.ck-bar { grid-column: 1 / -1; position: relative; height: 18px; background: #f1f4f9; border-radius: 6px; overflow: hidden; }
.ck-bar i { position: absolute; inset: 0 0 0 auto; background: linear-gradient(90deg, #6f9be0, #3c6db0); border-radius: 6px; }
.ck-bar.u i { background: linear-gradient(90deg, #f5c766, #e0a030); } .ck-bar.b i { background: linear-gradient(90deg, #7fdccb, #3fae9a); }
.ck-bar span { position: relative; font-size: .78rem; font-weight: 700; padding: 0 8px; line-height: 18px; color: var(--ink); }
.ck-u { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid #eef1f5; }
.ck-u:last-child { border-bottom: 0; } .ck-u-acc { display: flex; flex-direction: column; flex: 1 1 260px; }
.ck-u input[name=customer] { min-width: 180px; }
.ck-sugg { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ck-filters input[type=search] { min-width: 200px; }
.ck-tag { color: #2a5288; font-weight: 700; }
.mg-chk { display: inline-block; margin-top: 6px; color: #f5c766; font-weight: 600; font-size: .9rem; }
.mg-chk:hover { color: #fff; }
.ck-cust { margin-bottom: 12px; border-inline-start: 4px solid #3c6db0; }
.sup-import { flex-wrap: wrap; gap: 8px 12px; }
.badge.sc-agro { background: #e3f5e9; color: #2a7f4f; } .badge.sc-operations { background: #eef1f5; color: #4a5568; }
.badge.sc-logistics { background: #e8eef7; color: var(--navy-2); } .badge.sc-goods { background: #fff1d6; color: #8a5a00; }
.badge.sc-creditors { background: #f1ecfa; color: #5b2f99; }
.hf-box { margin-bottom: 12px; } .hf-box summary { cursor: pointer; }
.hf-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 14px; margin: 8px 0 10px; }
.hf-list label { margin: 0; }
.mg-kpis:has(.mg-kpi-chk) { grid-template-columns: repeat(5, minmax(110px, auto)); }
.mg-kpis > .mg-kpi-chk { background: rgba(245,199,102,.16); border: 1px solid rgba(245,199,102,.45); border-radius: 12px; padding: 9px 12px;
  display: flex; flex-direction: column; gap: 1px; color: #fff; text-decoration: none; }
.mg-kpis > .mg-kpi-chk b { color: #f5c766; } .mg-kpis > .mg-kpi-chk:hover { background: rgba(245,199,102,.26); }
@media (max-width: 900px) { .mg-kpis:has(.mg-kpi-chk) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.done-banner { margin-bottom: 12px; background: #e9f8ef; border-color: #b9ecc9; font-weight: 600; }

/* ---------- import management and container tracking (shipments) ---------- */
.sh-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, #12304f 0%, #1f4f7a 70%, #2b6a8f 100%); color: #fff; border-radius: 14px;
  padding: 22px 24px; margin-bottom: 12px; }
.sh-hero h1 { color: #fff; margin: 0 0 4px; } .sh-hero div div { color: #cfe0ef; }
.sh-hero .btn { background: #fff; color: var(--navy); border-color: #fff; font-weight: 600; }
.sh-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.sh-tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex;
  flex-direction: column; gap: 2px; border-top: 4px solid #9fb3c8; color: var(--ink); }
.sh-tile:hover { text-decoration: none; border-color: var(--navy-2); }
.sh-tile b { font-size: 1.7rem; line-height: 1.1; color: var(--navy); } .sh-tile span { font-size: .86rem; color: var(--muted); }
.sh-tile.on { box-shadow: 0 0 0 2px var(--navy-2) inset; }
.sh-tile.t-sea { border-top-color: #2b7bb9; } .sh-tile.t-trans { border-top-color: #7a5fb0; }
.sh-tile.t-port { border-top-color: var(--accent); } .sh-tile.t-rel { border-top-color: var(--ok); }
.sh-tile.t-before { border-top-color: #b8a23a; }
.sh-exc { margin-bottom: 12px; }
.sh-exc-row { display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: 8px; color: var(--ink);
  border-inline-start: 4px solid var(--risk); background: var(--risk-soft); margin-top: 6px; flex-wrap: wrap; }
.sh-exc-row:hover { text-decoration: none; filter: brightness(.98); }
.sh-exc-row.sev-bad { border-color: var(--late); background: var(--late-soft); }
.sh-exc-row .tx { flex: 1; min-width: 200px; } .sh-exc-row .who { color: var(--muted); }
.sh-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; margin-bottom: 12px; align-items: start; }
.sh-table-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.sh-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sh-filters input[type=search] { min-width: 220px; }
.sh-filters select, .sh-filters input { max-width: 180px; }
.sh-table tbody tr[data-href] { cursor: pointer; } .sh-table tbody tr[data-href]:hover { background: #f6f9fc; }
.sh-badge { display: inline-block; font-size: .78rem; padding: 2px 9px; border-radius: 99px; background: var(--done-soft);
  color: var(--done); white-space: nowrap; font-weight: 600; }
.sh-badge.big { font-size: .95rem; padding: 4px 14px; }
.sh-badge.s-draft { background: #f3f0dc; color: #7d6b12; } .sh-badge.s-booked { background: #f3f0dc; color: #7d6b12; }
.sh-badge.s-sailing { background: #e1eef8; color: #1f5f93; } .sh-badge.s-transship { background: #ece6f6; color: #5b3f94; }
.sh-badge.s-port { background: var(--accent-soft); color: var(--accent); } .sh-badge.s-released { background: var(--ok-soft); color: var(--ok); }
.sh-badge.s-received { background: var(--ok); color: #fff; } .sh-badge.s-cancelled { background: var(--late-soft); color: var(--late); }
.sh-upcoming h3 { margin-bottom: 4px; }
.sh-up { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.sh-up:last-child { border-bottom: 0; } .sh-up:hover { text-decoration: none; background: #f6f9fc; }
.sh-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.sh-step { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 10px;
  background: #f6f8fb; border: 1px solid var(--line); margin: 0; }
.sh-step i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #dfe7f1; color: var(--navy); font-weight: 700; font-size: .85rem; }
.sh-step b { font-size: .92rem; } .sh-step span { font-size: .8rem; color: var(--muted); }
.sh-step.done { background: var(--ok-soft); border-color: #bfe0cb; } .sh-step.done i { background: var(--ok); color: #fff; }
.sh-step.now { background: #e1eef8; border-color: #2b7bb9; box-shadow: 0 0 0 1px #2b7bb9 inset; }
.sh-step.now i { background: #2b7bb9; color: #fff; }
.sh-step .btn { margin-top: 6px; align-self: flex-start; }
.card.sh-steps { margin-bottom: 12px; }
.sh-head h1 { margin: 2px 0; }
.sh-route { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-bottom: 12px; }
.sh-route .pt { font-weight: 700; color: var(--navy); }
.sh-route .line { position: relative; height: 6px; background: #e3e9f1; border-radius: 99px; }
.sh-route .line i { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #2b7bb9, #49a0d8);
  border-radius: 99px; }
.sh-route .line em { position: absolute; top: -24px; inset-inline-start: 50%; transform: translateX(50%); font-style: normal;
  font-size: .8rem; color: #1f5f93; white-space: nowrap; }
.sh-route-meta { grid-column: 1 / -1; }
.sh-cols { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.sh-cols > div > .card, .sh-cols > div > section, .sh-cols > div > details, .sh-cols > div > form { margin-bottom: 12px; }
.sh-track { border-top: 3px solid #2b7bb9; }
.sh-recv { border-top: 3px solid var(--ok); } .sh-recv input { max-width: 120px; }
.sh-hashav { border-top: 3px solid var(--accent); }
.sh-money { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 10px; background: #f6f8fb; border-radius: 8px; margin-bottom: 8px; }
.sh-inv { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.sh-inv.est { border-style: dashed; }
.sh-inv-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.sh-inv-sum { flex-basis: 100%; }
.sh-sched { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.sh-sched > span { background: #f3f5f9; border-radius: 99px; padding: 2px 10px; display: inline-flex; gap: 4px; align-items: center; }
.sh-sched > span.paid { background: var(--ok-soft); color: var(--ok); } .sh-sched > span.late { background: var(--late-soft); }
.sh-pays { margin-top: 6px; }
.sh-inv-actions summary { cursor: pointer; color: var(--navy-2); margin-top: 6px; }
.sh-cont { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.sh-ev { padding: 6px 0; border-bottom: 1px solid var(--line); }
.sh-ev.k-eta div { color: #1f5f93; } .sh-ev:last-child { border-bottom: 0; }
.sh-pstrip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.sh-pchip { background: #eef4fa; border: 1px solid #cddcec; border-radius: 99px; padding: 3px 12px; color: var(--ink); }
.sh-pchip:hover { text-decoration: none; border-color: var(--navy-2); }
.ok-t { color: var(--ok); }
@media (max-width: 1000px) {
  .sh-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sh-grid, .sh-cols { grid-template-columns: minmax(0, 1fr); }
  .sh-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .sh-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-hero { padding: 16px; }
  .sh-filters input[type=search] { min-width: 0; width: 100%; }
  .sh-filters select, .sh-filters input, .sh-filters label { max-width: none; min-width: 0; flex: 1 1 45%; width: 45%; }
  .sh-filters label input { width: 100%; }
  .sh-route { grid-template-columns: 1fr; } .sh-route .line { display: none; }
}

/* a task just added from the quick field */
.task.just-added { background: #fff6cc; border: 2px solid #f0b400; box-shadow: 0 0 0 4px rgba(240,180,0,.18);
  animation: justAdded 1.2s ease-out 2; scroll-margin-top: 90px; }
.task.just-added .new-flag { font-size: .8rem; font-weight: 700; color: #8a6300; margin-bottom: 2px; }
@keyframes justAdded { 0% { box-shadow: 0 0 0 0 rgba(240,180,0,.6); } 100% { box-shadow: 0 0 0 12px rgba(240,180,0,0); } }

/* customer balance: debt in minus (red), credit in plus (blue) */
.bal-debt { color: var(--late); } .bal-credit { color: #1f5fbf; } .bal-zero { color: var(--muted); }

/* sales statistics */
.mg-stats { margin: 14px 0; }
.mg-stats-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mg-stats-head h3 { margin: 0; }
.mg-stab { display: flex; flex-wrap: wrap; gap: 4px; background: #eef2f7; padding: 4px; border-radius: 10px; }
.mg-stab button { border: 0; background: transparent; padding: 6px 10px; border-radius: 7px; cursor: pointer; font: inherit; font-size: .88rem; color: var(--ink); }
.mg-stab button.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 700; color: var(--navy); }
.mg-line { width: 100%; overflow: hidden; } .mg-line svg { display: block; max-width: 100%; }
.mg-line .gl { stroke: #e5eaf1; } .mg-line .ax { font-size: 11px; fill: var(--muted); }
.mg-line .mg-legend { color: var(--ink); }
.mg-qt td { white-space: nowrap; } .mg-qt td.mg-h { background: #f6f8fb; }
.mg-heat td { text-align: center; font-weight: 600; min-width: 42px; }
.mg-mix > div { display: grid; grid-template-columns: 60px 1fr; gap: 4px 10px; align-items: center; margin-bottom: 10px; }
.mg-mix > div .small { grid-column: 2; }
.mg-mixbar { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: #eef2f7; }
.mg-mixbar i { background: #4a7cc0; } .mg-mixbar em { background: #4fbf7f; }
.mg-rank { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.mg-rank span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fff3cd; font-weight: 700; font-size: .8rem; }
.mg-rank.low span { background: #e1eef8; } .mg-rank em { font-style: normal; font-weight: 700; }
.mg-fc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.mg-fc > div { background: #f6f8fb; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.mg-fc b { font-size: 1.5rem; color: var(--navy); }
@media (max-width: 700px) { .mg-fc { grid-template-columns: 1fr; } .mg-stab button { flex: 1 1 45%; } }

/* Israeli date fields (dd/mm/yy) */
.ildate { position: relative; display: inline-flex; align-items: center; max-width: 100%; }
.ildate input[type=text] { width: 9.5em; padding-right: 30px; direction: ltr; text-align: right; }
.field .ildate, .field .ildate input[type=text] { width: 100%; }
.ildate-pick { position: absolute; right: 5px; border: 0; background: transparent; cursor: pointer; padding: 2px; font-size: .95rem; line-height: 1; }
.ildate-native { position: absolute; inset-inline-start: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.ildate input[type=text]:invalid:not(:placeholder-shown) { border-color: var(--late); background: var(--late-soft); }

.toast-ok { position: fixed; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 300; background: #1e5a37; color: #fff;
  padding: 10px 18px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-weight: 600; max-width: calc(100% - 32px);
  transition: opacity .6s; }
.toast-ok.out { opacity: 0; }
@media (min-width: 900px) { .toast-ok { bottom: 28px; } }
.prod-filter { gap: 6px; align-items: center; } .prod-filter input[type=search] { min-width: 220px; }
@media (max-width: 600px) { .prod-filter input[type=search], .prod-filter select { flex: 1 1 100%; min-width: 0; } }

/* price quotes */
.qt-st { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: #eef2f7; color: #43506a; }
.qt-st.s-sent { background: #e1eef8; color: #1f5f93; } .qt-st.s-accepted { background: var(--ok-soft); color: var(--ok); }
.qt-st.s-rejected, .qt-st.s-expired { background: var(--late-soft); color: var(--late); }
.qt-list tr[data-href] { cursor: pointer; } .qt-list tr[data-href]:hover { background: #f6f9fc; }
.qt-add { margin-bottom: 12px; } .qt-add form { display: flex; flex-direction: column; gap: 6px; }
.qt-add textarea { width: 100%; }
.qt-results { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.qt-res { display: grid; grid-template-columns: 22px 44px 1fr; gap: 6px; align-items: center; padding: 4px; border-radius: 8px; cursor: pointer; }
.qt-res:hover { background: #f3f6fa; } .qt-res img, .qt-res i { width: 40px; height: 40px; object-fit: contain; background: #f3f6fa; border-radius: 6px; }
.qt-res small { display: block; color: var(--muted); }
.qt-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.qt-head { margin-bottom: 12px; }
.qt-lines td { vertical-align: middle; } .qt-lines input, .qt-lines select { padding: 4px 6px; }
.qt-img img { width: 44px; height: 44px; object-fit: contain; display: block; }
.qt-del { cursor: pointer; color: var(--late); white-space: nowrap; } .qt-del input { vertical-align: middle; }
tr.qt-deleted td { opacity: .45; text-decoration: line-through; }
.qt-totals { margin-top: 10px; margin-inline-start: auto; max-width: 320px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qt-totals div { display: flex; justify-content: space-between; padding: 5px 12px; } .qt-totals b { direction: ltr; }
.qt-totals .grand { background: var(--navy); color: #fff; }
@media (max-width: 700px) { .qt-lines input { width: 4.2em; } .qt-lines input[name^="price_"] { width: 5em; } }
.qt-add form > .btn { align-self: flex-start; }

/* upload / processing clock */
.busy { position: fixed; inset: 0; z-index: 500; background: rgba(15, 30, 50, .45); display: grid; place-items: center; }
.busy[hidden] { display: none; }
.busy-card { background: #fff; border-radius: 16px; padding: 22px 28px; min-width: 260px; max-width: calc(100% - 32px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: 0 20px 50px rgba(0,0,0,.3); text-align: center; }
.busy-spin { width: 42px; height: 42px; border-radius: 50%; border: 4px solid #e3e9f1; border-top-color: var(--navy-2, #2b6a8f);
  animation: busySpin .9s linear infinite; }
.busy-clock { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); direction: ltr; }
.busy-card small { color: var(--muted); }
@keyframes busySpin { to { transform: rotate(360deg); } }

.qt-mail { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding: 10px 12px; background: #eef6ec;
  border: 1px solid #cfe5c9; border-radius: 10px; }
.qt-mail input[name=send_to] { min-width: 230px; } .qt-mail input[name=send_note] { flex: 1; min-width: 180px; }

/* purchase orders */
.sh-chip { display: inline-block; margin-inline-start: 6px; padding: 2px 10px; border-radius: 999px; background: #e6f0ff; color: #1a4fa0; font-size: 12.5px; font-weight: 600; text-decoration: none; }
.card.sh-open { border-inline-start: 4px solid #2b6cb0; background: #f5f9ff; }
.qt-st.s-confirmed { background: #e3f6e8; color: #1e7a3a; } .qt-st.s-shipped { background: #e6f0ff; color: #1a4fa0; }
.qt-st.s-cancelled { background: #eee; color: #777; }
.btn.sh-go { background: #2b6cb0; border-color: #2b6cb0; }

/* admin "view as" another user */
.viewas-bar { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; padding: 8px 14px; border-radius: 10px; background: #fff4c2; border: 2px solid #e0b100; color: #5c4600; font-size: 14px; }
/* supplier supply picture */
.sp-conts { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 14px; }
.sp-group { flex: 1 1 200px; background: #fff; border: 1px solid var(--line, #dfe5ee); border-top: 4px solid var(--c); border-radius: 10px; padding: 8px 10px; }
.sp-group-h { font-size: 13.5px; margin-bottom: 6px; color: var(--c); font-weight: 600; } .sp-group-h b { font-size: 16px; }
.sp-cont { display: block; font-size: 12.5px; color: inherit; text-decoration: none; padding: 2px 0; } .sp-cont:hover { text-decoration: underline; }
.sp-table { width: 100%; table-layout: auto; }
.sp-table th { background: #f3f6fa; position: sticky; top: var(--sp-top, 56px); z-index: 6; box-shadow: 0 2px 0 #dfe5ee; font-size: 12.5px; vertical-align: bottom; }
.sp-table td { vertical-align: middle; }
.sp-n { text-align: center; width: 82px; font-variant-numeric: tabular-nums; font-size: 14px; }
.sp-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--c); color: #fff; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.sp-stock, .sp-stock-h { background: #f2fbf4 !important; } .sp-sum { background: #f5f9ff !important; } .sp-new { background: #fffbea !important; }
.sp-ck { width: 30px; text-align: center; } .sp-ck input { width: 18px; height: 18px; }
.sp-pic { width: 46px; } .sp-pic img { width: 40px; height: 40px; object-fit: contain; display: block; }
.sp-name b { font-size: 14px; }
.sp-q { width: 70px; text-align: center; font-size: 15px; padding: 4px; }
tr.sp-on td { background: #eaf6ec !important; }
tr.sp-ext td { background: #fff8db; }
.sp-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-top: 8px; background: #1a365d; color: #fff; border-radius: 10px; box-shadow: 0 -4px 14px rgba(0,0,0,.15); }
.sp-bar .btn.primary { background: #4caf3e; border-color: #4caf3e; font-size: 15px; }
.sp-howto ul { margin: 8px 0; padding-inline-start: 18px; } .sp-howto li { margin: 4px 0; }
.sp-alias { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line, #dfe5ee); }
.sp-alias .ltr-inline { min-width: 260px; }
@media (max-width: 700px) { .sp-pic, .sp-table th:nth-child(2) { display: none; } .sp-n { width: auto; font-size: 13px; } .sp-name { min-width: 140px; } }
.qt-st.s-production { background: #fdf0d9; color: #8a5a00; } .qt-st.s-ready { background: #e3f6e8; color: #1e7a3a; }
.sp-ps { position: relative; flex: 1; min-width: 260px; } .sp-ps input[type=search] { width: 100%; }
.sp-psr { position: absolute; inset-inline: 0; top: 100%; z-index: 20; background: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.15); border-radius: 8px; max-height: 260px; overflow: auto; }
.sp-psi { display: block; width: 100%; text-align: start; padding: 6px 10px; border: 0; background: none; cursor: pointer; font-size: 13px; }
.sp-psi:hover { background: #eef4ff; }
@media (max-width: 760px) { main table.sp-table { max-height: calc(100vh - 190px); overflow: auto; --sp-top: 0px; } .sp-q { width: 52px; } }
.sp-xl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; margin: 6px 0 4px; background: #f5f9ff; border: 1px dashed #b8c8e0; border-radius: 10px; }
.sp-xl form.inline { margin-inline-start: auto; }
/* foreign suppliers: balances and advances */
.sb-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.sb-tile { background: #fff; border: 1px solid var(--line, #dfe5ee); border-top: 4px solid #8a94a6; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; }
.sb-tile span { font-size: 13px; color: var(--muted, #5b6577); } .sb-tile b { font-size: 22px; } .sb-tile small { color: var(--muted, #5b6577); }
.sb-tile.adv { border-top-color: #c27c0e; } .sb-tile.owe { border-top-color: #c0392b; } .sb-tile.net { border-top-color: #1a365d; } .sb-tile.flag { border-top-color: #e0b100; background: #fffbea; }
.sb-table { width: 100%; } .sb-n { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sb-adv { color: #8a5a00; font-weight: 600; } .sb-owe { color: #c0392b; font-weight: 600; }
.sb-flag { font-size: 12.5px; } .sb-flag.warn { color: #8a5a00; } .sb-flag.late { color: #c0392b; }
.sb-items { display: none; } tbody.open .sb-items { display: table-row; } .sb-items > td { background: #f8fafc; padding: 6px 10px 12px; }
.sb-inner { width: 100%; font-size: 12.5px; margin: 0; } .sb-inner th { background: #eef2f7; }
.sb-sup + .sb-sup > tr:first-child td { border-top: 1px solid var(--line, #dfe5ee); }
/* Meir's restaurant stock */
.rs-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.rs-tile { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line, #dfe5ee); border-top: 4px solid #8a94a6; color: inherit; text-decoration: none; }
.rs-tile b { font-size: 24px; } .rs-tile span { font-size: 13px; color: var(--muted, #5b6577); }
.rs-tile.out { border-top-color: #c0392b; } .rs-tile.low { border-top-color: #e0b100; } .rs-tile.ok { border-top-color: #2b8a3e; } .rs-tile.all { border-top-color: #1a365d; }
.rs-tile.on { box-shadow: 0 0 0 2px #1a365d inset; }
.rs-table { width: 100%; } .rs-dot { width: 26px; text-align: center; }
tr.rs-out td { background: #fdecea; } tr.rs-low td { background: #fff8db; }
.rs-edit { display: none; } tbody.open .rs-edit { display: table-row; } .rs-edit > td { background: #f8fafc; }
.rs-order { border-inline-start: 4px solid #4caf3e; }
.rs-group { border-top: 1px dashed var(--line, #dfe5ee); padding: 8px 0; }
.rs-group-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; } .rs-group-h .btn { margin-inline-start: auto; }
.rs-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 14px; }
.rs-line { display: flex; align-items: center; gap: 8px; } .rs-line > span { flex: 1; } .rs-line .sp-q { width: 64px; }
.tp-people { margin-top: 6px; } .tp-people summary { cursor: pointer; color: #1a4fa0; }
.tp-list { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0; max-height: 160px; overflow: auto; }
