/* ORDER-APPROVAL-1 — «دورة اعتماد الطلب» (approved design v1, Kamal 18-10-2026) on the
   house system: every colour is a shared --lm-d-* token (0 hex), type ≥ 12px,
   logical properties only (RTL/LTR). Scoped by .oa. */

body:has(.oa) { background: var(--lm-d-page); }
body:has(.oa) .fi-main-ctn { background: transparent; }

.oa { display: flex; flex-direction: column; gap: 12px; color: var(--lm-d-ink); }
.oa * { box-sizing: border-box; }
.oa bdi { unicode-bidi: isolate; }
.oa .oa-num { font-variant-numeric: tabular-nums; }

/* the two halves above the steps */
.oa-ph { display: grid; grid-template-columns: 2fr 5fr; gap: 4px; margin-block-end: -8px; }
.oa-ph span { font-size: 12px; font-weight: 700; color: var(--lm-d-muted); padding: 3px 12px; border-block-end: 2px solid var(--lm-d-border); }
.oa-ph span.is-on { color: var(--lm-d-accent-ink); border-color: var(--lm-d-accent); }
.oa-ph span.is-ok { color: var(--lm-d-ok); border-color: var(--lm-d-ok); }

/* the six stages */
.oa-steps { display: grid; grid-template-columns: repeat(7, 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; }
.oa-st { display: flex; align-items: center; gap: 8px; min-width: 0; }
.oa-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); }
.oa-st i svg { inline-size: 15px; block-size: 15px; }
.oa-st div { min-width: 0; }
.oa-st b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oa-st small { display: block; font-size: 12px; color: var(--lm-d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oa-st.is-done i { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.oa-st.is-now i { background: var(--lm-d-accent); color: var(--lm-d-on-accent); }
.oa-st.is-now b { color: var(--lm-d-accent-ink); }
.oa-st.is-back i { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.oa-st.is-back b { color: var(--lm-d-warn); }
.oa-st.is-todo b { color: var(--lm-d-muted); }

/* layout */
.oa-2 { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 12px; align-items: start; }
.oa-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.oa-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; }
.oa-ch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-block-end: 1px solid var(--lm-d-divider); }
.oa-ch h3 { margin: 0; font-size: 16px; font-weight: 700; }
.oa-ch svg { inline-size: 18px; block-size: 18px; color: var(--lm-d-info); }
.oa-ch .oa-end { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.oa-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 10px 16px; border-block-end: 1px solid var(--lm-d-divider); background: var(--lm-d-page); font-size: 13.5px; color: var(--lm-d-muted); }
.oa-meta b { color: var(--lm-d-ink); }

/* the document and its figures */
.oa-doc { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 14px 16px; }
.oa-pdf { border: 1px solid var(--lm-d-border); border-radius: 10px; background: var(--lm-d-page); aspect-ratio: 1 / 1.414; display: flex; flex-direction: column; gap: 6px; padding: 12px 10px; position: relative; text-decoration: none; }
.oa-pdf i { display: block; block-size: 6px; border-radius: 3px; background: var(--lm-d-handle); }
.oa-pdf i.is-h { block-size: 10px; inline-size: 60%; background: var(--lm-d-ink); opacity: .7; }
.oa-pdf i.is-s { inline-size: 70%; }
.oa-pdf i.is-t { block-size: 34px; background: var(--lm-d-quiet-bg); }
.oa-pdf em { position: absolute; inset-block-end: 8px; inset-inline: 8px; font-style: normal; font-size: 12px; font-weight: 700; text-align: center; color: var(--lm-d-info); background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-radius: 8px; padding: 4px; }
.oa-pdf.is-none em { color: var(--lm-d-muted); }
.oa-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.oa-fig { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--lm-d-border); border-radius: 12px; overflow: hidden; }
.oa-fig > div { padding: 9px 12px; border-inline-start: 1px solid var(--lm-d-divider); border-block-end: 1px solid var(--lm-d-divider); min-width: 0; }
.oa-fig > div:nth-child(3n + 1) { border-inline-start: 0; }
.oa-fig small { display: block; font-size: 12.5px; color: var(--lm-d-muted); }
.oa-fig b { font-size: 17px; font-variant-numeric: tabular-nums; }
.oa-fig b.is-ac { color: var(--lm-d-accent-ink); }
.oa-file { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--lm-d-muted); flex-wrap: wrap; }
.oa-file a, .oa-file b { color: var(--lm-d-ink); font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.oa-file a { color: var(--lm-d-info); }
.oa-file svg { inline-size: 16px; block-size: 16px; color: var(--lm-d-danger); }
.oa-check { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--lm-d-border); border-radius: 12px; padding: 10px 12px; }
.oa-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--lm-d-muted); }
.oa-kv b { color: var(--lm-d-ink); font-variant-numeric: tabular-nums; }
.oa-kv b.is-ok { color: var(--lm-d-ok); }
.oa-kv b.is-bad { color: var(--lm-d-danger); }

/* notes */
.oa-note { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.6; background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.oa-note svg { inline-size: 16px; block-size: 16px; flex: none; margin-block-start: 2px; }
.oa-note.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.oa-note.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.oa-note b { color: inherit; }

/* tags */
.oa-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.oa-tag::before { content: ''; inline-size: 7px; block-size: 7px; border-radius: 50%; background: currentColor; }
.oa-tag.is-ac { background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); }
.oa-tag.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.oa-tag.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.oa-tag.is-bad { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.oa-tag.is-q { background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }

/* «دورك دلوقتي» */
.oa-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: 10px; }
.oa-box h4 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.oa-box h4 svg { inline-size: 16px; block-size: 16px; color: var(--lm-d-info); }
.oa-box.is-turn { border: 1.5px solid var(--lm-d-accent-line); background: var(--lm-d-row-hl); }
.oa-box.is-turn h4 svg { color: var(--lm-d-accent-ink); }
.oa-who { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.oa-who .oa-av { inline-size: 30px; block-size: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); font-weight: 700; font-size: 13px; flex: none; }
.oa-who small { display: block; color: var(--lm-d-muted); font-size: 12.5px; }
.oa-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.oa-acts > * { min-width: 0; }
.oa-acts .fi-btn { inline-size: 100%; justify-content: center; min-block-size: 40px; border-radius: 12px; font-weight: 700; }
.oa-acts .oa-main-btn, .oa-acts .oa-wide { grid-column: 1 / -1; }
.oa-acts .oa-main-btn.fi-btn { min-block-size: 46px; font-size: 15px; background: var(--lm-d-accent); color: var(--lm-d-on-accent); box-shadow: 0 4px 12px var(--lm-d-accent-soft); }
.oa-acts .oa-main-btn.fi-btn .fi-icon { color: var(--lm-d-on-accent); }
.oa-link-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-block-size: 46px; border-radius: 12px; font-weight: 700; font-size: 15px; background: var(--lm-d-accent); color: var(--lm-d-on-accent); text-decoration: none; }
.oa-link-btn svg { inline-size: 17px; block-size: 17px; }
.oa-link-btn.is-quiet { min-block-size: 40px; font-size: 14px; background: var(--lm-d-surface); color: var(--lm-d-ink); box-shadow: inset 0 0 0 1px var(--lm-d-control-edge); }
.oa-task { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--lm-d-muted); background: var(--lm-d-page); border-radius: 10px; padding: 7px 10px; }
.oa-task b { color: var(--lm-d-info); white-space: nowrap; }
.oa-task svg { inline-size: 15px; block-size: 15px; color: var(--lm-d-info); flex: none; }
.oa-people { display: flex; flex-wrap: wrap; gap: 6px; }
.oa-people span { font-size: 12.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--lm-d-chip-bg); }
.oa-late { color: var(--lm-d-danger); font-weight: 700; }

/* history */
.oa-tl { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.oa-tl > li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding-block-end: 10px; position: relative; }
.oa-tl > li::before { content: ''; position: absolute; inset-inline-start: 10px; inset-block: 20px 0; border-inline-start: 2px solid var(--lm-d-divider); }
.oa-tl > li:last-child::before { display: none; }
.oa-tl i { inline-size: 22px; block-size: 22px; border-radius: 50%; background: var(--lm-d-ok-soft); color: var(--lm-d-ok); display: grid; place-items: center; }
.oa-tl i svg { inline-size: 13px; block-size: 13px; }
.oa-tl i.is-now { background: var(--lm-d-accent); color: var(--lm-d-on-accent); }
.oa-tl i.is-back { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.oa-tl i.is-note { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.oa-tl b { font-size: 13.5px; display: block; }
.oa-tl small { font-size: 12.5px; color: var(--lm-d-muted); display: block; line-height: 1.5; }
.oa-tl small b { display: inline; font-size: 12.5px; color: var(--lm-d-ink); }
.oa-tl q { display: block; font-size: 12.5px; color: var(--lm-d-ink); background: var(--lm-d-page); border-radius: 8px; padding: 4px 8px; margin-block-start: 3px; quotes: none; }
.oa-tl a { color: var(--lm-d-info); font-size: 12.5px; }

/* the orders list: the cycle column */
.oa-cell { display: flex; flex-direction: column; gap: 2px; }
.oa-cell small { font-size: 12px; color: var(--lm-d-muted); }
.oa-cell small.is-late { color: var(--lm-d-danger); font-weight: 700; }

/* the order page: a link to the cycle in the task panel of «المهام» */
.oa-task-link { display: flex; align-items: center; justify-content: center; gap: 8px; min-block-size: 44px; border-radius: 12px; font-weight: 700; font-size: 14px; background: var(--lm-d-accent); color: var(--lm-d-on-accent); text-decoration: none; }
.oa-task-link svg { inline-size: 16px; block-size: 16px; }
.oa-task-hint { font-size: 12.5px; color: var(--lm-d-muted); line-height: 1.6; }

@media (max-width: 1180px) {
    .oa-2 { grid-template-columns: minmax(0, 1fr); }
    .oa-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 10px; }
    .oa-ph { display: none; }
}
@media (max-width: 700px) {
    .oa-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .oa-doc { grid-template-columns: minmax(0, 1fr); }
    .oa-pdf { display: none; }
    .oa-fig { grid-template-columns: 1fr 1fr; }
    .oa-fig > div { border-inline-start: 0; }
    .oa-fig > div:nth-child(2n) { border-inline-start: 1px solid var(--lm-d-divider); }
    .oa-fig b { font-size: 15px; }
}
.oa-task-panel { display: flex; flex-direction: column; gap: 6px; margin-block: 10px; }
.oa-task-hint { margin: 0; }

/* TSK-0696 S11 — the reviewer's «الخلاصة» inside a request-review task's panel (the same box as «عرض الطلب»'s). */
.tq-rr-ai { background: var(--lm-d-ai-bg); border: 1px solid var(--lm-d-border); border-inline-start: 3px solid var(--lm-d-ai); border-radius: 12px; padding: 12px 14px; }
.tq-rr-ai-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin-block-end: 6px; font-size: 13px; font-weight: 700; color: var(--lm-d-ai); }
.tq-rr-ai-h small { font-size: 12px; font-weight: 500; color: var(--lm-d-muted); }
.tq-rr-ai ul { margin: 0; padding-inline-start: 18px; list-style: disc; color: var(--lm-d-ai-ink); font-size: 13.5px; line-height: 1.8; }
.tq-rr-ai li::marker { color: var(--lm-d-ai); }

/* ORDER-DOWNPAY-GRACE-1 — the down payment's grace card (approved design 19-11-2026): no icons, tokens only */
.oa-g { background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-block-start: 3px solid var(--lm-d-warn); border-radius: 16px; overflow: hidden; }
.oa-g.is-late { border-block-start-color: var(--lm-d-danger); }
.oa-g.is-ok { border-block-start-color: var(--lm-d-ok); }
.oa-g.is-info { border-block-start-color: var(--lm-d-info); }
.oa-g-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-block-end: 1px solid var(--lm-d-divider); }
.oa-g-h h3 { margin: 0; font-size: 16px; font-weight: 700; }
.oa-g-h h3 small { font-size: 12.5px; font-weight: 400; color: var(--lm-d-muted); margin-inline-start: 8px; }
.oa-g-pill { font-size: 14px; font-weight: 700; padding: 3px 12px; border-radius: 999px; white-space: nowrap; background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.oa-g-pill.is-late { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.oa-g-pill.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.oa-g-pill.is-info { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.oa-g-b { padding: 12px 16px; display: flex; flex-direction: column; gap: 12px; }
.oa-g-days { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.oa-g-days li { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--lm-d-muted); text-align: center; min-width: 0; }
.oa-g-days li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oa-g-days em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--lm-d-info); min-block-size: 16px; }
.oa-g-days i { display: block; block-size: 10px; border-radius: 5px; background: var(--lm-d-quiet-bg); }
.oa-g-days li.is-past i { background: var(--lm-d-warn); }
.oa-g-days li.is-today i { background: var(--lm-d-accent); box-shadow: 0 0 0 2px var(--lm-d-surface), 0 0 0 4px var(--lm-d-accent-line); }
.oa-g-days li.is-today { color: var(--lm-d-ink); font-weight: 700; }
.oa-g-days li.is-ext i { background: var(--lm-d-info-soft); border: 1px dashed var(--lm-d-info); }
.oa-g-days li.is-ext.is-past i, .oa-g-days li.is-ext.is-today i { background: var(--lm-d-info); border-style: solid; }
.oa-g-fig { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--lm-d-border); border-radius: 12px; overflow: hidden; }
.oa-g-fig > div { padding: 8px 14px; border-inline-start: 1px solid var(--lm-d-divider); }
.oa-g-fig > div:first-child { border-inline-start: 0; }
.oa-g-fig small { display: block; font-size: 12.5px; color: var(--lm-d-muted); }
.oa-g-fig b { font-size: 17px; font-variant-numeric: tabular-nums; }
.oa-g-fig b.is-info { color: var(--lm-d-info); }
.oa-g-fig b.is-warn { color: var(--lm-d-warn); }
.oa-g-fig b.is-bad { color: var(--lm-d-danger); }
.oa-g-fig b.is-ok { color: var(--lm-d-ok); }
.oa-g-fig b.is-q { color: var(--lm-d-muted); }
.oa-g-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.oa-g-box { border: 1px solid var(--lm-d-border); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.oa-g-box.is-turn { border: 1.5px solid var(--lm-d-accent-line); background: var(--lm-d-row-hl); }
.oa-g-box h4 { margin: 0; font-size: 14px; font-weight: 700; }
.oa-g-box h4 small { font-weight: 400; color: var(--lm-d-muted); font-size: 12.5px; margin-inline-start: 6px; }
.oa-g-box p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--lm-d-muted); }
.oa-g-box p b { color: var(--lm-d-ink); }
.oa-g-hint { font-size: 12.5px !important; }
.oa-g-msgs { list-style: none; margin: 0; padding: 0; }
.oa-g-msgs li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-block-end: 1px solid var(--lm-d-divider); font-size: 13.5px; }
.oa-g-msgs li:last-child { border-block-end: 0; }
.oa-g-msgs small { display: block; color: var(--lm-d-muted); font-size: 12.5px; }
.oa-g-apv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.oa-g-apv li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--lm-d-border); border-radius: 12px; font-size: 13.5px; }
.oa-g-apv li > i { inline-size: 26px; block-size: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 12.5px; background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }
.oa-g-apv li.is-done > i { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.oa-g-apv li.is-now { border: 1.5px solid var(--lm-d-accent); background: var(--lm-d-row-hl); }
.oa-g-apv li.is-now > i { background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); }
.oa-g-apv small { display: block; color: var(--lm-d-muted); font-size: 12.5px; }
@media (max-width: 760px) {
    .oa-g-fig { grid-template-columns: 1fr 1fr; }
    .oa-g-fig > div { border-inline-start: 0; border-block-end: 1px solid var(--lm-d-divider); }
    .oa-g-fig > div:nth-child(2n) { border-inline-start: 1px solid var(--lm-d-divider); }
    .oa-g-2 { grid-template-columns: 1fr; }
    .oa-g-days li span { font-size: 12px; }
}
