/* Systemic Desk – design system (spec 13.1): colourful, dignified, not crowded. */
:root {
  --brand: #1B4F8C; --brand-2: #1F6FD1; --brand-soft: #E8F0FA; --mint: #7FD8BE; --mint-soft: #E6F7F1;
  --ink: #0F1B33; --text: #3D4C63; --muted: #5B6B7F; --line: #E3E8EF; --bg: #F5F7FB; --card: #FFFFFF;
  --red: #C4321F; --red-soft: #FDECEA; --orange: #D9711C; --orange-soft: #FDF1E6; --blue: #1F6FD1; --blue-soft: #E8F0FA;
  --slate: #6B7F99; --slate-soft: #EEF2F7; --green: #1E8E5A; --green-soft: #E5F5EC; --mustard: #A97D0A; --mustard-soft: #FBF4DE;
  --purple: #6941C6; --purple-soft: #F1ECFB;
  --r: 14px; --r-sm: 9px; --shadow: 0 1px 2px rgba(15,27,51,.05), 0 4px 14px rgba(15,27,51,.05);
  --t: 200ms cubic-bezier(.2,.7,.3,1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif; direction: rtl; }
/* English flips the whole document to LTR. The <html dir> attribute drives it; this stops the
   body rule above from forcing RTL back on. Layout spacing already uses logical properties. */
html[dir="ltr"] body { direction: ltr; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.55rem; font-weight: 700; } h2 { font-size: 1.15rem; font-weight: 700; } h3 { font-size: 1rem; font-weight: 600; }
small, .muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
:focus-visible { outline: 3px solid rgba(31,111,209,.35); outline-offset: 2px; border-radius: 6px; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #C9D3E3; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.side .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.1rem; padding: 4px 8px 16px; }
.side .brand small { display: block; color: #8FA0BA; font-weight: 400; font-size: .72rem; }
.side .brand .lg-d, .demo-hero .lg-d { fill: #fff; } .side .brand .lg-s, .demo-hero .lg-s { stroke: #0A3A6B; }
.wm { font-family: "Plus Jakarta Sans", Heebo, Arial, sans-serif; font-weight: 800; letter-spacing: -.02em; direction: ltr; unicode-bidi: isolate; }
.wm b { color: #D9540A; font-weight: 800; }
.side .brand .wm b, .demo-hero .wm b { color: #FF8A3D; }
.side a.nav { display: flex; align-items: center; gap: 10px; color: #C9D3E3; padding: 9px 12px; border-radius: 10px; font-weight: 500; transition: background var(--t), color var(--t); }
.side a.nav:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.side a.nav.on { background: rgba(127,216,190,.14); color: #fff; box-shadow: inset -3px 0 0 var(--mint); }
.side a.nav svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.side .navgroup { color: #6F819D; font-size: .72rem; letter-spacing: .04em; padding: 14px 12px 4px; }
.side .count { margin-inline-start: auto; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.side .foot { margin-top: auto; padding: 12px 8px 0; font-size: .75rem; color: #6F819D; border-top: 1px solid rgba(255,255,255,.08); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top form.search { flex: 1; max-width: 420px; }
.top .user, .portal-top .user { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none; }
.usermenu { position: relative; min-width: 0; }
.usermenu-sum { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; border-radius: 999px; padding: 2px 8px 2px 2px; color: var(--ink); font-weight: 600; max-width: 100%; }
.usermenu-sum::-webkit-details-marker { display: none; }
.usermenu-sum:hover { background: var(--slate-soft); }
.userchip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 9rem; }
.usermenu-panel { position: absolute; z-index: 40; inset-inline-end: 0; top: calc(100% + 6px); min-width: 220px; max-width: min(280px, calc(100vw - 24px)); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; }
.usermenu-who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font-weight: 700; color: var(--ink); }
.usermenu-who small { display: block; color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.usermenu-panel a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 8px; color: var(--ink); font-weight: 600; text-decoration: none; }
.usermenu-panel a:hover { background: var(--brand-soft); text-decoration: none; }
.logout-form { margin: 0; flex: none; }
.logout-btn { min-height: 40px; }
.logout-btn span { font-weight: 700; }
.content { padding: 24px 28px 60px; max-width: 1320px; width: 100%; }
.menu-btn { display: none; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead h1 { margin: 0; }
.pagehead .sub { color: var(--muted); margin-top: 4px; }

/* ---------- bars */
.majorbar { background: var(--purple); color: #fff; padding: 9px 28px; display: flex; gap: 10px; align-items: center; font-weight: 500; }
.majorbar a { color: #fff; text-decoration: underline; }
.majorbar .dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: pulse 1.8s ease-out 3; }
.demobar { background: linear-gradient(90deg, #0F1B33, #1B4F8C); color: #fff; padding: 8px 28px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.demobar[hidden] { display: none !important; }
.demobar form { display: inline; }
.demobar .roles { display: flex; gap: 6px; flex-wrap: wrap; margin-inline-start: auto; }
.demobar button { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 4px 12px; font: inherit; cursor: pointer; }
.steptip { position: fixed; z-index: 10060; width: min(260px, calc(100vw - 16px)); max-width: min(260px, calc(100vw - 16px)); margin: 0; background: #FFF3B0; color: #1f2937; border: 1px solid #E4C84A; border-radius: 10px; box-shadow: 0 8px 22px rgba(31, 41, 55, .18); padding: 10px 12px; padding-inline-start: 32px; direction: rtl; text-align: right; font-size: .88rem; line-height: 1.45; overflow-wrap: break-word; }
.steptip[hidden] { display: none; }
.steptip.is-in { animation: steptip-in .18s ease-out; }
@keyframes steptip-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.steptip p { margin: 0 0 8px; }
.steptip form { margin: 0; }
.steptip-go { font: inherit; font-size: .82rem; font-weight: 700; color: #1f2937; background: #fff; border: 1px solid #E4C84A; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.steptip-go:hover, .steptip-go:focus-visible { background: #fff8d2; }
.steptip::before, .steptip::after { content: ""; position: absolute; top: var(--tip-arrow, 18px); transform: translateY(-50%); border-style: solid; border-color: transparent; }
.steptip:not(.is-flip)::before { left: -8px; border-width: 8px; border-right-color: #E4C84A; }
.steptip:not(.is-flip)::after { left: -6px; border-width: 7px; border-right-color: #FFF3B0; }
.steptip.is-flip::before { right: -8px; border-width: 8px; border-left-color: #E4C84A; }
.steptip.is-flip::after { right: -6px; border-width: 7px; border-left-color: #FFF3B0; }
.steptip-close { position: absolute; top: 2px; inset-inline-start: 2px; inline-size: 28px; block-size: 28px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; color: #1f2937; border: 0; border-radius: 8px; font: inherit; font-size: 1rem; line-height: 1; cursor: pointer; }
.steptip-close:hover, .steptip-close:focus-visible { background: rgba(31, 41, 55, .08); }
@media (prefers-reduced-motion: reduce) { .steptip.is-in { animation: none; } }
body.no-motion .steptip.is-in { animation: none; }
.demobar button.on { background: var(--mint); color: var(--ink); border-color: var(--mint); font-weight: 600; }
.demobar a.btn.cta { background: #FACC15; color: var(--ink); }
.demobar a.btn.cta:hover { background: #EAB308; color: var(--ink); }
.verifybar { background: #FFF6E0; color: #5A4300; border-bottom: 1px solid #F1DFA8; padding: 7px 28px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .88rem; }
.verifybar .verify-actions { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.verifybar form { display: inline; margin-inline-start: 0; }
.verifybar form button { background: #fff; color: #5A4300; border: 1px solid #E6CF85; border-radius: 999px; padding: 3px 12px; font: inherit; cursor: pointer; }
.verifybar .verify-close { display: inline-flex; align-items: center; justify-content: center; flex: none; inline-size: 2rem; block-size: 2rem; padding: 0; background: transparent; color: #5A4300; border: 1px solid transparent; border-radius: 999px; font: inherit; font-size: 1.35rem; line-height: 1; cursor: pointer; }
.verifybar .verify-close:hover, .verifybar .verify-close:focus-visible { background: #fff; border-color: #E6CF85; }
html.verifybar-dismissed .verifybar { display: none; }
.betatag { background: var(--orange); color: #fff; font-size: .68rem; font-weight: 700; border-radius: 6px; padding: 1px 6px; margin-inline-start: 4px; }

/* ---------- cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card h2 .act { margin-inline-start: auto; font-size: .85rem; font-weight: 500; }
.grid { display: grid; gap: 16px; }
.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)); }
.split { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 18px; align-items: start; }
.stack > * + * { margin-top: 16px; }

/* ---------- KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; display: flex; flex-direction: column; min-width: 0; color: inherit; transition: transform var(--t), box-shadow var(--t); }
.kpi:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 6px 20px rgba(15,27,51,.09); }
.kpi .lbl { color: var(--muted); font-size: .85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .val { font-size: 2.1rem; font-weight: 700; color: var(--ink); line-height: 1.1; margin-top: auto; padding-top: 6px; font-variant-numeric: tabular-nums; }
.kpi::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--brand-2); }
.kpi.k-new::before { background: var(--blue); } .kpi.k-prog::before { background: var(--mint); } .kpi.k-wait::before { background: var(--mustard); }
.kpi.k-ok::before { background: var(--green); } .kpi.k-slate::before { background: var(--slate); } .kpi.k-wa::before { background: #25D366; }
.kpi.k-breach { background: var(--red); border-color: var(--red); } .kpi.k-breach::before { display: none; }
.kpi.k-breach .lbl, .kpi.k-breach .val { color: #fff; }
.kpi.k-breach.zero { background: var(--card); border-color: var(--line); } .kpi.k-breach.zero .lbl { color: var(--muted); } .kpi.k-breach.zero .val { color: var(--ink); }
.kpi.k-breach.zero::before { display: block; background: var(--green); }

/* ---------- charts */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .pair { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bars .b { width: 42%; max-width: 14px; border-radius: 5px 5px 2px 2px; background: var(--brand-2); transform-origin: bottom; }
.bars .b.c2 { background: var(--mint); }
.bars .d { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: 130px 1fr 34px; gap: 10px; align-items: center; margin: 7px 0; font-size: .9rem; }
.hbar .track { height: 10px; background: var(--slate-soft); border-radius: 99px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--brand-2); border-radius: 99px; transform-origin: right; }
.hbar .n { text-align: left; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.grow { animation: grow 900ms cubic-bezier(.2,.7,.3,1) both; }
.growx { animation: growx 900ms cubic-bezier(.2,.7,.3,1) both; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- round charts (reports): donut + priority rings. Inline SVG, no library. */
.report-donut { display: flex; align-items: center; gap: 18px; min-width: 0; }
.donut-plot, .ring-plot { position: relative; flex: none; }
.donut-plot { width: 168px; height: 168px; }
.donut-svg, .ring-plot svg { display: block; width: 100%; height: auto; direction: ltr; }
.donut-center, .ring-center {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; text-align: center;
}
.donut-center { flex-direction: column; line-height: 1.15; }
.donut-total { font-size: 1.65rem; font-weight: 700; color: var(--ink); }
.donut-cap { font-size: .75rem; font-weight: 600; color: var(--muted); }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.donut-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; margin: 5px 0; font-size: .9rem; }
.donut-legend i { width: 12px; height: 12px; border-radius: 50%; align-self: center; }
.donut-legend .lbl { color: var(--ink); }
.split .stack .report-donut { flex-direction: column; align-items: center; }
.split .stack .donut-legend { width: 100%; }
.donut-legend .stat { font-weight: 700; color: var(--ink); white-space: nowrap; }
.donut-empty { flex: 1; }
.na { color: #A7B4C6; font-weight: 700; cursor: help; }
.sla-pct { font-weight: 700; }
.sla-good { color: #146C43; }
.sla-mid { color: #A4520F; }
.sla-bad { color: #C4321F; }
.rings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.ring-plot { width: 100%; max-width: 112px; }
.ring-val { font-size: 1.05rem; font-weight: 700; }
.ring-good .ring-val { color: #146C43; }
.ring-mid .ring-val { color: #A4520F; }
.ring-bad .ring-val { color: #C4321F; }
.ring-empty .ring-center { color: #3D4C63; }
.ring-empty-label { font-size: .72rem; font-weight: 700; line-height: 1.2; max-width: 4.6rem; }
.ring-lbl { font-size: .85rem; font-weight: 700; color: var(--ink); }
.donut-seg, .ring-arc {
  stroke-dasharray: var(--len) var(--rest, 100);
  stroke-dashoffset: 0;
  animation: chart-draw 0.9s ease-out both;
  animation-delay: var(--delay, 0s);
}
@keyframes chart-draw {
  from { stroke-dashoffset: var(--len); }
  to { stroke-dashoffset: 0; }
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 100% { box-shadow: 0 0 0 9px rgba(255,255,255,0); } }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(196,50,31,.5); } 100% { box-shadow: 0 0 0 7px rgba(196,50,31,0); } }
@keyframes pulse-mint { 0% { box-shadow: 0 0 0 0 rgba(30,142,90,.5); } 100% { box-shadow: 0 0 0 7px rgba(30,142,90,0); } }

/* meter (quota usage) */
.meter { height: 9px; background: var(--slate-soft); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--green); border-radius: 99px; transform-origin: right; }
.meter.warn > span { background: var(--orange); } .meter.over > span { background: var(--red); }

/* ---------- badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; line-height: 1.6; }
.badge svg { width: 13px; height: 13px; }
.p1, .s-breach { background: var(--red-soft); color: var(--red); }
.p2, .s-warn { background: var(--orange-soft); color: #A4520F; }
.p3 { background: var(--blue-soft); color: var(--blue); }
.p4 { background: var(--slate-soft); color: #4C5E77; }
.s-ok, .st-closed, .s-done { background: var(--green-soft); color: var(--green); }
.st-new { background: var(--blue-soft); color: var(--blue); }
.st-in_progress { background: var(--mint-soft); color: #1B6F55; }
.st-waiting_vendor, .st-waiting_client, .st-waiting_approval, .s-paused { background: var(--mustard-soft); color: var(--mustard); }
.st-major { background: var(--purple-soft); color: var(--purple); }
.badge.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-breach.dot::before { animation: pulse-red 1.6s ease-out 3; }
.tag { display: inline-block; background: var(--slate-soft); color: #4C5E77; border-radius: 6px; padding: 1px 7px; font-size: .78rem; }

/* ---------- tables */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th { text-align: start; font-weight: 600; color: var(--muted); font-size: .8rem; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t .sort-btn { appearance: none; background: none; border: 0; margin: 0; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: .35em; text-decoration: none; text-align: inherit; }
table.t .sort-arrow { display: inline-block; min-width: 1em; font-size: .75rem; line-height: 1; }
table.t th[aria-sort="ascending"] .sort-btn, table.t th[aria-sort="descending"] .sort-btn { color: var(--ink); }
table.t .sort-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { table.t .sort-btn, table.t .sort-arrow { transition: none; } }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background var(--t); }
table.t tbody tr:hover { background: #FAFBFD; }
table.t tr.rowlink { cursor: pointer; }
table.t tr.is-breach td:first-child { box-shadow: inset -3px 0 0 var(--red); }
table.t tr.is-warn td:first-child { box-shadow: inset -3px 0 0 var(--orange); }
table.t td.subj a { color: var(--ink); font-weight: 600; }
table.t td .sub { color: var(--muted); font-size: .8rem; }
.tnum { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- forms */
label { display: block; font-weight: 600; color: var(--ink); font-size: .88rem; margin-bottom: 5px; }
label .req { color: var(--red); }
.field { margin-bottom: 14px; }
.hint { color: var(--muted); font-size: .8rem; font-weight: 400; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input[type=tel], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #CFD8E3; border-radius: var(--r-sm); padding: 9px 12px; transition: border-color var(--t), box-shadow var(--t); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(31,111,209,.15); }
.pickwrap { position: relative; display: block; }
.pickwrap.is-open { z-index: 40; }
.picklist { position: absolute; z-index: 1; inset-inline: 0; top: calc(100% + 4px); margin: 0; padding: 4px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15,27,51,.12); max-height: 304px; overflow-x: hidden; overflow-y: auto; direction: inherit; text-align: start; }
.picklist[hidden] { display: none; }
.picklist-row { display: flex; align-items: baseline; gap: 0; width: 100%; margin: 0; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.picklist-phone { direction: ltr; unicode-bidi: isolate; }
.picklist-row.is-on, .picklist-row:hover { background: var(--brand-soft); }
.picklist-empty { padding: 8px 10px; color: var(--muted); }
textarea { min-height: 110px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--brand-2); vertical-align: -3px; margin: 0 0 0 6px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; color: var(--text); margin: 6px 0; cursor: pointer; line-height: 1.45; }
.check > input[type=checkbox] { flex: none; margin: 0.2em 0 0; }
.check > span { flex: 1 1 auto; min-width: 0; font-weight: inherit; }
.check > span a { display: inline; white-space: normal; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline > * { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 4px; margin: 0 0 16px; }
legend { font-weight: 700; color: var(--ink); padding: 0 6px; }
.seg { display: inline-flex; background: var(--slate-soft); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg label { margin: 0; font-weight: 500; font-size: .88rem; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--text); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { color: var(--ink); }
.seg label:has(input:checked) { background: #fff; box-shadow: 0 1px 3px rgba(15,27,51,.12); color: var(--ink); font-weight: 600; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: .92rem; border-radius: 10px; padding: 9px 16px; border: 1px solid transparent; cursor: pointer; background: var(--brand); color: #fff; transition: background var(--t), transform var(--t), box-shadow var(--t); text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: #163F70; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn.alt { background: #fff; color: var(--ink); border-color: #CFD8E3; } .btn.alt:hover { background: var(--slate-soft); }
.btn.mint { background: var(--mint); color: var(--ink); } .btn.mint:hover { background: #69CDB0; }
.btn.green { background: var(--green); } .btn.green:hover { background: #18774B; }
.btn.danger { background: #fff; color: var(--red); border-color: #F1C2BB; } .btn.danger:hover { background: var(--red-soft); }
.btn.ghost { background: transparent; color: var(--brand-2); padding: 6px 10px; } .btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { padding: 5px 11px; font-size: .84rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.google { background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 4px; font-family: Roboto, Arial, sans-serif; font-weight: 500; font-size: 14px; min-height: 40px; padding: 0 12px; gap: 10px; box-shadow: none; }
.btn.google:hover { background: #f7f8f8; color: #1f1f1f; }
.btn.google svg { width: 18px; height: 18px; flex: none; }
.linkbtn { background: none; border: 0; color: var(--brand-2); font: inherit; cursor: pointer; padding: 0; }
.linkbtn:hover { text-decoration: underline; }

/* ---------- toasts */
.toasts { position: fixed; bottom: 22px; left: 16px; right: 16px; pointer-events: none; z-index: 99; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { pointer-events: auto; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(15,27,51,.25); font-weight: 500; animation: toastin 220ms ease-out both; display: flex; gap: 8px; align-items: center; max-width: 90vw; }
.toast.ok { background: #14532D; } .toast.error { background: var(--red); } .toast.info { background: var(--brand); }
.toast.hide { animation: toastout 300ms ease-in both; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateY(10px); } }
.alert { border-radius: var(--r-sm); padding: 11px 14px; margin-bottom: 14px; font-weight: 500; }
.alert.error { background: var(--red-soft); color: var(--red); } .alert.ok { background: var(--green-soft); color: var(--green); } .alert.info { background: var(--brand-soft); color: var(--brand); }
.alert.warn { background: var(--mustard-soft); color: #7A5A06; }
.readonly-banner { background: #FFF3B0; color: #1f2937; border: 1px solid #E6D48A; border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; }
.alert.with-action { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.alert.with-action > span { flex: 1 1 14rem; }
.user-form { max-width: 480px; }
#license-full, #add-user { scroll-margin-top: 76px; }

/* ---------- ticket page */
.thead { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.thead .num { color: var(--muted); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.timeline { position: relative; }
.ev { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.ev:last-child { border-bottom: 0; }
.ev .who { font-weight: 600; color: var(--ink); }
.ev .when { color: var(--muted); font-size: .8rem; }
.ev .body { white-space: pre-wrap; word-wrap: break-word; margin-top: 4px; }
.ev.note .bubble { background: #FFFBEA; border: 1px solid #F3E6B5; }
.ev.reply .bubble { background: var(--brand-soft); border: 1px solid #D3E2F5; }
.ev.reply.requester .bubble { background: #fff; border: 1px solid var(--line); }
.ev .bubble { border-radius: 12px; padding: 10px 14px; flex: 1; min-width: 0; }
.ev.sys { padding: 6px 0; font-size: .84rem; color: var(--muted); border-bottom: 0; }
.ev.sys .ico { width: 34px; display: flex; justify-content: center; }
.ev.sys svg { width: 15px; height: 15px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: .9rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 14px; }
.tabs label { margin: 0; padding: 8px 12px; border-bottom: 2px solid transparent; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs input { display: none; }
.tabs label:has(input:checked) { color: var(--ink); border-bottom-color: var(--brand-2); }
.tabnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; }
.tabnav a { padding: 8px 14px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; }
.tabnav a.on { color: var(--ink); border-bottom-color: var(--brand-2); }
.composer.note textarea { background: #FFFDF3; }
.timerbox { display: flex; align-items: center; gap: 10px; background: var(--green-soft); color: var(--green); border-radius: 12px; padding: 10px 14px; font-weight: 600; }
.timerbox .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--green); animation: pulse-mint 1.8s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .timerbox .pulse { animation: none; } }
.progress-tasks { height: 8px; background: var(--slate-soft); border-radius: 99px; overflow: hidden; margin: 6px 0 12px; }
.progress-tasks span { display: block; height: 100%; background: var(--green); }
.task { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task.done .ttl { text-decoration: line-through; color: var(--muted); }
.task .ttl { flex: 1; }
.task form { display: inline; }
details.more > summary { cursor: pointer; color: var(--brand-2); font-weight: 600; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: 12px; }
/* Make the collapsible look clickable: an arrow that turns when open, and an underline on hover. */
details.more > summary::before { content: '◂'; display: inline-block; margin-inline-end: 6px; font-size: .85em; transition: transform .15s; }
html[dir="ltr"] details.more > summary::before { content: '▸'; }
details.more[open] > summary::before { transform: rotate(-90deg); }
html[dir="ltr"] details.more[open] > summary::before { transform: rotate(90deg); }
details.more > summary:hover, details.more > summary:focus-visible { text-decoration: underline; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.file { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; padding: 5px 10px; font-size: .86rem; background: #fff; }
.file svg { width: 15px; height: 15px; color: var(--muted); }

/* empty states */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty svg { width: 120px; height: 90px; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }

/* filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 140px; padding: 7px 10px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pill { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 999px; padding: 5px 13px; font-size: .86rem; font-weight: 500; }
.pill:hover { text-decoration: none; border-color: #CFD8E3; }
.pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 80% -10%, #DCE8F8 0, transparent 60%), radial-gradient(900px 500px at -10% 110%, #DDF4EC 0, transparent 60%), var(--bg); }
.auth .box { width: 100%; max-width: 410px; }
.auth .logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; font-weight: 700; color: var(--ink); font-size: 1.3rem; }
.auth .logo small { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.auth .card { padding: 26px; }
.auth .foot { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 16px; }
.qr { display: grid; place-items: center; background: #fff; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin: 12px auto; width: max-content; }
.qr svg, .qr img { width: 190px; height: 190px; display: block; }
.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .1em; background: var(--slate-soft); padding: 6px 10px; border-radius: 8px; direction: ltr; display: inline-block; word-break: break-all; }

/* demo landing */
.demo-hero { min-height: 100vh; background: radial-gradient(1000px 600px at 85% -10%, #2A5FA3 0, transparent 60%), linear-gradient(160deg, #0F1B33, #16345C); color: #fff; padding: 40px 16px; display: grid; place-items: center; }
.demo-hero .inner { max-width: 1040px; width: 100%; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.demo-hero h1 { color: #fff; font-size: 2.3rem; }
.demo-hero p.lead { color: #C9D3E3; font-size: 1.08rem; }
.demo-hero .card { color: var(--text); }
.demo-hero ul.feat { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.demo-hero ul.feat li { display: flex; gap: 10px; align-items: center; color: #E2E8F2; }
.demo-hero ul.feat svg { width: 20px; height: 20px; color: var(--mint); flex: none; }
.rolecards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rolecard { text-align: right; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; font: inherit; transition: border-color var(--t), transform var(--t); width: 100%; }
.rolecard:hover { border-color: var(--brand-2); transform: translateY(-1px); }
.rolecard b { display: block; color: var(--ink); } .rolecard small { color: var(--muted); }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.demo-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 14px 0; }
.demo-or::before, .demo-or::after { content: ""; flex: 1; height: 1px; background: #E2E8F0; }
.err { color: var(--red); font-size: .82rem; margin-top: 4px; }
/* Entry and survey wizard. One question at a time, pastel chips, a counted bar. */
.wiz { background: #FFF8F3; border: 1px solid #F3D7C4; border-radius: 18px; padding: 16px; }
.wiz-kicker { margin: 0 0 8px; color: #5B6B7F; font-weight: 600; }
.wiz-count { margin: 0 0 8px; color: #1f2937; font-weight: 700; }
.wiz-live { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[data-survey-wizard].is-single [data-wiz-next] { display: none; }
.wiz-bar { height: 10px; background: #F3E6DC; border-radius: 99px; overflow: hidden; margin: 0 0 14px; }
.wiz-bar > span { display: block; height: 100%; background: #E7A27A; border-radius: 99px; }
.wiz-q { margin: 0 0 6px; color: #1f2937; font-size: 1.25rem; }
.wiz-lead { margin: 0 0 12px; color: #3D4C63; }
.wiz-options { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wiz-options legend { padding: 0; margin: 0 0 10px; color: #3D4C63; font-size: .95rem; }
.wiz-chip { position: relative; display: block; }
.wiz-chip input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.wiz-chip span { display: flex; align-items: center; min-height: 48px; padding: 10px 16px; border-radius: 16px; background: #F4FBF7; border: 1px solid #B7DFC8; color: #1f2937; font-weight: 600; cursor: pointer; }
.wiz-chip:hover span { background: #E6F6EC; }
.wiz-chip input:checked + span { background: #E6F6EC; border-color: #2F9D6A; box-shadow: inset 0 0 0 1px #2F9D6A; }
.wiz-chip input:focus-visible + span { outline: 3px solid #1F6FD1; outline-offset: 2px; }
.wiz-msg { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: #FFF3B0; border: 1px solid #E6D48A; color: #1f2937; }
.wiz-info { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #E8F0FA; border: 1px solid #C5D7F2; color: #1f2937; }
.wiz-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.wiz-actions .btn { flex: 1 1 140px; min-height: 48px; font-size: 1rem; }
.wiz-back { background: #fff; color: #1f2937; border: 1px solid #E8C4B0; }
.wiz-back:hover { background: #FFF1E6; color: #1f2937; }
[data-entry-wizard] [data-wiz-next], [data-entry-wizard] [data-wiz-back] { display: none; }
html.wiz-on [data-entry-wizard] [data-wiz-step]:not(.is-on) { display: none; }
html.wiz-on [data-entry-wizard]:not(.is-last) [data-wiz-next] { display: inline-flex; }
html.wiz-on [data-entry-wizard].is-last [data-wiz-go] { display: inline-flex; }
html.wiz-on [data-entry-wizard]:not(.is-last) [data-wiz-go] { display: none; }
html.wiz-on [data-entry-wizard]:not(.is-first) [data-wiz-back] { display: inline-flex; }
@media (max-width: 640px) {
  .wiz { padding: 14px; }
  .wiz-actions .btn { flex-basis: 100%; }
}

/* portal */
.portal-top { background: #fff; border-bottom: 1px solid var(--line); }
.portal-top .in { max-width: 1040px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.portal-top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.portal-top nav a { color: var(--text); padding: 7px 12px; border-radius: 9px; font-weight: 500; }
.portal-top nav a.on, .portal-top nav a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.portal-main { max-width: 1040px; margin: 0 auto; padding: 24px 20px 60px; }
.hello { background: linear-gradient(120deg, var(--brand), #2667B8); color: #fff; border-radius: var(--r); padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.hello h1 { color: #fff; margin: 0 0 4px; } .hello p { margin: 0; color: #D7E4F5; }
.ann { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.ann svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.ann.outage { background: var(--purple-soft); color: #4A2B97; border: 1px solid #DCD0F5; }
.ann.warning { background: var(--mustard-soft); color: #7A5A06; border: 1px solid #EFE0AF; }
.ann.info { background: var(--brand-soft); color: var(--brand); border: 1px solid #D3E2F5; }
.ann b { display: block; }
.steps-mini { display: flex; gap: 0; margin: 10px 0 2px; }
.steps-mini span { flex: 1; text-align: center; font-size: .78rem; color: var(--muted); padding-top: 10px; border-top: 4px solid var(--line); }
.steps-mini span.on { border-top-color: var(--green); color: var(--green); font-weight: 600; }

/* misc */
.right { text-align: left; } .center { text-align: center; }
.mt0 { margin-top: 0; } .mt { margin-top: 16px; } .mb0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.mailframe { width: 100%; min-height: 70vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.print-only { display: none; }

/* ---------- responsive */
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0,1fr)); } .split { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; position: fixed; inset-inline-start: 0; top: 0; width: 260px; z-index: 50; }
  body.nav-open .side { display: flex; box-shadow: -10px 0 40px rgba(0,0,0,.3); }
  .demobar .roles { margin-inline-start: 0; }
  .menu-btn { display: inline-flex; }
  .top { padding: 10px 16px; } .content { padding: 18px 16px 50px; } .majorbar, .demobar, .verifybar { padding-inline: 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .demo-hero .inner { grid-template-columns: 1fr; }
  .top form.search { display: none; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; } }
body.no-motion *, body.no-motion *::before, body.no-motion *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
@media print { .side, .top, .demobar, .verifybar, .majorbar, .no-print { display: none !important; } .shell { display: block; } .print-only { display: block; } .card { box-shadow: none; } .report-donut, .rings { break-inside: avoid; } .donut-seg, .ring-arc, .donut-legend i, .donut-track, .ring-track, .sla-pct { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .donut-seg, .ring-arc { animation: none !important; stroke-dashoffset: 0 !important; } }
.toast svg { width: 18px; height: 18px; flex: none; }
.kv dd svg, p svg, .alert svg, h2 svg, summary svg { width: 18px; height: 18px; vertical-align: -3px; }
.bars .col { overflow: hidden; }
@media (max-width: 860px) { .bars { gap: 3px; } .bars .col:nth-child(even) .d { visibility: hidden; } .bars .d { font-size: .62rem; } .hbar { grid-template-columns: 96px 1fr 28px; } .donut-plot { width: 148px; height: 148px; } }
@media (max-width: 640px) {
  .report-donut { flex-direction: column; align-items: stretch; gap: 12px; }
  .donut-plot { width: min(200px, 70vw); height: auto; margin-inline: auto; }
  .rings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 8px; }
  .ring-plot { max-width: 148px; }
  .ring-empty-label { font-size: .85rem; max-width: 5.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .donut-seg, .ring-arc { animation: none !important; stroke-dashoffset: 0 !important; }
}
body.no-motion .donut-seg, body.no-motion .ring-arc { animation: none !important; stroke-dashoffset: 0 !important; }
.filepick { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 100%; }
.filepick-native { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.datepick { position: relative; display: block; }
.inline .datepick { display: inline-block; min-width: 11.5rem; }
.datepick input[type=date] { color: transparent; }
.datepick input[type=date]::-webkit-calendar-picker-indicator { opacity: 1; }
.datepick input[type=date]::-webkit-datetime-edit,
.datepick input[type=date]::-webkit-datetime-edit-fields-wrapper,
.datepick input[type=date]::-webkit-datetime-edit-text,
.datepick input[type=date]::-webkit-datetime-edit-month-field,
.datepick input[type=date]::-webkit-datetime-edit-day-field,
.datepick input[type=date]::-webkit-datetime-edit-year-field { color: transparent; }
.date-il { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--ink); font-variant-numeric: tabular-nums; }
.skip { position: absolute; inset-inline-start: 12px; top: -40px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 8px; }
.field-error { color: var(--red); font-size: .82rem; font-weight: 600; margin-top: 4px; }
/* Inline validation messages under a field (signup, login, any auth form). */
small.error, .field .error, .auth .error { display: block; color: var(--red); font-size: .82rem; font-weight: 600; margin-top: 4px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.field.has-error input:focus, .field.has-error select:focus, .field.has-error textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.demobar .verify-close { background: transparent; color: #fff; border-color: transparent; }
.demobar .verify-close:hover, .demobar .verify-close:focus-visible { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); }
table.source { width: 100%; table-layout: fixed; }
table.source th, table.source td { white-space: normal; }
.table-wrap:has(table.source) { overflow-x: visible; }
@media (max-width: 1280px) {
  table.source th { font-size: .75rem; padding: 6px 6px; }
}
@media (max-width: 640px) {
  .userchip-name { display: none; }
  .logout-btn { min-height: 44px; padding-inline: 12px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px 10px 12px 14px; }
  .kpi .val { font-size: 1.55rem; }
  .demobar, .verifybar { align-items: flex-start; }
  .verifybar .verify-actions, .demobar .roles { width: 100%; margin-inline-start: 0; }
}
/* «מתחילים כאן» is a corner pill. The page keeps its full width. The steps open in a drawer. */
.starthere-pill { position: fixed; z-index: 40; left: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: calc(100vw - 32px); padding: 6px 14px 6px 8px; border: 1px solid #F5C6A5; border-radius: 999px; background: #FFF6EE; color: #1f2937; font: inherit; font-weight: 700; box-shadow: 0 8px 24px rgba(15, 27, 51, .18); cursor: pointer; }
.starthere-pill:hover { background: #FFE8D6; }
.starthere-pill:focus-visible { outline: 3px solid #1F6FD1; outline-offset: 2px; }
body:has(.starthere-pill) .toasts { bottom: 72px; }
.starthere-ring { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(#2F9D6A calc(var(--sh) * 1%), #F3E6DC 0); display: inline-grid; place-items: center; flex: none; }
.starthere-ring::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: #FFF6EE; }
.starthere-pill:hover .starthere-ring::after { background: #FFE8D6; }
.starthere-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(15, 27, 51, .45); }
.starthere-backdrop[hidden], .starthere-drawer[hidden] { display: none !important; }
.starthere-drawer { position: fixed; z-index: 100; top: 0; bottom: 0; left: 0; width: min(360px, calc(100vw - 32px)); overflow: auto; background: #FFF8F3; color: #1f2937; border-inline-end: 1px solid #F3D7C4; box-shadow: 8px 0 32px rgba(15, 27, 51, .18); padding: 16px 16px 24px; }
.starthere-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.starthere-head h2 { margin: 0; font-size: 1.05rem; color: #1f2937; }
.starthere-close { width: 44px; height: 44px; border: 1px solid #F5C6A5; border-radius: 999px; background: #fff; color: #1f2937; font: inherit; font-size: 1.1rem; cursor: pointer; }
.starthere-close:hover { background: #FFE8D6; }
.starthere-close:focus-visible { outline: 3px solid #1F6FD1; outline-offset: 2px; }
.starthere-progress { margin: 8px 0 6px; color: var(--muted); font-size: .85rem; }
.starthere-bar { height: 8px; background: var(--slate-soft); border-radius: 99px; overflow: hidden; }
.starthere-bar span { display: block; height: 100%; background: var(--mint); border-radius: 99px; }
.starthere-steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.starthere-steps li { background: #E6F6EC; border: 1px solid #BFE6CD; border-radius: 10px; padding: 0; }
.starthere-steps li.done { background: #EFE8FB; border-color: #D3C4F2; }
.starthere-steps a.starthere-step { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 10px; border-radius: 10px; color: #1f2937; font-weight: 600; text-decoration: none; cursor: pointer; }
.starthere-steps a.starthere-step:hover { background: #d4f0df; text-decoration: none; }
.starthere-steps li.done a.starthere-step:hover { background: #e4d8f6; }
.starthere-steps a.starthere-step:focus-visible { outline: 3px solid rgba(31,111,209,.45); outline-offset: 2px; border-radius: 10px; text-decoration: none; color: #1f2937; }
.starthere-steps .starthere-step-label { display: block; }
.starthere-steps .hint { display: block; font-weight: 400; }
.starthere-drawer form { margin: 0; }
.starthere-drawer .starthere-tour,
.starthere-drawer .starthere-video { display: flex; align-items: center; justify-content: center; text-align: center; margin-top: 10px; width: 100%; min-height: 44px; }
.starthere-drawer .starthere-tour { background: #FFE8D6; color: #1f2937; border: 1px solid #F5C6A5; }
.starthere-drawer .starthere-tour:hover { background: #FFD4B8; border-color: #E8B08A; color: #1f2937; }
.starthere-drawer .starthere-tour:focus-visible { outline: 3px solid rgba(196, 122, 74, .45); outline-offset: 2px; color: #1f2937; }
@media (max-width: 700px) {
  .starthere-drawer { top: auto; right: 0; width: auto; max-height: min(85vh, 640px); border: 1px solid #F3D7C4; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 32px rgba(15, 27, 51, .18); }
}
.tour-offer { position: fixed; inset: 0; z-index: 80; background: rgba(15, 27, 51, .45); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.tour-offer[hidden] { display: none; }
.tour-offer-card { background: #fff; color: var(--text); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; width: min(420px, 100%); }
.tour-offer-card h2 { margin: 0 0 8px; }
.tour-offer-card p { margin: 0 0 14px; }
.tour-offer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tour-offer-actions .btn { min-height: 44px; }
.driver-popover.desk-tour { direction: rtl; text-align: right; font-family: Heebo, system-ui, sans-serif; max-width: min(340px, calc(100vw - 24px)); }
.driver-popover.desk-tour, .driver-popover.desk-tour * { font-family: Heebo, system-ui, sans-serif; }
.driver-popover.desk-tour .driver-popover-title { font-size: 1.05rem; }
.driver-popover.desk-tour .driver-popover-description { font-size: .92rem; line-height: 1.5; }
.driver-popover.desk-tour .driver-popover-close-btn { left: 0; right: auto; width: 44px; height: 44px; }
.driver-popover.desk-tour .driver-popover-footer button { min-height: 44px; padding: 8px 12px; font-size: .9rem; }
.driver-popover.desk-tour .driver-popover-navigation-btns button + button { margin-left: 0; margin-inline-start: 6px; }
@media (prefers-reduced-motion: reduce) {
  .driver-popover.desk-tour, .driver-fade .driver-overlay, .driver-fade .driver-popover { animation: none !important; }
}
/* Driver.js paints the spotlight as an SVG hole at z-index 10000 and does not
   raise the target. .side (sticky, and fixed at z-index 50 on a narrow screen),
   .top (sticky, z-index 20) and .starthere (fixed, z-index 30) keep the control
   under that overlay, so the popover shows and the highlight does not. Lift only
   the ancestor that holds the active control, dim the rest of it, and outline
   the control in brand blue. The welcome step uses #driver-dummy-element and
   stays centered, without an outline. */
body.driver-active .side:has(.driver-active-element),
body.driver-active .top:has(.driver-active-element),
body.driver-active .demobar:has(.driver-active-element),
body.driver-active .portal-top:has(.driver-active-element) {
  z-index: 10001 !important;
}
body.driver-active .demobar:has(.driver-active-element),
body.driver-active .portal-top:has(.driver-active-element) { position: relative; }
body.driver-active .side:has(.driver-active-element)::before,
body.driver-active .top:has(.driver-active-element)::before,
body.driver-active .demobar:has(.driver-active-element)::before,
body.driver-active .portal-top:has(.driver-active-element)::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  z-index: 1;
  pointer-events: none;
}
body.driver-active .driver-active-element:not(#driver-dummy-element) {
  z-index: 2 !important;
  outline: 3px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 10px;
  box-shadow: 0 0 0 4px rgba(31, 111, 209, .35);
}
body.driver-active .driver-active-element:not(#driver-dummy-element):not(.starthere) { position: relative; }
body.driver-active .side a.driver-active-element { background: rgba(31, 111, 209, .45); color: #fff; }
body.driver-active .starthere.driver-active-element:not(#driver-dummy-element) {
  position: fixed !important;
  z-index: 10001 !important;
}
.starthere-drawer .starthere-video { background: #E3F0FF; color: #1f2937; border: 1px solid #B8D4F5; }
.starthere-drawer .starthere-video:hover { background: #d0e6ff; border-color: #9ec4ef; color: #1f2937; }
.starthere-drawer .starthere-video:focus-visible { outline: 3px solid rgba(31, 111, 209, .45); outline-offset: 2px; color: #1f2937; }
[data-demo-video-dialog].demo-video {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 27, 51, .72);
  direction: rtl;
}
[data-demo-video-dialog].demo-video[hidden] { display: none !important; }
[data-demo-video-dialog] .demo-video-card {
  display: flex;
  flex-direction: column;
  width: min(960px, 100%);
  max-width: 960px;
  max-height: calc(100vh - 32px);
  margin: 0;
  background: #fff;
  color: var(--text);
  border: 1px solid rgba(15, 27, 51, .08);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 27, 51, .35);
  overflow: hidden;
  direction: rtl;
  text-align: right;
}
[data-demo-video-dialog] .demo-video-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 10px 12px;
  background: #fff;
}
[data-demo-video-dialog] .demo-video-head h2 { margin: 0; font-size: 1.05rem; }
[data-demo-video-dialog] .demo-video-close {
  margin-inline-start: auto;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ink);
}
[data-demo-video-dialog] .demo-video-close:hover,
[data-demo-video-dialog] .demo-video-close:focus-visible { background: var(--brand-soft); }
[data-demo-video-dialog] .demo-video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0F1B33;
}
[data-demo-video-dialog] .demo-video-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0F1B33;
}
[data-demo-video-dialog] .demo-video-fallback { margin: 8px 12px; }
@media (max-width: 640px) {
  [data-demo-video-dialog].demo-video { padding: 8px; align-items: flex-end; }
  [data-demo-video-dialog] .demo-video-card { width: 100%; max-height: calc(100vh - 16px); border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .demo-video, .demo-video-card { animation: none !important; }
}
body.no-motion .demo-video, body.no-motion .demo-video-card { animation: none !important; }
@media (max-width: 860px) {
  table.mini tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.mini td { border: 0; padding: 0 2px; }
  table.mini td.subj { flex-basis: 100%; }
  table.mini td.right { margin-inline-start: auto; }
}

/* Report drill-down links (0.25.0) */
a.kpi { text-decoration: none; color: inherit; }
a.kpi:hover { box-shadow: 0 0 0 2px rgba(31,111,209,.25); }
a.ring { display: block; text-decoration: none; color: inherit; }
a.ring:hover .ring-lbl { color: var(--accent, #1F6FD1); }
.donut-legend a.donut-link { display: flex; align-items: center; gap: 8px; width: 100%; color: inherit; text-decoration: none; }
.donut-legend a.donut-link:hover .lbl { text-decoration: underline; }

/* Demo entry: which kind of company (0.26.0) */
.demo-kind { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.demo-kind legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.demo-kind-opt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.demo-kind-opt:has(input:checked) { border-color: var(--brand-2); background: rgba(42, 95, 163, .06); }
.demo-kind-opt small { display: block; color: var(--muted); font-weight: 400; }

/* Field service: "my day" (0.26.0) */
.tech-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 18px; }
.tech-summary > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; text-align: center; box-shadow: var(--shadow); }
.tech-summary .stat-num { display: block; font-size: 1.7rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.tech-summary .stat-label { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.tech-heading { margin: 4px 0 10px; font-size: 1.05rem; }
.visit-list { display: grid; gap: 12px; }
.visit-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.visit-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.visit-when { font-weight: 700; color: var(--brand); font-size: 1.05rem; }
.visit-title { display: block; font-weight: 600; color: var(--ink); font-size: 1.05rem; }
.visit-client { color: var(--muted); margin-bottom: 6px; }
.visit-line { font-size: .92rem; padding: 1px 0; }
.visit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.visit-actions .btn { flex: 1 1 auto; text-align: center; justify-content: center; min-height: 40px; }
.sigpad { display: block; width: 100%; height: 150px; border: 1px dashed var(--slate); border-radius: var(--r-sm); background: #fff; touch-action: none; }
.sigpad-actions { display: flex; gap: 8px; margin-top: 6px; align-items: center; }
@media (max-width: 900px) { .tech-summary .stat-num { font-size: 1.4rem; } }

/* 0.35.0 process templates */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grid-cards .card.link { display: block; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; cursor: pointer; }
.grid-cards .card.link:hover { box-shadow: 0 2px 12px rgba(0,0,0,.1); transform: translateY(-2px); }
.grid-cards .card-icon { margin-bottom: 8px; }
.grid-cards .card-icon svg { width: 28px; height: 28px; color: var(--accent, #1F6FD1); }
.checklist-preview { list-style: none; padding: 0; margin: 8px 0; }
.checklist-preview li { padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: .9em; }
.checklist-preview li:last-child { border-bottom: 0; }
.task { flex-wrap: wrap; }
.task-notes { width: 100%; font-size: .85em; background: var(--bg-alt, #f8f9fa); border-radius: 4px; padding: 6px 10px; margin: 4px 0 0; }
.task-note-form { width: 100%; }
.task-note-form summary { font-size: .8em; cursor: pointer; }

/* 0.38.0 scheduling board */
.sched-wrap { display: flex; gap: 16px; min-height: 60vh; }
.sched-backlog { flex: 0 0 220px; min-width: 180px; }
.sched-days { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.sched-backlog h3, .sched-day h3 { font-size: .9rem; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--line); display: flex; align-items: center; gap: 6px; }
.sched-day.today h3 { color: var(--brand); border-bottom-color: var(--brand); }
.sched-col { min-height: 80px; padding: 4px; border-radius: var(--r-sm); transition: background .15s; }
.sched-col.drag-over { background: color-mix(in srgb, var(--brand) 10%, transparent); outline: 2px dashed var(--brand); outline-offset: -2px; }
.sched-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; margin-bottom: 6px; cursor: grab; box-shadow: var(--shadow); transition: box-shadow .15s, opacity .15s; }
.sched-card:active { cursor: grabbing; }
.sched-card.dragging { opacity: .4; }
.sched-card.p1 { border-inline-start: 3px solid #d33; }
.sched-card.p2 { border-inline-start: 3px solid #e68a00; }
.sched-card.p3 { border-inline-start: 3px solid var(--brand); }
.sched-card.p4 { border-inline-start: 3px solid var(--slate); }
.sc-head { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.sc-num { font-weight: 700; font-size: .82rem; color: var(--brand); text-decoration: none; direction: ltr; unicode-bidi: isolate; }
.sc-num:hover { text-decoration: underline; }
.sc-prio { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sc-prio.p1 { background: #d33; } .sc-prio.p2 { background: #e68a00; } .sc-prio.p3 { background: var(--brand); } .sc-prio.p4 { background: var(--slate); }
.sc-subj { font-size: .82rem; color: var(--ink); margin: 3px 0 2px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sc-client { font-size: .75rem; color: var(--muted); }
.sc-assign { font-size: .75rem; color: var(--muted); display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.sc-assign svg { width: 12px; height: 12px; }
.sched-empty { font-size: .82rem; color: var(--muted); text-align: center; padding: 16px 4px; }
.sched-drop-hint { border: 1px dashed var(--line); border-radius: var(--r-sm); min-height: 60px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 1100px) { .sched-days { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 800px) { .sched-wrap { flex-direction: column; } .sched-backlog { flex: none; } .sched-days { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 500px) { .sched-days { grid-template-columns: 1fr 1fr; } }
