/* ==========================================================
   نظام إدارة الورشة — الهوية: جرافيت + إشارة برتقالية
   ========================================================== */
:root {
  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --ink: #14171c;
  --ink-2: #3a404a;
  --muted: #6b7280;
  --line: #e4e6ea;
  --line-2: #d3d7dd;
  --accent: #e8590c;
  --accent-2: #c2410c;
  --accent-soft: #fff1e8;
  --blue: #2563eb; --blue-soft: #eaf1ff;
  --green: #15803d; --green-soft: #e8f7ee;
  --amber: #b45309; --amber-soft: #fff6e0;
  --red: #c81e1e; --red-soft: #fdecec;
  --violet: #6d28d9; --violet-soft: #f1ebff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --side-w: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.6; color: var(--ink); background: var(--bg); }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-weight: 700; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
small { font-size: .82em; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.muted { color: var(--muted); }
.d-block { display: block; }
.txt-red { color: var(--red); } .txt-green { color: var(--green); } .txt-amber { color: var(--amber); }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
[hidden] { display: none !important; }

/* ---------- الهيكل ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: var(--side-w); flex: none; background: var(--ink); color: #c9ced6;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand-mark .ic { width: 22px; height: 22px; }
.brand-mark.brand-r { font-size: 22px; font-weight: 700; line-height: 1; }
.brand strong { display: block; color: #fff; font-size: 15px; }
.brand small { color: #8a919c; font-size: 12px; }
.brand strong .brand-tag { display: block; font-size: 11px; font-weight: 500; color: #f8b48a; margin-top: 1px; }
.brand small { display: block; color: #d6dae0; font-size: 12.5px; margin-top: 3px; }
.side nav { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  color: #c9ced6; font-weight: 500; position: relative; transition: background .15s, color .15s;
}
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side nav a.on { background: rgba(232, 89, 12, .16); color: #fff; }
.side nav a.on::before { content: ""; position: absolute; inset-inline-start: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.side nav a.on .ic { color: var(--accent); }
.side-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.07); }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me strong { display: block; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.me small { color: #8a919c; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #2a2f37; color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.side .icon-btn { color: #c9ced6; }
.side .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: rgba(242, 243, 245, .88); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 17px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.content { padding: 24px 28px 64px; max-width: 1480px; width: 100%; margin: 0 auto; }
.icon-btn.only-m { display: none; }

/* ---------- عناصر عامة ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head.pad { padding: 16px 20px 0; }
.card-head h3 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ic { color: var(--muted); }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); font-family: var(--mono); }
.count-red { background: var(--red-soft); border-color: #f6caca; color: var(--red); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; }
.page-head p { color: var(--muted); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; border-color: #c2c7cf; }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: #116632; border-color: #116632; }
.btn-amber { background: #f59e0b; border-color: #f59e0b; color: #1f1300; }
.btn-amber:hover { background: #d98b06; }
.btn-amber-o { border-color: #f3c66b; color: var(--amber); background: var(--amber-soft); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #a51818; }
.btn-danger-o { border-color: #f1b4b4; color: var(--red); background: #fff5f5; }
.purge-pop .pop-body { min-width: 260px; }
.reset-list { columns: 2; font-size: 14px; margin: 8px 0 14px; }
/* نموذج فحص الشراء */
.pi-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.pi-sec { margin-bottom: 14px; }
.pi-sec .card-head h3 small { font-weight: 400; font-size: 12px; }
.pi-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; margin-bottom: 10px; }
@media (max-width: 900px) { .pi-items { grid-template-columns: 1fr; } }
.pi-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.pi-item.is-ok { border-color: #bbe5c8; background: var(--green-soft); }
.pi-item.is-bad { border-color: #f5b5d2; background: #fdf0f6; }
.pi-n { width: 22px; flex: none; color: var(--muted); font-size: 12px; font-family: var(--mono); }
.pi-l { flex: 1; font-size: 14px; line-height: 1.4; }
.pi-seg { display: inline-flex; flex: none; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.pi-seg label { cursor: pointer; }
.pi-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pi-seg b { display: grid; place-items: center; width: 36px; height: 32px; font-size: 15px; color: var(--muted); border-inline-start: 1px solid var(--line); }
.pi-seg label:first-child b { border-inline-start: 0; }
.pi-seg input:checked + b { color: #fff; background: var(--ink-2); }
.pi-seg input[value=ok]:checked + b { background: var(--green); }
.pi-seg input[value=bad]:checked + b { background: #be185d; }
.pi-seg input:focus-visible + b { outline: 2px solid var(--accent); outline-offset: -2px; }
.pi-body { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }
@media (max-width: 700px) { .pi-body { grid-template-columns: 1fr; } .pi-body .pi-car { max-width: 240px; margin: 0 auto; } }
.pi-car { width: 100%; height: auto; display: block; }
.pi-car rect[data-svg]:hover { stroke: var(--accent); stroke-width: 3; }
.pi-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.pi-panel span { font-size: 12px; }
.pi-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin-top: 10px; }
.pi-legend i { display: inline-block; width: 14px; height: 14px; border: 1px solid #334155; border-radius: 3px; vertical-align: -2px; margin-inline-end: 4px; }
.pi-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pi-empty { text-align: center; padding: 34px 20px; }
.pi-start-link { margin: 8px 0; font-weight: 600; }
.pi-start-link a { color: #a21caf; display: inline-flex; gap: 6px; align-items: center; }
.pi-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; border: 1.5px solid #f0abfc; background: #fdf4ff; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; }
.pi-box strong { font-size: 15px; }
.pi-box .pi-box-act { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) { .reset-list { columns: 1; } }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 9px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; font-size: 20px; line-height: 1; }
.icon-btn:hover { background: rgba(0,0,0,.05); }
.icon-btn.danger { color: var(--red); width: 30px; height: 30px; }
.icon-btn.danger:hover { background: var(--red-soft); }
.link { background: none; border: 0; padding: 0; color: var(--accent-2); font: inherit; font-size: 13px; cursor: pointer; }

.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.chip-blue { background: var(--blue-soft); color: var(--blue); }
.chip-green { background: var(--green-soft); color: var(--green); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.chip-red { background: var(--red-soft); color: var(--red); }
.chip-violet { background: var(--violet-soft); color: var(--violet); }
.chip-gray { background: #eef0f3; color: var(--ink-2); }
.chip-muted { background: transparent; color: var(--muted); }
.chip-dark { background: var(--ink); color: #fff; }

.plate {
  display: inline-block; font-family: var(--mono), var(--font); font-weight: 600; font-size: 14px; word-spacing: .15em;
  padding: 1px 9px; border: 1.5px solid var(--ink); border-radius: 5px; background: #fff; color: var(--ink);
  unicode-bidi: plaintext; white-space: nowrap;
}
.plate-lg { font-size: 20px; padding: 4px 14px; border-width: 2px; }
/* لوحة سعودية: الأرقام يساراً والحروف يميناً، العربي أعلى والإنجليزي أسفل */
.kplate { display: inline-grid; grid-template-columns: auto auto; direction: ltr; border: 1.5px solid var(--ink); border-radius: 5px; background: #fff; color: var(--ink); line-height: 1.2; font-weight: 700; overflow: hidden; vertical-align: middle; white-space: nowrap; }
.kplate > span { padding: 1px 7px; text-align: center; font-size: 13px; }
.kplate > span:nth-child(-n+2) { border-bottom: 1px solid var(--ink); }
.kplate .kp-d { border-right: 1.5px solid var(--ink); }
.kplate .en { font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; }
.kplate-lg > span { font-size: 19px; padding: 2px 12px; }
.kplate-lg .en { font-size: 16px; }
.kplate-lg { border-width: 2px; }
.kplate-sm > span { font-size: 11px; padding: 0 5px; }
.kplate-sm .en { font-size: 10px; }
.plate-entry { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.pe-box { display: flex; flex-direction: column; gap: 4px; }
.pe-box small { color: var(--muted); font-weight: 600; }
.pe-box input { font-size: 22px; font-weight: 700; text-align: center; min-height: 52px; letter-spacing: .06em; }
.pe-box input#plateDigits { font-family: var(--mono); }
.pe-preview { min-width: 170px; min-height: 52px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 4px 10px; background: var(--surface-2); }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); margin-top: 6px; cursor: pointer; font-weight: 500; }
.pe-error { font-size: 13px; }
.choice-row.choice-3 { grid-template-columns: repeat(3, 1fr); }
.choice-row.choice-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .choice-row.choice-4 { grid-template-columns: repeat(2, 1fr); } }
.choice-row.choice-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1200px) { .choice-row.choice-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .choice-row.choice-5 { grid-template-columns: 1fr 1fr; } }
/* تكلفة الشراء: داخلية فقط */
.cost-cell { color: var(--muted); font-size: 13px; }
.margin-pos { color: var(--green); }
.margin-neg { color: var(--red); }
.cost-note { display: block; font-size: 12px; color: var(--muted); margin-top: 6px; }
.add-grid .cost-input { max-width: 120px; }
.add-grid .cost-wrap, .add-grid .price-wrap { display: flex; flex-direction: column; gap: 3px; }
.add-grid:has(.price-wrap) { align-items: end; }
.price-cap { font-size: 11.5px; font-weight: 600; color: var(--green); white-space: nowrap; }
.add-grid .cost-wrap .cost-input { max-width: none; }
.tag-combo { background: var(--violet-soft); color: var(--violet); }
.note-row { margin-top: 8px; display: grid; gap: 6px; }
.note-row select { width: 100%; }
.item-note { display: flex; gap: 5px; align-items: flex-start; font-size: 12.5px; color: var(--green); margin-top: 3px; line-height: 1.5; }
.item-note .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.tbl-nowrap td, .tbl-nowrap th { white-space: nowrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dlg { border: 0; border-radius: 14px; padding: 20px 22px; width: min(720px, 94vw); max-height: 92vh; overflow: auto; box-shadow: 0 24px 60px rgba(0,0,0,.25); background: var(--surface, #fff); color: inherit; }
.dlg::backdrop { background: rgba(15, 18, 24, .55); }
.dlg .form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) { .dlg .fields { grid-template-columns: 1fr; } }
.scan-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.scan-box { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; max-width: 520px; padding: 4px 12px; border: 2px dashed var(--accent, #ea580c); border-radius: 10px; background: var(--accent-soft); }
.scan-box input { border: 0; background: transparent; flex: 1; font-size: 16px; padding: 8px 0; outline: none; box-shadow: none; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; }
/* الرسائل النصية */
.switch-row { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 12px; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--green); }
.card-head .switch-row { margin: 0; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ph-chips .chip { cursor: pointer; border: 0; font: inherit; font-size: 12px; }
.ph-chips .chip:hover { background: var(--accent-soft); color: var(--accent-2); }
.sms-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sms-tpl { width: 100%; font-size: 15px; line-height: 1.7; }
.sms-meter { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.sms-phone { background: #eef1f5; border-radius: 22px; padding: 18px 14px; min-height: 150px; display: flex; flex-direction: column; gap: 8px; }
.sms-bubble { align-self: flex-start; max-width: 92%; background: #fff; border-radius: 16px 16px 16px 4px; padding: 10px 14px; white-space: pre-line; font-size: 14px; line-height: 1.7; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.sms-text { white-space: pre-line; max-width: 420px; }
.hidden-form { display: none; }
@media (max-width: 800px) { .sms-grid { grid-template-columns: 1fr; } }
.bk-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.bk-actions .pop-body { min-width: 240px; }
.settle-box { padding: 14px 18px 18px; border-top: 1px solid var(--line, #e5e7eb); display: grid; gap: 10px; }
.pm-credit .pm-logo { color: var(--amber, #b45309); }
@media (max-width: 640px) { .settle-box .row-3 { grid-template-columns: 1fr; } }
.cost-cap { font-size: 11.5px; font-weight: 600; color: var(--red); white-space: nowrap; }
.add-grid:has(.cost-wrap:not([hidden])) { grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; }
.add-grid:has(.cost-wrap:not([hidden])) .desc-input { grid-column: 1 / -1; }
.inspect-box { margin-top: 14px; padding: 14px; border: 1.5px solid #c7b7f5; background: var(--violet-soft); border-radius: 10px; }
.inspect-box summary { cursor: pointer; font-weight: 700; color: var(--violet); display: flex; align-items: center; gap: 8px; }
.inspect-box[open] summary { margin-bottom: 10px; }
.inspect-report { margin-top: 14px; padding: 12px 14px; background: var(--violet-soft); border: 1px solid #d9cdfa; border-radius: 8px; font-size: 14px; white-space: pre-line; }
@media (max-width: 640px) {
  .plate-entry { grid-template-columns: 1fr 1fr; }
  .pe-preview { grid-column: 1 / -1; }
  .choice-row.choice-3, .choice-row.choice-4 { grid-template-columns: 1fr; }
}

.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-weight: 500; border: 1px solid; }
.alert .ic { margin-top: 3px; }
.alert-success { background: var(--green-soft); border-color: #bfe5cd; color: #0f5c2c; }
.alert-error { background: var(--red-soft); border-color: #f4c4c4; color: #8f1414; }
.alert-amber { background: var(--amber-soft); border-color: #f3dca5; color: #7a3d06; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 28px; font-size: 14px; }
.banner-amber { background: #fdba3b; color: #2b1800; }
.banner-gray { background: #e5e7eb; color: var(--ink); border-bottom: 1px solid var(--line-2); }

/* ---------- النماذج ---------- */
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: #fff; width: 100%;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 12px; min-height: 42px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 89, 12, .15); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--ink-2); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--accent); }
input[type=file] { padding: 7px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field.check { flex-direction: row; align-items: center; gap: 8px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fields-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tbl tr.is-sel td { background: var(--accent-soft); }
.span-2 { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row-2 { display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
.form-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form input { width: auto; min-height: 32px; padding: 4px 8px; font-size: 13px; }
.input-plate { font-family: var(--mono), var(--font); font-size: 20px; font-weight: 600; word-spacing: .2em; text-align: center; unicode-bidi: plaintext; }

.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice > span { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1.5px solid var(--line-2); border-radius: 10px; font-weight: 700; transition: all .15s; }
.choice > span .ic { color: var(--muted); margin-bottom: 4px; width: 22px; height: 22px; }
.choice small { font-weight: 400; color: var(--muted); }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(232, 89, 12, .12); }
.choice input:checked + span .ic { color: var(--accent); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { align-self: flex-start; display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 6px 14px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.seg-sm span { padding: 4px 11px; font-size: 13px; }

.quick-times { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.quick-times button { font: inherit; font-size: 12.5px; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; }
.quick-times button:hover { border-color: var(--accent); color: var(--accent-2); }

/* ---------- الإحصاءات ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; gap: 2px 10px; color: var(--ink); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
a.stat:hover { text-decoration: none; border-color: var(--line-2); }
.stat::after { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3px; background: var(--line-2); }
.stat-blue::after { background: var(--blue); } .stat-red::after { background: var(--red); } .stat-amber::after { background: #f59e0b; }
.stat-violet::after { background: var(--violet); } .stat-green::after { background: var(--green); }
.stat-ic { grid-row: 1 / 3; grid-column: 2; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.stat-blue .stat-ic { background: var(--blue-soft); color: var(--blue); } .stat-red .stat-ic { background: var(--red-soft); color: var(--red); }
.stat-amber .stat-ic { background: var(--amber-soft); color: var(--amber); } .stat-violet .stat-ic { background: var(--violet-soft); color: var(--violet); }
.stat-green .stat-ic { background: var(--green-soft); color: var(--green); }
.stat-l { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-v { font-size: 26px; font-weight: 700; font-family: var(--mono); letter-spacing: -.01em; line-height: 1.2; }
.stat-v .cur { font-family: var(--font); font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-s { color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid-wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

/* ---------- الجداول ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr[data-href] { cursor: pointer; }
.tbl tbody tr:hover td { background: #fafbfc; }
.tbl tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 0; }
.tbl tfoot tr.grand td { font-size: 16px; }
.tbl .num { text-align: end; font-family: var(--mono); white-space: nowrap; }
.tbl th.num { font-family: var(--font); }
.tbl td.act { text-align: end; white-space: nowrap; }
.tbl tr.is-late td:first-child { box-shadow: inset -3px 0 0 var(--red); }
.tbl tr.is-off td { opacity: .55; }
.tbl-compact td { padding: 8px 12px; font-size: 13px; }
.card:not(.flush) .tbl th:first-child, .card:not(.flush) .tbl td:first-child { padding-inline-start: 4px; }
.tbl-edit td { padding: 6px 8px; }
.tbl-edit input, .tbl-edit select { min-height: 38px; }
.tbl-edit input.num { text-align: end; font-family: var(--mono); }
.late { color: var(--red); font-weight: 600; font-size: 13px; white-space: nowrap; }
.due { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.dpills { display: flex; gap: 4px; flex-wrap: wrap; }
.dpill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 5px; white-space: nowrap; }
.dpill .ic { width: 13px; height: 13px; }
.dpill-gray { background: #eef0f3; color: var(--ink-2); } .dpill-blue { background: var(--blue-soft); color: var(--blue); }
.dpill-amber { background: var(--amber-soft); color: var(--amber); } .dpill-green { background: var(--green-soft); color: var(--green); }
.tag { font-size: 12px; padding: 2px 7px; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.tag-labor { background: var(--blue-soft); color: var(--blue); } .tag-part { background: #eef0f3; color: var(--ink-2); } .tag-stock { background: var(--accent-soft); color: var(--accent-2); }

.empty-s { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.empty { text-align: center; padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.empty-ic .ic { width: 44px; height: 44px; color: var(--muted); }
.empty h2 { font-size: 18px; max-width: 520px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 6px 13px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 13.5px; border: 1px solid transparent; }
.tabs a:hover { background: #fff; text-decoration: none; border-color: var(--line); }
.tabs a.on { background: var(--ink); color: #fff; }
.search { position: relative; min-width: 280px; }
.search.wide { flex: 1; max-width: 560px; }
.search .ic { position: absolute; inset-inline-start: 12px; top: 12px; color: var(--muted); }
.search input { padding-inline-start: 38px; background: #fff; }
.range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.range label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.range input { width: auto; min-height: 34px; padding: 4px 8px; }
.pager { display: flex; gap: 4px; justify-content: center; margin-top: 16px; }
.pager a { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-family: var(--mono); }
.pager a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.mini-list li:last-child { border-bottom: 0; }

/* ---------- لوحة التحكم ---------- */
.mode-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; border-inline-start: 4px solid var(--line-2); }
.mode-card.is-on { border-inline-start-color: #f59e0b; background: linear-gradient(90deg, #fff, #fffaf0); }
.mode-card h3 { font-size: 16px; margin: 2px 0 4px; }
.mode-txt { flex: 1; min-width: 260px; }
.kicker { font-size: 12.5px; color: var(--accent-2); font-weight: 700; }
.kicker:lang(en), .kicker.en { font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; }
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.job { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; border-inline-start: 4px solid var(--blue); }
.job:hover { text-decoration: none; box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.job.is-parts { border-inline-start-color: #f59e0b; }
.job.is-late { border-inline-start-color: var(--red); background: linear-gradient(180deg, #fff, #fff8f8); }
.job-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.job-car { font-size: 13px; color: var(--muted); }
.job-desc { font-size: 14px; color: var(--ink-2); min-height: 22px; }
.job-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: auto; }

/* ---------- أمر العمل ---------- */
.order-head { margin-bottom: 18px; }
.order-head.is-late { border-color: #f1b7b7; box-shadow: 0 0 0 3px rgba(200, 30, 30, .08); }
.oh-main { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.oh-title { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.oh-title h2 { font-size: 19px; }
.oh-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 13px; color: var(--muted); }
.oh-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.oh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 20px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.oh-grid dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.oh-grid dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; }
.complaint { margin-top: 14px; padding: 10px 14px; background: var(--surface-2); border-radius: 8px; border: 1px dashed var(--line-2); font-size: 14px; }
.oh-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.order-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.order-side { position: sticky; top: 80px; }
.dept-card { scroll-margin-top: 80px; }
.add-line { margin-top: 14px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 10px; }
.add-grid { display: grid; grid-template-columns: minmax(0, 1fr) 80px 120px auto; gap: 8px; }
.add-grid .stock-select { grid-column: 1 / -1; }
.dept-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; justify-content: flex-end; }
.pop { position: relative; }
.pop summary { list-style: none; }
.pop summary::-webkit-details-marker { display: none; }
.pop-body { position: absolute; bottom: calc(100% + 6px); inset-inline-end: 0; z-index: 10; display: flex; gap: 6px; padding: 10px; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-lg); width: 340px; }
.sum { margin: 0; }
.sum > div { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; }
.sum dt { color: var(--ink-2); }
.sum dd { margin: 0; font-family: var(--mono); font-weight: 600; }
.sum .grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; font-size: 18px; }
.sum .grand dt { font-weight: 700; color: var(--ink); }
.pay-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 3px 0; }
.panel-acc { border-top: 3px solid var(--violet); }
.panel-mgr { border-top: 3px solid #f59e0b; }
.pay-grid { display: flex; flex-direction: column; gap: 8px; }
.pay-in { display: flex; gap: 6px; }
.pay-in input { font-family: var(--mono); text-align: end; }
.pay-method { display: grid; grid-template-columns: 120px 1fr; gap: 6px; padding: 6px; border: 1.5px solid var(--line); border-radius: 10px; transition: border-color .15s, background .15s; }
.pay-method.on { border-color: var(--green); background: var(--green-soft); }
.pay-method .pm-ref { grid-column: 1 / -1; min-height: 36px; font-size: 13.5px; }
.pm-toggle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; border: 0; border-radius: 7px; background: var(--surface-2); cursor: pointer; font: inherit; padding: 4px; }
.pm-toggle:hover { background: #e9ebef; }
.pm-logo { font-weight: 700; font-size: 14px; }
.pm-toggle small { color: var(--muted); font-size: 11px; }
.pm-tamara .pm-logo { color: #c2410c; } .pm-tabby .pm-logo { color: #0b7a55; }
/* ملف العميل */
.veh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.veh-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.veh-card.on { border-color: var(--accent); background: var(--accent-soft); }
.veh-top { display: flex; gap: 10px; align-items: center; }
.veh-meta { display: flex; gap: 12px; font-size: 13px; color: var(--muted); }
.veh-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pop-wide { width: 420px; display: grid !important; grid-template-columns: 1fr 1fr; bottom: auto; top: calc(100% + 6px); }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.hist { border: 1px solid var(--line); border-radius: 10px; }
.hist.is-off { opacity: .6; }
.hist > summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.hist > summary::-webkit-details-marker { display: none; }
.hist[open] > summary { border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: 10px 10px 0 0; }
.hist-date { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.hist-title { flex: 1; min-width: 160px; font-weight: 600; font-size: 14px; }
.hist-total { font-family: var(--mono); }
.hist-body { padding: 12px 14px; }
.hist-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.hist-pays { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.hist-events { margin-top: 10px; }
.hist-events summary { cursor: pointer; font-size: 13px; color: var(--accent-2); font-weight: 600; }
.hist-events .timeline { margin-top: 10px; }
@media (max-width: 640px) { .pop-wide { width: auto; grid-template-columns: 1fr; } .hist-title { min-width: 100%; order: 5; } }
/* العروض */
.offer-list { display: flex; flex-direction: column; gap: 10px; }
.offer { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.offer.is-live { border-color: #f3c66b; background: linear-gradient(90deg, #fffaf0, #fff); }
.offer-val { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 72px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-family: var(--mono); font-weight: 700; font-size: 20px; border: 1.5px dashed #f3c66b; }
.offer-val small { font-family: var(--font); font-size: 11px; font-weight: 600; }
.offer-val.is-amount { font-size: 18px; line-height: 1.1; }
.offer-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.offer-meta { display: flex; gap: 6px 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.offer-stats { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.offer-acts { display: flex; flex-direction: column; gap: 6px; }
.offers-box { border-top: 3px solid #f59e0b; }
.offer-picks { display: flex; flex-direction: column; gap: 8px; }
.offer-pick { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.offer-pick.is-off { opacity: .6; }
.op-info { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.op-info small { font-size: 12.5px; }
.offer-applied { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 10px; border-radius: 10px; background: var(--green-soft); color: var(--green); }
.offer-applied > div { flex: 1; display: flex; flex-direction: column; }
.offer-applied small { color: var(--ink-2); }
@media (max-width: 640px) { .offer { grid-template-columns: 72px 1fr; } .offer-acts { grid-column: 1 / -1; flex-direction: row; } }
.vat-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vat-form input { width: 200px; min-height: 40px; }
.tabs-sep { width: 1px; background: var(--line-2); margin: 4px 6px; }
.big { font-size: 22px; }
.chip.pm-chip-tamara { background: #fff1e8; color: #c2410c; } .chip.pm-chip-tabby { background: #e6f7ef; color: #0b7a55; }
.bnpl-settle { margin-top: 18px; border-top: 3px solid var(--green); }
.pay-fill { font: inherit; font-size: 12.5px; font-weight: 600; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; white-space: nowrap; }
.pay-status { padding: 10px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); text-align: center; font-size: 14px; }
.pay-status.ok { background: var(--green-soft); color: var(--green); }
.pay-status.over { background: var(--red-soft); color: var(--red); }
.acc-block { border-top: 1px solid var(--line); padding: 10px 0 0; margin-top: 10px; }
.acc-block summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.acc-block[open] summary { margin-bottom: 8px; }
.cancel-box summary { cursor: pointer; font-weight: 600; }
.cancel-box[open] summary { margin-bottom: 10px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 22px 14px 0; border-inline-start: 0; }
.timeline li::before { content: ""; position: absolute; right: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); box-shadow: 0 0 0 3px #fff; }
.timeline li::after { content: ""; position: absolute; right: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .ev-closed::before, .timeline .ev-dept_done::before, .timeline .ev-delivered::before { background: var(--green); }
.timeline .ev-returned::before, .timeline .ev-cancelled::before, .timeline .ev-delayed::before { background: var(--red); }
.timeline .ev-waiting_parts::before, .timeline .ev-to_manager::before { background: #f59e0b; }
.timeline .ev-created::before { background: var(--accent); }
.tl-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.tl-top small { color: var(--muted); font-family: var(--mono); }
.timeline p { font-size: 13px; color: var(--ink-2); }

.history { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--blue-soft); border: 1px solid #cfdcfb; font-size: 14px; }
.history h4 { font-size: 14px; margin-bottom: 6px; }
.history ul { margin: 0; padding: 0 18px 0 0; }

.flow { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.flow-step { display: flex; flex-direction: column; padding: 8px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.flow-step small { font-weight: 400; color: var(--muted); font-size: 12px; }
.flow-step.on { border-color: var(--accent); background: var(--accent-soft); }
.flow-step.done { border-color: #bfe5cd; background: var(--green-soft); }
.flow-arrow { color: var(--muted); }

.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.report-card { display: flex; flex-direction: column; gap: 8px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.report-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow-lg); }
.report-card h3 { font-size: 16px; }
.report-card p { font-size: 13.5px; }
.veh { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.veh summary { cursor: pointer; font-weight: 600; }
.veh[open] summary { margin-bottom: 12px; }
.role-help { margin: 8px 0 0; padding: 0 18px 0 0; font-size: 13.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.copy-input { font-family: var(--mono); font-size: 12.5px; margin-bottom: 10px; }
.logo-prev { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 13px; }
.logo-prev img { height: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; }

/* ---------- القيود اليومية ---------- */
.tbl-journal tbody.je { border-bottom: 2px solid var(--line-2); }
.tbl-journal .je-head td { background: var(--surface-2); padding-top: 10px; padding-bottom: 8px; }
.tbl-journal .je-head td > * { margin-inline-end: 8px; }
.je-desc { display: inline; font-weight: 600; }
.tbl-journal .je-line td { border-bottom: 1px dashed var(--line); padding-top: 7px; padding-bottom: 7px; }
.tbl-journal tbody.je tr.je-line:last-child td { border-bottom: 0; }
.cr-acc { padding-inline-start: 34px !important; }
.is-reversed .je-line td { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(200, 30, 30, .4); }
.grp-head td { background: var(--surface-2); font-weight: 700; }
.je-tpl { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
#jeBal.ok { background: var(--green-soft); color: var(--green); }
#jeBal.bad { background: var(--red-soft); color: var(--red); }
@media (max-width: 640px) {
  .tbl-journal thead { display: none; }
  .tbl-journal .je-line { display: grid !important; grid-template-columns: 1fr auto auto; gap: 4px 10px; padding: 8px 14px !important; }
  .tbl-journal .je-line td { display: block !important; border: 0 !important; padding: 0 !important; }
  .tbl-journal .je-line td:first-child, .tbl-journal .je-line td:nth-child(3) { display: none !important; }
  .tbl-journal .je-line td::before { display: none; }
  .tbl-journal .je-line td.num:empty { display: none !important; }
  .tbl-journal .je-line td:nth-child(4)::before { display: inline; content: "مدين "; font-family: var(--font); color: var(--green); font-size: 12px; }
  .tbl-journal .je-line td:nth-child(5)::before { display: inline; content: "دائن "; font-family: var(--font); color: var(--violet); font-size: 12px; }
  .tbl-journal .je-head { display: block !important; padding: 0 !important; }
  .tbl-journal .je-head td { display: block !important; padding: 10px 14px !important; line-height: 1.9; }
  .tbl-journal .je-head td::before { display: none; }
  .je-desc { display: block; margin-top: 2px; }
  .tbl-journal tfoot tr { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--surface-2); }
  .tbl-journal tfoot td { display: block !important; padding: 0 !important; border: 0 !important; }
  .tbl-journal tfoot td:nth-child(2)::before { content: "مدين "; font-family: var(--font); font-size: 12px; color: var(--muted); }
  .tbl-journal tfoot td:nth-child(3)::before { content: "دائن "; font-family: var(--font); font-size: 12px; color: var(--muted); }
  .cr-acc { padding-inline-start: 18px !important; }
}

/* ---------- الخدمات (أيقونات المحاسب) وتحرير الفاتورة ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.svc-grid-sm { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); margin-bottom: 8px; }
.svc-grid form { display: contents; }
.svc { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-align: center; cursor: pointer; font: inherit; transition: border-color .15s, box-shadow .15s, transform .05s; width: 100%; }
.svc:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(232, 89, 12, .12); text-decoration: none; }
.svc:active { transform: scale(.97); }
.svc.on { border-color: var(--accent); background: var(--accent-soft); }
.svc.is-off { opacity: .5; }
.svc-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; }
.svc-ic .ic { width: 24px; height: 24px; }
.svc strong { font-size: 14px; line-height: 1.3; }
.svc-price { font-family: var(--mono); font-weight: 600; color: var(--ink-2); font-size: 13.5px; }
.svc-grid-sm .svc { padding: 10px 6px; }
.svc-grid-sm .svc-ic { width: 36px; height: 36px; }
.svc-grid-sm .svc-ic .ic { width: 20px; height: 20px; }
.icon-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.icon-pick label { cursor: pointer; }
.icon-pick input { position: absolute; opacity: 0; }
.icon-pick span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border: 1.5px solid var(--line); border-radius: 9px; color: var(--ink-2); }
.icon-pick span .ic { width: 22px; height: 22px; }
.icon-pick small { font-size: 10.5px; color: var(--muted); }
.icon-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.acc-edit { border-top: 3px solid var(--violet); }
.tbl-acc input { min-height: 36px; padding: 6px 8px; }
.tbl-acc td small { display: block; margin-top: 2px; }
.tbl-acc .a-qty { width: 70px; } .tbl-acc .a-price { width: 110px; }
.tbl-acc tr.is-del td { opacity: .45; text-decoration: line-through; }
.del-chk { cursor: pointer; }
.del-chk input { position: absolute; opacity: 0; }
.del-chk span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--red); font-size: 20px; }
.del-chk span:hover { background: var(--red-soft); }
.del-chk input:checked + span { background: var(--red); color: #fff; }
.acc-save { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0 16px; flex-wrap: wrap; }
#accDirty.dirty { color: var(--amber); font-weight: 600; }
.acc-sub { font-weight: 700; margin: 6px 0 10px; display: flex; align-items: center; gap: 6px; }
.acc-add { grid-template-columns: 140px 120px minmax(0, 1fr) 70px 100px auto; margin-top: 8px; }
.approve-step { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 6px; }
.approved-note { display: flex; align-items: center; gap: 6px; padding: 8px 12px; margin-bottom: 12px; background: var(--green-soft); color: var(--green); border-radius: 8px; font-weight: 600; font-size: 14px; }
@media (max-width: 640px) {
  .icon-pick { grid-template-columns: repeat(4, 1fr); }
  .acc-add { grid-template-columns: 1fr 1fr; }
  .acc-add input[name=description], .acc-add button { grid-column: 1 / -1; }
  .tbl-acc thead { display: none; }
  .tbl-acc tbody tr { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl-acc tbody td { padding: 0; border: 0; }
  .tbl-acc tbody td:nth-child(2) { grid-column: 2 / -1; }
  .tbl-acc .a-qty, .tbl-acc .a-price { width: 100%; }
}

/* ---------- القوائم المالية ---------- */
.stmt-tabs { margin-bottom: 16px; }
.stmt-wrap { display: flex; flex-direction: column; gap: 18px; }
.stmt { max-width: 860px; width: 100%; margin: 0 auto; padding: 28px 32px; }
.stmt-head { text-align: center; padding-bottom: 14px; margin-bottom: 8px; border-bottom: 2px solid var(--ink); }
.stmt-co { font-weight: 700; color: var(--muted); font-size: 13px; }
.stmt-head h3 { font-size: 20px; margin: 2px 0; }
.stmt-head .muted { font-size: 13px; }
.stmt-tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.stmt-tbl td { padding: 7px 4px; }
.stmt-tbl td.num { text-align: end; font-family: var(--mono); white-space: nowrap; width: 180px; }
.stmt-tbl .neg { color: var(--ink-2); }
.stmt-tbl .s-h td { padding-top: 18px; font-weight: 700; font-size: 15.5px; color: var(--accent-2); }
.stmt-tbl .s-sh td { padding-top: 10px; font-weight: 700; color: var(--ink-2); }
.stmt-tbl .s-row td:first-child { padding-inline-start: 18px; }
.stmt-tbl .s-sub td { font-weight: 600; border-top: 1px solid var(--line-2); }
.stmt-tbl .s-total td { font-weight: 700; border-top: 1px solid var(--ink); background: var(--surface-2); }
.stmt-tbl .s-grand td { font-weight: 700; font-size: 16.5px; border-top: 2px solid var(--ink); border-bottom: 4px double var(--ink); padding: 10px 4px; }
.stmt-note { margin-top: 14px; font-size: 13px; text-align: center; }
@media (max-width: 640px) { .stmt { padding: 18px 14px; } .stmt-tbl { font-size: 13.5px; } .stmt-tbl td.num { width: auto; } }
@media print { .stmt { break-after: page; box-shadow: none; border: 0; max-width: none; } }

/* ---------- التنبيهات ---------- */
.notif { position: relative; }
.badge { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; font-family: var(--mono); }
.notif-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); width: 380px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 60; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 440px; overflow-y: auto; }
.notif-item { display: block; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink); position: relative; padding-inline-start: 26px; }
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-item::before { content: ""; position: absolute; inset-inline-start: 11px; top: 17px; width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.notif-item.unread::before { background: var(--accent); }
.notif-item.k-delay::before { background: var(--red); }
.notif-item.k-delay:not(.unread)::before { background: #f3b3b3; }
.notif-item strong { display: block; font-size: 14px; }
.notif-item p { font-size: 13px; color: var(--ink-2); }
.notif-item small { color: var(--muted); }
.toast { position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 100; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 360px; animation: toast-in .25s ease-out; cursor: pointer; }
.toast.k-delay { background: var(--red); }
.toast strong { display: block; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

/* ---------- تسجيل الدخول والتثبيت ---------- */
body.auth { background: var(--ink); min-height: 100vh; }
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-side { position: relative; overflow: hidden; color: #fff; display: flex; align-items: flex-end; padding: 56px; }
.auth-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 60%, #000 30%, transparent 75%); }
.auth-side::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(232,89,12,.35), transparent 65%); top: -120px; left: -140px; }
.auth-copy { position: relative; z-index: 1; max-width: 520px; }
.auth-copy h1 { font-size: 40px; margin: 10px 0 12px; }
.auth-copy p { color: #b7bdc6; font-size: 17px; }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; }
/* اسم النظام: ظهور تدريجي من اليمين + لمعة تمر على الحروف + خط يرتسم تحته */
.auth-brand .auth-title {
  font-size: 38px; font-weight: 700; line-height: 1.3; margin: 0 0 -.12em; padding: .05em .05em .26em;
  background: linear-gradient(100deg, #ffffff 0%, #ffffff 42%, #ffc59a 50%, #ffffff 58%, #ffffff 100%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: titleReveal 1.3s cubic-bezier(.2,.75,.2,1) both, titleShine 5s ease-in-out 1.6s infinite;
}
@keyframes titleReveal { from { clip-path: inset(-20% -10% -40% 100%); opacity: .3; transform: translateY(10px); filter: blur(4px); } to { clip-path: inset(-20% -10% -40% -10%); opacity: 1; transform: none; filter: none; } }
@keyframes titleShine { 0% { background-position: 100% 0; } 45%, 100% { background-position: -60% 0; } }
.auth-line { display: block; height: 3px; width: 0; margin: 8px 0 10px; border-radius: 3px; background: linear-gradient(270deg, var(--accent), rgba(232,89,12,0)); box-shadow: 0 0 14px rgba(232,89,12,.55); animation: lineGrow 1s cubic-bezier(.2,.75,.2,1) .9s forwards; }
@keyframes lineGrow { to { width: 140px; } }
.auth-brand .auth-tag { opacity: 0; animation: fadeUp .8s ease 1.15s forwards; }
/* اسم الشركة: نفس حركة الاسم (ظهور من اليمين + لمعة) — اللمعة بعد لمعة الاسم بنصف دورة */
.auth-copy .auth-company {
  background: linear-gradient(100deg, #ffffff 0%, #ffffff 42%, #ffc59a 50%, #ffffff 58%, #ffffff 100%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .2em;
  animation: titleReveal 1.3s cubic-bezier(.2,.75,.2,1) 1.3s both, titleShine 5s ease-in-out 4.1s infinite;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .auth-brand .auth-title, .auth-line, .auth-brand .auth-tag, .auth-copy .auth-company { animation: none; opacity: 1; clip-path: none; } .auth-line { width: 140px; } }
.auth-copy .auth-tag { margin: 0; color: #f8b48a; font-size: 18px; font-weight: 600; }
.auth-copy .auth-company { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); color: #fff; font-size: 32px; font-weight: 700; line-height: 1.4; }
.auth-quote { margin: 30px 0 0; min-height: 96px; border-inline-start: 3px solid var(--accent); padding: 4px 18px 4px 0; opacity: 0; transform: translateY(6px); }
.auth-quote.on { animation: quoteIn .7s ease forwards; }
@keyframes quoteIn { to { opacity: 1; transform: none; } }
.auth-quote blockquote { margin: 0; font-size: 24px; line-height: 1.6; font-weight: 600; color: #fff; }
.auth-quote figcaption { margin-top: 6px; color: #9aa3ae; font-size: 14px; }
.auth-dots { display: flex; gap: 6px; margin-top: 14px; }
.auth-dots i { width: 7px; height: 7px; border-radius: 99px; background: rgba(255,255,255,.22); cursor: pointer; transition: width .3s, background .3s; }
.auth-dots i.on { width: 22px; background: var(--accent); }
.auth-foot { margin: 6px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .auth-quote, .auth-quote.on { animation: none; opacity: 1; transform: none; } }
.auth-flow { list-style: none; padding: 0; margin: 28px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.auth-flow li { padding: 8px 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; font-size: 14px; color: #dfe3e8; }
.auth-flow b { font-family: var(--mono); color: var(--accent); margin-inline-end: 6px; }
.auth-form { background: var(--bg); display: grid; place-items: center; padding: 32px; }
.auth-card { width: 100%; max-width: 400px; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h2 { font-size: 24px; }
.auth-logo { height: 56px; object-fit: contain; align-self: flex-start; }
.install { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.install .card { width: 100%; max-width: 560px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.install h4 { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; font-size: 13.5px; }
.checks .ok { color: var(--green); } .checks .bad { color: var(--red); font-weight: 700; }

/* ---------- الجوال ---------- */
@media (max-width: 1180px) {
  .order-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .grid-wide { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .icon-btn.only-m { display: inline-grid; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  body.side-open .side { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
  .top { padding: 10px 14px; }
  .content { padding: 16px 14px 80px; }
  .banner { padding: 10px 14px; }
  .order-layout, .grid-2, .form-layout { grid-template-columns: 1fr; }
  .order-side { position: static; }
  .fields-4 { grid-template-columns: 1fr 1fr; }
  .stats-3 { grid-template-columns: 1fr 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 32px 24px; min-height: 220px; }
  .auth-copy h1 { font-size: 28px; }
  .auth-flow { display: none; }
  .auth-brand .auth-title { font-size: 30px; }
  .auth-copy .auth-tag { font-size: 15px; }
  .auth-copy .auth-company { font-size: 24px; margin-top: 14px; }
  .auth-quote { margin-top: 18px; min-height: 72px; }
  .auth-quote blockquote { font-size: 18px; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .page-head h2 { font-size: 19px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat-v { font-size: 21px; }
  .stat-ic { display: none; }
  .fields, .fields-4, .fields-3, .choice-row { grid-template-columns: 1fr; }
  .fields-3 > .field { grid-column: auto !important; }
  .search, .search.wide { min-width: 0; width: 100%; max-width: none; }
  .add-grid { grid-template-columns: 1fr 1fr; }
  .add-grid .desc-input { grid-column: 1 / -1; }
  .add-grid button { grid-column: 1 / -1; }
  .add-grid:has(.cost-wrap:not([hidden])) { grid-template-columns: 1fr 1fr; }
  .pop-body { position: fixed; inset-inline: 12px; bottom: 12px; width: auto; }
  .dept-actions > * { flex: 1; }
  .dept-actions .btn, .dept-actions summary.btn { width: 100%; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 4px; }
  .tabs a { white-space: nowrap; }
  /* الجداول تتحول إلى بطاقات */
  .tbl:not(.tbl-edit):not(.tbl-compact) thead { display: none; }
  .tbl:not(.tbl-edit):not(.tbl-compact) tbody tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .tbl:not(.tbl-edit):not(.tbl-compact) tbody td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: start; }
  .tbl:not(.tbl-edit):not(.tbl-compact) tbody td[data-l]::before { content: attr(data-l); font-family: var(--font); color: var(--muted); font-size: 12.5px; font-weight: 600; flex: none; }
  .tbl:not(.tbl-edit):not(.tbl-compact) tbody td.num { text-align: end; }
  .tbl:not(.tbl-edit):not(.tbl-compact) tfoot td { display: table-cell; }
  .tbl tr.is-late td:first-child { box-shadow: none; }
  .tbl tr.is-late { box-shadow: inset -3px 0 0 var(--red); }
  .card:not(.flush) .tbl tbody tr { padding-inline: 0; }
  .order-head .plate-lg { font-size: 17px; }
}

/* ---------- الطباعة (التقارير) ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; font-size: 11px; }
  .side, .top, .banner, .noprint, .scrim, .toast, .alert { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
  .stat { padding: 8px 10px; box-shadow: none; border-color: #bbb; }
  .stat-ic { display: none; }
  .stat-v { font-size: 15px; }
  .tbl th, .tbl td { padding: 5px 6px; font-size: 10.5px; }
  .tbl th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page-head { margin-bottom: 10px; }
  a { color: inherit; }
}

/* ---- قطع الغيار ---- */
.parts-grid .job .mini-list { margin: 4px 0 0; }
.parts-grid .job details form { margin-top: 8px; }
.parts-box.is-pending { border-inline-start: 4px solid #f59e0b; }
.parts-box .mini-list li { align-items: flex-start; gap: 8px; }
.parts-box .mini-list li > span:last-child { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.parts-box .inline-form select { padding: 4px 6px; font-size: 13px; }
.parts-block { margin-bottom: 10px; }

/* ---- إرسال الفاتورة واتساب ---- */
.wa-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.wa-frame { width: 100%; height: 75vh; min-height: 520px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.wa-form .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; }
.wa-form textarea { font-size: 14px; line-height: 1.7; }
.wa-btn { background: #25d366; border-color: #25d366; color: #fff; }
.wa-btn:hover { background: #1ebe5a; }
@media (max-width: 960px) { .wa-layout { grid-template-columns: 1fr; } .wa-frame { height: 60vh; min-height: 380px; } }

/* ---- سندات القبض والصرف ---- */
.seg a { display: block; padding: 4px 11px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.seg a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.chips-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.chips-pick .chip { cursor: pointer; border: 1px solid var(--line-2); font: inherit; font-size: 12px; }
.voucher-receipt { border-top: 4px solid var(--green); }
.voucher-payment { border-top: 4px solid var(--red); }
.voucher-amount { font-size: 20px; font-weight: 700; }
tr.is-cancelled td { opacity: .55; text-decoration: line-through; }
tr.is-cancelled td:nth-child(2) { text-decoration: none; }

/* ---- المشتريات والمصروفات ---- */
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.exp-total { display: block; font-size: 22px; font-family: 'IBM Plex Mono', monospace; padding: 6px 0; }
.exp-purchase { border-top: 4px solid var(--blue); }
.exp-expense { border-top: 4px solid #f59e0b; }
.exp-form .check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.exp-attach { width: 100%; max-height: 560px; min-height: 360px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; }
.hbar { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.hbar span { display: block; height: 100%; border-radius: 6px; background: #f59e0b; }
.hbar span.hbar-purchase { background: var(--blue); }
@media (max-width: 720px) { .row-3 { grid-template-columns: 1fr; } }

/* ---------- الشريط المتحرك (يتحكم فيه المالك) ---------- */
.ticker { --tk-bg: var(--blue-soft, #e8f0fe); --tk-fg: var(--blue, #1d4ed8); --tk-strong: var(--blue, #1d4ed8);
  display: flex; align-items: stretch; overflow: hidden; background: var(--tk-bg); color: var(--tk-fg);
  border-bottom: 1px solid rgba(0,0,0,.06); min-height: 40px; font-weight: 600; font-size: 14.5px; }
.ticker.tk-green { --tk-bg: var(--green-soft); --tk-fg: #11652f; --tk-strong: var(--green); }
.ticker.tk-amber { --tk-bg: #fff4e0; --tk-fg: #8a4b00; --tk-strong: #d97706; }
.ticker.tk-red { --tk-bg: var(--red-soft); --tk-fg: #8f1414; --tk-strong: var(--red); }
.ticker.tk-dark { --tk-bg: #14171c; --tk-fg: #f3f4f6; --tk-strong: #ea580c; }
.tk-label { flex: none; display: flex; align-items: center; gap: 6px; padding: 0 16px; background: var(--tk-strong); color: #fff; font-weight: 700; z-index: 1; }
.tk-label .ic { width: 16px; height: 16px; }
.tk-view { position: relative; flex: 1; overflow: hidden; display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
          mask-image: linear-gradient(to left, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); }
.tk-track { display: flex; width: max-content; white-space: nowrap; will-change: transform; animation: tk-move var(--tk-dur, 30s) linear infinite; }
.tk-run { display: flex; align-items: center; }
.tk-item { padding: 0 6px; }
.tk-sep { padding: 0 18px; opacity: .45; font-size: 10px; }
.ticker:hover .tk-track, .ticker:focus-within .tk-track { animation-play-state: paused; }
@keyframes tk-move { from { transform: translateX(0); } to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) {
  .tk-track { animation: none; }
  .tk-view { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}
@media print { .ticker { display: none !important; } }
.tk-tones { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-tone { cursor: pointer; }
.tk-tone input { position: absolute; opacity: 0; }
.tk-tone span { display: inline-block; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 2px solid transparent; background: var(--tk-bg); color: var(--tk-fg); }
.tk-tone.tk-blue { --tk-bg: var(--blue-soft, #e8f0fe); --tk-fg: var(--blue, #1d4ed8); }
.tk-tone.tk-green { --tk-bg: var(--green-soft); --tk-fg: #11652f; }
.tk-tone.tk-amber { --tk-bg: #fff4e0; --tk-fg: #8a4b00; }
.tk-tone.tk-red { --tk-bg: var(--red-soft); --tk-fg: #8f1414; }
.tk-tone.tk-dark { --tk-bg: #14171c; --tk-fg: #f3f4f6; }
.tk-tone input:checked + span { border-color: currentColor; box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.tk-tone input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
#tkPreview .ticker { border-radius: 10px; border: 1px solid rgba(0,0,0,.08); }
