/* «محرك الأسعار» tab inside «مركز التسعير» — only shown when the server has the engine on */
.pe { display: grid; gap: 14px; margin-top: 12px; }
.pe-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.pe-sub { color: var(--muted); font-size: .8rem; margin: 0; }
.pe-body { display: grid; gap: 12px; }
.pe-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pe-chip { display: grid; gap: 2px; text-align: start; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pe-chip small { color: var(--muted); font-size: .74rem; }
.pe-chip:hover { border-color: var(--orange); }
.pe-chip.is-on { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(247, 147, 30, .15); }
.pe-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pe-q { flex: 1 1 260px; }
.pe-note { margin: 0; padding: .5rem .8rem; border-radius: 10px; background: #fff7ed; color: #9a3412; font-size: .82rem; font-weight: 700; }
.pe-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.pe-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.pe-table th { text-align: start; padding: .55rem .7rem; color: var(--muted); font-weight: 800; border-bottom: 1px solid var(--line); white-space: nowrap; background: #f8fafc; }
.pe-table td { padding: .55rem .7rem; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.pe-table td small { display: block; color: var(--muted); font-size: .72rem; }
.pe-table tr:last-child td { border-bottom: 0; }
.pe-en { direction: ltr; text-align: start; }
.pe-doubt { color: #b45309 !important; font-weight: 700; }
.pe-missing { color: var(--red); }
.pe-flag { display: inline-block; margin: 2px 0 0; padding: 1px 7px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: .7rem; font-weight: 800; }
.pe-flag.is-bad { background: #fee2e2; color: #b91c1c; }
.pe-st { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.pe-st.is-warn { background: #fef3c7; color: #92400e; }
.pe-st.is-ok { background: #dcfce7; color: #166534; }
.pe-st.is-bad { background: #fee2e2; color: #b91c1c; }
.pe-acts { white-space: nowrap; }
.pe-acts .btn { margin-inline-end: 4px; }
.pe-form, .pe-supcard { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.pe-form label, .pe-supcard label, .pe-item-f label, .pe-opts label { display: grid; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.pe-form input, .pe-supcard input, .pe-item-f input, .pe-item-f select, .pe-opts input, .pe-rule input { padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 9px; font: inherit; color: var(--ink); background: #fff; min-width: 0; }
.pe-wide { grid-column: 1 / -1; }
.pe-actions { display: flex; gap: 8px; }
.pe-check { display: flex !important; align-items: center; gap: 8px; color: var(--ink) !important; }
.pe-hist { margin: 0; padding-inline-start: 18px; font-size: .8rem; color: var(--muted); }
.pe-supcard { padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.pe-supcard h4 { grid-column: 1 / -1; margin: 0; }
.pe-supcard h4 small { color: var(--muted); font-weight: 600; }
.pe-rules { display: grid; gap: 6px; margin: 6px 0; }
.pe-rule { display: grid; grid-template-columns: 1.4fr 1fr 1fr .7fr auto auto; gap: 6px; align-items: center; }
.pe-x { border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.pe-x:hover { color: var(--red); background: #fee2e2; }
.pe-calc { display: grid; gap: 10px; }
.pe-found { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.pe-found button { display: grid; gap: 2px; text-align: start; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; transition: border-color .15s; }
.pe-found button small { color: var(--muted); font-size: .74rem; }
.pe-found button:hover { border-color: var(--orange); }
.pe-item { display: grid; gap: 8px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.pe-item-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pe-item-h small { color: var(--muted); font-size: .76rem; }
.pe-item-h .pe-x { margin-inline-start: auto; }
.pe-item-f { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pe-res { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; padding: 8px 10px; border-radius: 10px; background: #f8fafc; font-size: .84rem; }
.pe-res.is-bad { background: #fee2e2; color: #b91c1c; margin: 0; }
.pe-res .pe-warn { flex-basis: 100%; }
.pe-surch { color: #9a3412; font-weight: 800; }
.pe-days { flex-basis: 100%; color: var(--muted); font-size: .74rem; }
.pe-warn { margin: 0; padding: .4rem .7rem; border-radius: 9px; background: #fff7ed; color: #9a3412; font-size: .8rem; font-weight: 700; }
.pe-warn.is-bad { background: #fee2e2; color: #b91c1c; }
.pe-opts { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.pe-opts input[type="number"] { width: 110px; }
.pe-sum { display: grid; gap: 8px; padding: 14px; background: #fff; border: 1px solid var(--orange); border-radius: 14px; }
.pe-sum h4 { margin: 0; }
.pe-tot { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .88rem; }
@media (max-width: 640px) {
  .pe-rule { grid-template-columns: 1fr 1fr; }
  .pe-acts { white-space: normal; }
}

/* «قراءة ملف» */
.pr-up, .pr-edit { display: grid; gap: 12px; }
.pr-drop { display: grid; gap: 4px; place-items: center; padding: 1.4rem; border: 2px dashed var(--line); border-radius: 14px; background: #fff; cursor: pointer; text-align: center; transition: border-color .15s; }
.pr-drop:hover, .pr-drop:focus-within { border-color: var(--orange); }
.pr-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pr-drop small { color: var(--muted); font-size: .78rem; }
.pr-text { width: 100%; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 12px; font: inherit; resize: vertical; }
.pr-in { width: 100%; min-width: 0; padding: .3rem .45rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .8rem; background: #fff; }
.pr-in:focus { outline: 2px solid rgba(247, 147, 30, .35); border-color: var(--orange); }
.pr-table { min-width: 1180px; }
.pr-table td { min-width: 70px; vertical-align: top; }
.pr-table td > .pr-in { display: block; }
.pr-table select.pr-in { min-width: 128px; }
.pr-table td .pr-in + .pr-in { margin-top: 4px; }
.pr-l { min-width: 170px; }
.pr-s { min-width: 90px; }
.pr-n { width: 80px; }
.pr-cur { width: 64px; text-transform: uppercase; }
.pr-d { width: 132px; }
.pr-pax { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.pr-pax .pr-n { width: 56px; }
.pr-table tr.is-doubt td { background: #fffbeb; }
.pr-supbox { align-items: end; }
