/* ERP System — إضافات صغيرة فوق theme.css  */

/* قائمة المستخدم في الشريط العلوي */
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.topbar-user { color: var(--c-muted); font-size: 0.9rem; font-weight: 600; }
.topbar-actions form { display: inline; }
.topbar-actions .btn-logout { border: none; cursor: pointer; font-family: inherit; }

/* أكواد مسلسلة */
.code-cell { font-weight: 800; font-variant-numeric: tabular-nums; }

/* سجل الحركات */
.log-desc { max-width: 520px; white-space: pre-wrap; line-height: 1.7; font-size: 0.9rem; }
.badge-action-create { background: #d1fae5; color: #059669; }
.badge-action-update { background: #dbeafe; color: #2563eb; }
.badge-action-delete, .badge-action-cancel { background: #fee2e2; color: #dc2626; }
.badge-action-post, .badge-action-close { background: #ede9fe; color: #7c3aed; }
.badge-action-login, .badge-action-logout { background: #f1f5f9; color: #475569; }
.badge-action-login_failed { background: #ffedd5; color: #c2410c; }
.badge-action-export, .badge-action-print { background: #fef3c7; color: #b45309; }
.tg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #229ed9; margin-inline-start: 4px; }

.main-content { min-width: 0; }   /* عشان الجداول العريضة تعمل scroll جواها بدل ما الصفحة كلها تتمد */
.search-bar { flex-wrap: wrap; }
.search-bar .form-control { min-width: 140px; flex: 1 1 140px; }
.form-group.full { grid-column: 1 / -1; }
.panel-header .header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.logo-preview { max-height: 80px; border-radius: 10px; border: 1px solid #e2e8f0; padding: 4px; background: #fff; }
.muted-note { color: #64748b; font-size: 0.9rem; margin-bottom: 1rem; line-height: 1.8; }

/* الخصائص (لون، مقاس) */
.attr-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; }
.attr-chip { display: inline-flex; align-items: center; gap: 0.35rem; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.85rem; font-weight: 600; }
.attr-chip form { display: inline; }
.attr-chip button { background: none; border: none; color: #dc2626; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0.15rem; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid #cbd5e1; }

/* الأصناف */
.thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; background: #f8fafc; }
.thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: #cbd5e1; font-size: 1.2rem; }
.item-gallery { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.item-gallery figure { position: relative; width: 130px; margin: 0; }
.item-gallery img { width: 130px; height: 130px; object-fit: cover; border-radius: 10px; border: 2px solid #e2e8f0; }
.item-gallery figure.main img { border-color: var(--c1); }
.item-gallery figcaption { font-size: 0.78rem; display: flex; flex-direction: column; gap: 0.2rem; margin-top: 0.3rem; }
.item-gallery select { font-size: 0.78rem; padding: 2px; }
.section-title { font-weight: 800; margin: 1.5rem 0 0.75rem; display: flex; align-items: center; gap: 0.5rem; justify-content: space-between; flex-wrap: wrap; }
.rows-table input, .rows-table select { min-width: 90px; }
.rows-table td { vertical-align: middle; }
.gen-box { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px; padding: 1rem; margin-bottom: 0.75rem; }
.gen-box .attr-group { margin-bottom: 0.6rem; }
.gen-box .attr-group strong { display: inline-block; min-width: 70px; }
.gen-box label { margin-inline-end: 0.9rem; font-weight: 600; white-space: nowrap; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; }
.info-grid div { background: #f8fafc; border-radius: 10px; padding: 0.6rem 0.8rem; }
.info-grid small { display: block; color: #64748b; font-size: 0.78rem; }
.info-grid strong { font-size: 1rem; }

/* بحث الأصناف في المستندات */
.dropdown-results { position: absolute; top: 100%; right: 0; left: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.12); z-index: 30; max-height: 300px; overflow: auto; }
.dropdown-results div { padding: 0.5rem 0.8rem; cursor: pointer; border-bottom: 1px solid #f1f5f9; }
.dropdown-results div:hover { background: #eff6ff; }
.dropdown-results .muted { color: #94a3b8; cursor: default; }
.totals-box { margin-top: 1rem; margin-inline-start: auto; max-width: 420px; background: #f8fafc; border-radius: 12px; padding: 0.75rem 1rem; }
.totals-box .row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.3rem 0; border-bottom: 1px dashed #e2e8f0; }
.totals-box .row:last-child { border-bottom: none; }
.totals-box .row.grand { font-weight: 800; font-size: 1.05rem; }
.totals-box input { max-width: 150px; }
.doc-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.5rem 1.5rem; margin-bottom: 1rem; }
.doc-head div { border-bottom: 1px dashed #e2e8f0; padding: 0.35rem 0; }
.doc-head small { color: #64748b; display: block; font-size: 0.78rem; }
.doc-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.doc-actions form { display: inline; }
.neg { color: #dc2626; font-weight: 700; }
.pos { color: #16a34a; font-weight: 700; }
@media print {
  .sidebar, .sidebar-toggle, .topbar, .doc-actions, .alert, .no-print { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; width: 100% !important; }
  .panel { box-shadow: none !important; border: none !important; }
  body { background: #fff !important; }
}

/* العلامة المائية: بتظهر في الطباعة بس */
.print-watermark { display: none; }
@media print {
  .print-watermark { display: flex; position: fixed; inset: 0; align-items: center; justify-content: center; pointer-events: none; z-index: 0; }
  .print-watermark img { max-width: 60%; max-height: 60%; opacity: 0.08; }
  .print-watermark span { font-size: 5rem; font-weight: 800; color: #000; opacity: 0.06; transform: rotate(-30deg); white-space: nowrap; }
}
