/* إدارة المستودعات — أنماط إضافية لمجموعة الشاشات (b): الأصناف (القائمة، النموذج، البطاقة).
   الأصل iv-* في inventory.css و rc-* في record-page.css؛ هنا ما لا يغطيانه فقط. */

/* ── القائمة ── */
.ib-thumb { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; flex: none; border: 1px solid #e5e7eb; background: #fff; }
.ib-mut { color: #94a3b8; }

/* ── النموذج: جداول قابلة للتحرير (الوحدات، الرموز) ── */
.ib-edit { width: 100%; border-collapse: collapse; font-size: .84rem; }
.ib-edit th { text-align: start; font-size: .72rem; font-weight: 800; color: #64748b; padding: .45rem .5rem; background: #f7f9fc; border-bottom: 1px solid #e6ebf1; white-space: nowrap; }
.ib-edit td { padding: .4rem .5rem; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.ib-edit tr:last-child td { border-bottom: 0; }
.ib-edit input:not([type="checkbox"]):not([type="radio"]), .ib-edit select {
    width: 100%; min-width: 80px; height: 36px; border: 1px solid #e6ebf1; border-radius: 8px; padding: 0 .5rem; font: inherit; font-size: .84rem; background: #fff; color: #0f172a;
}
.ib-edit input:focus, .ib-edit select:focus { outline: none; border-color: #1d4ed8; box-shadow: 0 0 0 3px rgba(29, 78, 216, .12); }
.ib-edit input:disabled { background: #f7f9fc; color: #64748b; }
.ib-edit small { display: block; font-size: .7rem; color: #94a3b8; margin-top: .15rem; white-space: nowrap; }
.ib-edit .ib-c { text-align: center; }
.ib-edit .ib-uom { min-width: 170px; }
.ib-edit tr.is-base td { background: #fbfdfc; }
.ib-scroll { overflow-x: auto; border: 1px solid #e6ebf1; border-radius: 11px; }
.ib-tools { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.ib-tools .rc-hint { margin-inline-start: auto; }
.ib-x { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 8px; border: 0; background: none; color: #94a3b8; cursor: pointer; }
.ib-x:hover { background: #fef2f2; color: #b91c1c; }
.ib-sub { margin: 1.1rem 0 .55rem; font-size: .82rem; font-weight: 800; color: #0f172a; display: flex; align-items: center; gap: .4rem; }
.ib-sub .bi { color: #1d4ed8; }

/* ── النموذج: مفاتيح متعددة في شبكة ── */
.ib-switches { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.ib-sw { display: flex; gap: .55rem; align-items: flex-start; padding: .6rem .75rem; border: 1px solid #e6ebf1; border-radius: 10px; background: #f7f9fc; cursor: pointer; }
.ib-sw input { margin-top: .2rem; width: 2.2rem; height: 1.15rem; flex: none; cursor: pointer; }
.ib-sw b { display: block; font-size: .86rem; color: #0f172a; }
.ib-sw small { display: block; font-size: .72rem; color: #64748b; line-height: 1.55; }
.ib-sw.is-locked { opacity: .7; cursor: not-allowed; }
.ib-sw.is-locked input { cursor: not-allowed; }

/* ── التسعير: قيمة بلا ضريبة وقيمة شاملة متقابلتان ── */
.ib-price { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem 1rem; }
.ib-margin { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .9rem; }
.ib-margin span { display: inline-flex; gap: .35rem; align-items: center; padding: .35rem .7rem; border-radius: 99px; background: #f1f5f9; font-size: .78rem; font-weight: 700; color: #334155; }
.ib-margin span.ok { background: #ecfdf5; color: #065f46; } .ib-margin span.bad { background: #fef2f2; color: #b91c1c; }

/* ── الصور ── */
.ib-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .8rem; }
.ib-img { border: 1px solid #e6ebf1; border-radius: 12px; padding: .75rem; display: flex; flex-direction: column; gap: .55rem; background: #fff; }
.ib-img.is-primary { border-color: #059669; box-shadow: 0 0 0 2px rgba(5, 150, 105, .12); }
.ib-img__pv { height: 150px; border-radius: 9px; background: #f7f9fc; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #cbd5e1; font-size: 2rem; }
.ib-img__pv img { width: 100%; height: 100%; object-fit: contain; }
.ib-img__row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ib-img__row > * { flex: 1 1 120px; min-width: 0; }
.ib-img input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .ib-img select {
    width: 100%; height: 36px; border: 1px solid #e6ebf1; border-radius: 8px; padding: 0 .5rem; font: inherit; font-size: .82rem; background: #fff;
}
.ib-img input[type="file"] { font-size: .74rem; max-width: 100%; }
.ib-img label.ib-lbl { font-size: .7rem; font-weight: 700; color: #64748b; display: block; margin-bottom: .15rem; }
.ib-img__end { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.ib-busy { display: flex; gap: .6rem; align-items: center; padding: .6rem .8rem; border-radius: 10px; background: #fffbeb; color: #92400e; font-size: .84rem; font-weight: 700; margin-bottom: .75rem; }

/* ── البطاقة (التفاصيل) ── */
.ib-hero-img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: #fff; flex: none; }
.ib-gallery { display: flex; gap: .5rem; flex-wrap: wrap; }
.ib-gallery a { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid #e6ebf1; display: block; background: #f7f9fc; }
.ib-gallery img { width: 100%; height: 100%; object-fit: cover; }
.ib-tblw { overflow-x: auto; }
.ib-row-low td { background: #fffbeb; }
.ib-row-neg td { background: #fef2f2; }
.ib-exp { font-weight: 800; } .ib-exp.bad { color: #b91c1c; } .ib-exp.warn { color: #b45309; }
.ib-serials { display: flex; gap: .5rem; flex-wrap: wrap; }

@media (max-width: 760px) {
    .ib-tools .rc-hint { margin-inline-start: 0; flex-basis: 100%; }
    .ib-imgs { grid-template-columns: 1fr; }
}
