/* SUPPLIES-REQ-1 — «طلب خامات شهرية» on the house system: every colour is a
   shared --lm-d-* token (0 hex), type ≥ 12px, logical properties (RTL/LTR). */

.sp { display: flex; flex-direction: column; gap: 12px; color: var(--lm-d-ink); }
.sp * { box-sizing: border-box; }

/* the six steps */
.sp-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 10px 12px; list-style: none; background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-radius: 14px; }
.sp-st { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sp-st i { inline-size: 28px; block-size: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-style: normal; background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }
.sp-st i svg { inline-size: 15px; block-size: 15px; }
.sp-st div { min-width: 0; }
.sp-st b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-st small { display: block; font-size: 12px; color: var(--lm-d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-st.is-done i { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.sp-st.is-now i { background: var(--lm-d-accent); color: var(--lm-d-on-accent); }
.sp-st.is-now b { color: var(--lm-d-accent-ink); }
.sp-st.is-stop i { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.sp-st.is-todo b { color: var(--lm-d-muted); }

/* layout */
.sp-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
/* the default list is wide (a column per branch): its side boxes sit in a row under it */
.sp-2.is-stack { grid-template-columns: minmax(0, 1fr); }
.sp-2.is-stack .sp-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; }
.sp-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sp-card { background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-block-start: 3px solid var(--lm-d-info); border-radius: 16px; overflow: hidden; min-width: 0; }
.sp-ch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-block-end: 1px solid var(--lm-d-divider); }
.sp-ch h3 { margin: 0; font-size: 16px; font-weight: 700; }
.sp-meta-i { font-size: 13px; color: var(--lm-d-muted); }
.sp-ch .sp-tag { margin-inline-start: auto; }
.sp-scroll { overflow-x: auto; }

/* tables */
.sp-t { inline-size: 100%; border-collapse: collapse; font-size: 14px; }
.sp-t th { background: var(--lm-d-page); color: var(--lm-d-muted); font-size: 12.5px; font-weight: 700; text-align: start; padding: 7px 10px; border-block-end: 1px solid var(--lm-d-divider); white-space: nowrap; }
.sp-t td { padding: 4px 10px; border-block-end: 1px solid var(--lm-d-divider); vertical-align: middle; block-size: 42px; }
.sp-t td b { font-weight: 700; }
.sp-t .sp-c { text-align: center; }
.sp-t .sp-n { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-t .sp-no { color: var(--lm-d-subtle); inline-size: 34px; font-variant-numeric: tabular-nums; }
.sp-t .sp-name { inline-size: 24%; }
.sp-t .sp-tq { font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-t tr.is-chg td { background: var(--lm-d-row-hl); }
.sp-t tr.is-off td b { text-decoration: line-through; color: var(--lm-d-subtle); }
.sp-t.is-list td { block-size: 46px; }
.sp-hint { display: block; font-size: 12px; color: var(--lm-d-muted); line-height: 1.35; }
.sp-hint.is-up { color: var(--lm-d-danger); }
.sp-hint.is-ok { color: var(--lm-d-ok); }
.sp-c .sp-hint { text-align: center; }
.sp-muted { color: var(--lm-d-muted); font-size: 13px; }
.sp-was { color: var(--lm-d-muted); font-size: 12.5px; margin-inline-end: 6px; }
.is-ac { color: var(--lm-d-accent-ink); }
.sp-link { color: var(--lm-d-info); }

/* branch heads */
.sp-bh { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.sp-bh.is-info { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.sp-bh.is-accent { background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); }
.sp-bh.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }

/* +/− stepper */
.sp-step { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--lm-d-control-edge); border-radius: 10px; background: var(--lm-d-surface); }
.sp-step button { inline-size: 28px; block-size: 28px; border: 0; border-radius: 8px; background: var(--lm-d-page); color: var(--lm-d-muted); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.sp-step button:hover { background: var(--lm-d-hover); color: var(--lm-d-ink); }
.sp-step input { inline-size: 46px; block-size: 28px; border: 0; background: transparent; color: var(--lm-d-ink); text-align: center; font: inherit; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 0; }
.sp-step input:focus { outline: 2px solid var(--lm-d-info); outline-offset: 1px; border-radius: 6px; }
.sp-step.is-ed, .sp-step.is-up { border-color: var(--lm-d-accent); box-shadow: 0 0 0 3px var(--lm-d-accent-soft); }
.sp-step.is-zero input { color: var(--lm-d-subtle); }

/* inputs */
.sp-in, .sp-in-num, .sp-sel, .sp-add-f input { min-block-size: 34px; border: 1px solid var(--lm-d-control-edge); border-radius: 8px; background: var(--lm-d-surface); color: var(--lm-d-ink); font: inherit; font-size: 14px; padding: 0 10px; }
.sp-in { inline-size: 100%; min-inline-size: 130px; }
.sp-in.is-short { inline-size: 90px; min-inline-size: 90px; }
.sp-in-num { inline-size: 96px; text-align: end; font-variant-numeric: tabular-nums; }
.sp-in-num.is-ed { border-color: var(--lm-d-accent); box-shadow: 0 0 0 3px var(--lm-d-accent-soft); }
.sp-sel { inline-size: 100%; min-block-size: 40px; }
.sp-f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--lm-d-muted); font-weight: 600; }
.sp-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* buttons */
.sp-b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-block-size: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--lm-d-control-edge); background: var(--lm-d-surface); color: var(--lm-d-ink); font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; text-decoration: none; }
.sp-b:hover { background: var(--lm-d-hover); }
.sp-b svg { inline-size: 17px; block-size: 17px; }
.sp-b.is-p { background: var(--lm-d-accent); border-color: var(--lm-d-accent); color: var(--lm-d-on-accent); }
.sp-b.is-p:hover { filter: brightness(0.96); }
.sp-b.is-i { color: var(--lm-d-info); }
.sp-b.is-sm { min-block-size: 32px; font-size: 13px; padding: 0 12px; }
.sp-ico { display: inline-grid; place-items: center; inline-size: 30px; block-size: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--lm-d-subtle); cursor: pointer; }
.sp-ico:hover { background: var(--lm-d-hover); color: var(--lm-d-ink); }
.sp-ico svg { inline-size: 16px; block-size: 16px; }
.sp-move { white-space: nowrap; inline-size: 70px; }

/* bars under the table */
.sp-add { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 9px 14px; background: var(--lm-d-page); border-block-end: 1px solid var(--lm-d-divider); }
.sp-add-f { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sp-add-f input { min-inline-size: 240px; }
.sp-tot-i { margin-inline-start: auto; font-size: 13.5px; color: var(--lm-d-muted); }
.sp-tot-i b { font-size: 17px; font-variant-numeric: tabular-nums; margin-inline-start: 4px; }
.sp-tot { justify-content: flex-end; font-size: 13.5px; color: var(--lm-d-muted); gap: 18px; }
.sp-tot b { font-size: 18px; color: var(--lm-d-ink); font-variant-numeric: tabular-nums; margin-inline-start: 4px; }
.sp-tot b.is-ac { color: var(--lm-d-accent-ink); }
.sp-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--lm-d-page); }
.sp-line { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--lm-d-muted); min-width: 0; }
.sp-line svg { inline-size: 16px; block-size: 16px; flex: none; }
.sp-end { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* suggestion chips */
.sp-sugs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 16px; border-block-end: 1px solid var(--lm-d-divider); }
.sp-sugs-t { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; margin-inline-end: 6px; }
.sp-sugs-t svg { inline-size: 16px; block-size: 16px; color: var(--lm-d-info); }
.sp-sug { display: inline-flex; align-items: center; gap: 6px; min-block-size: 32px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--lm-d-control-edge); background: transparent; color: var(--lm-d-info); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.sp-sug svg { inline-size: 14px; block-size: 14px; }
.sp-sug small { font-size: 12px; color: var(--lm-d-muted); font-weight: 500; }

/* tags, tabs, notes */
.sp-tag { display: inline-flex; align-items: center; gap: 6px; min-block-size: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.sp-tag.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.sp-tag.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.sp-tag.is-danger { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.sp-tag.is-accent { background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); }
.sp-tag.is-quiet { background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }
.sp-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px 0; }
.sp-ch .sp-tabs { padding: 0; }
.sp-tab { display: inline-flex; align-items: center; gap: 6px; min-block-size: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--lm-d-border); background: var(--lm-d-surface); color: var(--lm-d-ink); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.sp-tab small { font-size: 12px; color: var(--lm-d-muted); }
.sp-tab small.is-ok { color: var(--lm-d-ok); }
.sp-tab small.is-warn { color: var(--lm-d-warn); }
.sp-tab.is-on { background: var(--lm-d-tab-on-bg); border-color: var(--lm-d-tab-on-bg); color: var(--lm-d-tab-on-ink); }
.sp-tab.is-on small { color: var(--lm-d-tab-on-count); }
.sp-note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.6; background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.sp-note svg { inline-size: 17px; block-size: 17px; flex: none; margin-block-start: 2px; }
.sp-note.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.sp-note.is-danger { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.sp-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 16px; text-align: center; color: var(--lm-d-muted); font-size: 14px; }
.sp-empty svg { inline-size: 32px; block-size: 32px; color: var(--lm-d-subtle); }
.sp-empty b { color: var(--lm-d-ink); font-size: 15px; }

/* side boxes */
.sp-box { background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.sp-box h4 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.sp-box h4 svg { inline-size: 16px; block-size: 16px; color: var(--lm-d-info); }
.sp-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--lm-d-muted); }
.sp-kv b { color: var(--lm-d-ink); font-variant-numeric: tabular-nums; }
.sp-kv b.is-ac { color: var(--lm-d-accent-ink); }
.sp-kv.is-big b { font-size: 20px; }
.sp-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sp-act > .sp-b.is-p { grid-column: 1 / -1; min-block-size: 46px; font-size: 15px; }
.sp-sg { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-block: 6px; border-block-end: 1px dashed var(--lm-d-divider); font-size: 13.5px; color: var(--lm-d-muted); }
.sp-sg:last-child { border-block-end: 0; }
.sp-bars { display: flex; flex-direction: column; gap: 6px; }
.sp-bar { display: grid; grid-template-columns: 80px minmax(0, 1fr) 72px; gap: 8px; align-items: center; font-size: 13px; }
.sp-bar b { text-align: end; font-variant-numeric: tabular-nums; }
.sp-track { block-size: 8px; border-radius: 999px; background: var(--lm-d-quiet-bg); overflow: hidden; }
.sp-track i { display: block; block-size: 100%; border-radius: 999px; background: var(--lm-d-info); }
.sp-track i.is-accent { background: var(--lm-d-accent); }
.sp-track i.is-ok { background: var(--lm-d-ok); }
.sp-tl { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.sp-tl li { padding-inline-start: 12px; border-inline-start: 2px solid var(--lm-d-ok); }
.sp-tl li.is-warn { border-color: var(--lm-d-warn); }
.sp-tl li.is-danger { border-color: var(--lm-d-danger); }
.sp-tl li.is-now { border-color: var(--lm-d-accent); }
.sp-tl b { display: block; font-size: 13.5px; }
.sp-tl small { display: block; font-size: 12.5px; color: var(--lm-d-muted); line-height: 1.5; }

/* outgoing desk additions */
.sp-desk-sub { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-block-start: 4px; padding: 3px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 700; background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); }
.sp-desk-chip { display: inline-flex; align-items: center; gap: 5px; margin-inline-start: 6px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); }

@media (max-width: 1180px) {
    .sp-2 { grid-template-columns: minmax(0, 1fr); }
    .sp-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 10px; }
}
@media (max-width: 640px) {
    .sp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sp-foot { position: sticky; inset-block-end: 0; }
    .sp-end { inline-size: 100%; }
    .sp-end .sp-b.is-p { flex: 1; }
    .sp-add-f input { min-inline-size: 0; flex: 1; }
}
.sp-desk-sub svg { inline-size: 14px; block-size: 14px; }
