/* =============================================================================
   عِيار — Eyaar Components
   Styles for Eyaar-specific UI pieces that have no base definition in
   components.css: the live metal-price ticker, page-header/modal
   illustrations, and the shared empty-state pattern.
   No decorative "luxury glass" overrides here (floating panels, blur, gold
   gradients/glow, animated background) — sidebar/header/cards/buttons/
   tables/modals all use their plain components.css definitions.
   Load order: variables.css -> base.css -> layout.css -> components.css ->
   plugins.css -> eyaar-components.css -> page-specific CSS.
============================================================================= */

/* -----------------------------------------------------------------------------
   شريط الأسعار الحي (تحت الهيدر) — يغذّيه price-ticker.js عبر SignalR
----------------------------------------------------------------------------- */
.price-ticker {
  position: sticky;
  top: var(--app-header-height);
  z-index: calc(var(--z-header) - 1);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 18px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow 0.4s;
}
.price-ticker.is-flash { box-shadow: inset 0 0 0 1px var(--brand-accent); }
.price-ticker__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  background: var(--brand-accent);
  color: var(--navy-900);
  font-size: 11.5px;
  font-weight: var(--fw-heavy);
  white-space: nowrap;
  flex-shrink: 0;
}
.price-ticker__track {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.price-ticker__track::-webkit-scrollbar { display: none; }
.price-ticker__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  white-space: nowrap;
  color: var(--sidebar-text);
  font-variant-numeric: tabular-nums;
}
.price-ticker__chip b { color: var(--gold-300); font-weight: var(--fw-bold); }
.price-ticker__sell { color: #86efac; font-weight: var(--fw-heavy); direction: ltr; }
.price-ticker__buy { color: var(--sidebar-text-muted); font-size: 11px; direction: ltr; }
.price-ticker__buy::before { content: "شراء "; font-size: 10px; }
.price-ticker__move { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; direction: ltr; }
.price-ticker__move small { font-size: 10.5px; font-weight: 600; opacity: 0.85; }
.price-ticker__move.is-up { color: #86efac; }
.price-ticker__move.is-down { color: #fca5a5; }

/* -----------------------------------------------------------------------------
   رسمة رأس الصفحة / رسمة المودال
----------------------------------------------------------------------------- */
.app-page-header__art {
  width: 150px;
  height: auto;
  flex-shrink: 0;
  margin-inline-start: auto;
  user-select: none;
  -webkit-user-drag: none;
}
@media (max-width: 767.98px) {
  .app-page-header__art { display: none; }
}

.cat-modal__art {
  width: 140px;
  margin: -4px auto 2px;
  display: block;
}

/* -----------------------------------------------------------------------------
   الرسومات التوضيحية (Illustrations)
----------------------------------------------------------------------------- */
.illus {
  display: block;
  margin-inline: auto;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.illus--xs { width: 150px; }
.illus--sm { width: 220px; }
.illus--md { width: 300px; }
.illus--lg { width: 380px; }

/* حالة فارغة موحّدة */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 36px 16px;
  text-align: center;
}
.empty-state__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: var(--fw-bold);
  color: var(--color-text);
  margin: 10px 0 0;
}
.empty-state__text {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0;
  max-width: 340px;
}

/* -----------------------------------------------------------------------------
   صورة القطعة — خانة الالتقاط/الاختيار + المصغّرات
----------------------------------------------------------------------------- */
.photo-slot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-slot__frame {
  width: 112px; height: 112px; flex-shrink: 0;
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.photo-slot__frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-slot__placeholder { font-size: 28px; color: var(--color-text-muted); opacity: 0.5; }
.photo-slot__actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.photo-slot--compact { flex-wrap: nowrap; gap: 8px; }
.photo-slot--compact .photo-slot__frame { width: 64px; height: 64px; border-radius: 10px; }
.photo-slot--compact .photo-slot__actions { flex-direction: row; }

.photo-slot.is-busy { opacity: 0.55; pointer-events: none; }
.photo-thumb {
  width: 100%; height: 100%; object-fit: cover; display: block;
  background: var(--color-surface);
}

/* -----------------------------------------------------------------------------
   الوردية — مؤشر الشريط العلوي
----------------------------------------------------------------------------- */
.shift-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--status-danger, #dc2626); flex-shrink: 0; display: inline-block; }
.shift-dot.is-open { background: var(--status-success, #16a34a); }
.shift-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-surface); color: var(--color-text);
  font-family: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  max-width: 320px;
}
.shift-pill[hidden] { display: none; }
.shift-pill__text { overflow: hidden; text-overflow: ellipsis; }
.shift-pill.is-none { border-color: color-mix(in srgb, var(--status-danger, #dc2626) 45%, transparent); }
.shift-pill.is-open { border-color: color-mix(in srgb, var(--status-success, #16a34a) 45%, transparent); }
@media (max-width: 767.98px) { .shift-pill__text { display: none; } .shift-pill { padding: 8px; } }

/* -----------------------------------------------------------------------------
   الجوال: أهداف لمس أكبر، وخطوط مدخلات 16px حتى لا يكبّر iOS الصفحة عند التركيز
----------------------------------------------------------------------------- */
@media (pointer: coarse) {
  .btn-app--sm { min-height: 40px; }
  .btn-app--icon.btn-app--sm { min-width: 40px; min-height: 40px; }
  .btn-app--icon { min-width: 40px; min-height: 40px; }
  .cart-qty__btn { min-width: 38px; min-height: 38px; }
  .cart-item__remove { min-width: 40px; min-height: 40px; }
  .seg button { min-height: 36px; padding-inline: 12px; }
  .tabs-app__btn, .tabs-app-v__btn { min-height: 42px; }
}
@media (max-width: 767.98px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  select,
  textarea,
  .form-app__control,
  .sl-input,
  .select2-container--default .select2-selection--single .select2-selection__rendered,
  .select2-search__field { font-size: 16px; }
}

/* حركة الأوزان: شبكة الفلاتر */
.wm-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.wm-filters .form-app__group { margin: 0; }
