/* Requests engine — the board, cards, side panel and dialogs (js/requests). Names use .rq-*; buttons, inputs and
   dialogs come from the Inventory screen (.inv-*) and the app's tokens; logical properties so Arabic flips. */
.rq-app { display: flex; flex-direction: column; height: calc(100vh - 64px); color: var(--text); font-family: var(--font-ui, system-ui, sans-serif); position: relative; }
.rq-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface-1); }
.rq-bar .inv-input { min-height: 34px; }
.rq-search { flex: 1 1 200px; max-width: 360px; }
.rq-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rq-filters select { max-width: 180px; }
.rq-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.rq-body { flex: 1; min-height: 0; display: flex; }
.rq-board { flex: 1; min-width: 0; display: flex; gap: 12px; padding: 12px 14px; overflow-x: auto; overflow-y: hidden; align-items: flex-start; scroll-padding-inline: 14px; }
.rq-col { flex: 0 0 290px; display: flex; flex-direction: column; max-height: 100%; border-radius: 14px; background: var(--surface-2, var(--raised)); border: 1px solid var(--border); }
.rq-col-end { border-style: dashed; }
.rq-col.is-drop-target { outline: 2px solid var(--accent); outline-offset: -2px; }
.rq-col-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px; }
.rq-col-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, #888); flex: none; }
.rq-col-name { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq-col-count { font-size: 12px; color: var(--muted); background: var(--surface-1); border-radius: 999px; padding: 1px 8px; }
.rq-col-end-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; }
.rq-cards { flex: 1; min-height: 60px; overflow-y: auto; padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; scroll-padding: 8px; }
.rq-card { position: relative; border-radius: 12px; background: var(--surface-1); border: 1px solid var(--border); padding: 10px 12px 10px; cursor: grab; touch-action: pan-y; user-select: none; box-shadow: var(--shadow-sm, 0 1px 2px rgb(0 0 0 / .15)); }
.rq-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rq-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.rq-card.is-drag-source { opacity: .35; }
.rq-card.is-lifted { outline: 2px dashed var(--accent); outline-offset: 2px; }
.rq-card.is-pending { opacity: .7; }
.rq-card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.rq-number { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.rq-new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.rq-age { margin-inline-start: auto; font-size: 11.5px; color: var(--muted); }
.rq-card-title { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rq-card-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.rq-chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; background: color-mix(in srgb, var(--c, #888) 22%, transparent); color: var(--text); }
.rq-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, #888); }
.rq-card-menu { position: absolute; inset-inline-end: 6px; top: 6px; opacity: 0; }
.rq-card:hover .rq-card-menu, .rq-card:focus-within .rq-card-menu, .rq-card-menu[aria-expanded="true"] { opacity: 1; }
.rq-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; opacity: .95; box-shadow: var(--shadow-md, 0 12px 30px rgb(0 0 0 / .35)); }
.rq-placeholder { border-radius: 12px; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
body.rq-is-dragging { cursor: grabbing; user-select: none; }
body.rq-is-dragging .rq-card { cursor: grabbing; }
.rq-more { align-self: center; }
.rq-col-actions { display: flex; gap: 6px; padding: 0 10px 10px; }
.rq-menu { position: fixed; z-index: 70; min-width: 200px; max-width: 280px; padding: 6px; border-radius: 12px; background: var(--surface-1); border: 1px solid var(--border); box-shadow: var(--shadow-md, 0 12px 30px rgb(0 0 0 / .35)); display: flex; flex-direction: column; }
.rq-menu button { text-align: start; background: none; border: 0; color: inherit; font: inherit; padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.rq-menu button:hover, .rq-menu button:focus-visible { background: var(--surface-2, var(--raised)); outline: none; }
.rq-menu button[disabled] { opacity: .5; cursor: default; }
.rq-menu .rq-menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.rq-menu .rq-menu-head { font-size: 11.5px; color: var(--muted); padding: 6px 10px 2px; }
.rq-menu .rq-danger { color: var(--danger-text, #dc2626); }
/* side panel */
.rq-panel { flex: 0 0 420px; max-width: 100%; display: flex; flex-direction: column; border-inline-start: 1px solid var(--border); background: var(--surface-1); min-height: 0; }
.rq-panel[hidden] { display: none; }
.rq-panel-head { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px 8px; border-bottom: 1px solid var(--border); }
.rq-panel-head h2 { margin: 2px 0 0; font-size: 16px; line-height: 1.3; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rq-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 20px; display: flex; flex-direction: column; gap: 14px; }
.rq-panel h3 { margin: 0 0 6px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.rq-stage-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rq-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13.5px; margin: 0; }
.rq-kv dt { color: var(--muted); } .rq-kv dd { margin: 0; overflow-wrap: anywhere; }
.rq-desc { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; margin: 0; }
.rq-desc a { color: var(--accent); }
.rq-link-box { display: flex; gap: 6px; align-items: center; }
.rq-link-box input { flex: 1; min-width: 0; direction: ltr; font-size: 12.5px; }
.rq-qr { width: 132px; height: 132px; background: #fff; border-radius: 10px; padding: 6px; margin-top: 8px; }
.rq-qr svg { width: 100%; height: 100%; display: block; }
.rq-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-inline-start: 2px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.rq-ev { position: relative; font-size: 13.5px; }
.rq-ev::before { content: ""; position: absolute; inset-inline-start: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface-1); border: 2px solid var(--muted); }
.rq-ev-message::before { border-color: var(--accent); background: var(--accent); }
.rq-ev-note::before { border-color: var(--purple, #7a5cff); background: var(--purple, #7a5cff); }
.rq-ev-time { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rq-ev-body { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rq-ev-note .rq-ev-body { background: color-mix(in srgb, var(--purple, #7a5cff) 14%, transparent); border-radius: 8px; padding: 6px 8px; }
.rq-ev-message .rq-ev-body { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 8px; padding: 6px 8px; }
.rq-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 4px; padding: 0 5px; background: var(--surface-2, var(--raised)); color: var(--muted); }
.rq-tag-internal { background: color-mix(in srgb, var(--purple, #7a5cff) 20%, transparent); color: var(--text); }
.rq-note-form { display: flex; flex-direction: column; gap: 6px; }
.rq-note-form textarea { min-height: 64px; resize: vertical; }
.rq-panel-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* message / reason dialogs */
.rq-msg { display: grid; gap: 10px; min-width: min(560px, 86vw); }
.rq-msg textarea { min-height: 120px; resize: vertical; font-size: 14px; line-height: 1.5; }
.rq-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.rq-chips button { font: inherit; font-size: 12px; border: 1px solid var(--border); background: var(--surface-2, var(--raised)); color: inherit; border-radius: 999px; padding: 2px 9px; cursor: pointer; }
.rq-chips button:hover, .rq-chips button:focus-visible { border-color: var(--accent); outline: none; }
.rq-preview { background: var(--surface-2, var(--raised)); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; min-height: 2.5em; }
.rq-warn { color: var(--danger-text, #dc2626); font-size: 12.5px; margin: 0; }
.rq-reasons { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow: auto; }
.rq-reasons label { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.rq-reasons label:hover { background: var(--surface-2, var(--raised)); }
.rq-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* states */
.rq-state { margin: auto; max-width: 520px; padding: 32px; text-align: center; }
.rq-state h2 { margin: 0 0 8px; font-size: 18px; } .rq-state p { color: var(--muted); }
.rq-state .inv-btn { margin-top: 10px; }
@media (max-width: 900px) {
  .rq-panel { position: absolute; inset: 0; flex: none; z-index: 20; border: 0; }
  .rq-col { flex-basis: 260px; }
}
@media (prefers-reduced-motion: no-preference) { .rq-card { transition: box-shadow .12s, opacity .12s; } }
/* the bar's controls size to their content (the Inventory inputs are full-width by default) */
.rq-bar .inv-input, .rq-filters .inv-input { width: auto; }
.rq-search { width: 100%; }
.rq-kv .inv-input-short { width: auto; min-width: 9em; }
