/* ══════════════════════════════════════════════════════════════
   مستودع مسك — Components
   ══════════════════════════════════════════════════════════════ */

/* ─── الأزرار ─── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 18px; border-radius: var(--r-sm); font-weight: 700; font-size: .9rem;
    white-space: nowrap; transition: transform var(--t), box-shadow var(--t), background var(--t), border-color var(--t), color var(--t);
    border: 1px solid transparent; line-height: 1;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: var(--on-brand); box-shadow: var(--sh-brand); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -8px var(--side-active-glow); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-2); box-shadow: var(--sh-xs); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--text-3); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-2); padding: 8px 12px; }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); color: var(--danger); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-incart { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.btn-incart:hover { background: var(--brand-100); }
.btn-sm { padding: 6px 11px; font-size: .8rem; border-radius: var(--r-xs); gap: 5px; }
.btn-lg { padding: 13px 24px; font-size: 1rem; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none; }

.icon-btn {
    width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-sm); color: var(--text-2); transition: var(--t); position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* ─── البطاقات ─── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-sm); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ico { color: var(--brand); }
.card-pad { padding: 16px 18px; }

/* ─── الجداول ─── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
.table thead th { text-align: right; font-weight: 700; font-size: .78rem; color: var(--text-2); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t); }
.table tbody tr:hover { background: var(--surface-2); }
.table tfoot td { padding: 14px 16px; background: var(--surface-2); border-top: 2px solid var(--border-2); }
.row-link { cursor: pointer; }
.actions { display: flex; gap: 5px; justify-content: flex-start; flex-wrap: wrap; }

.cell-med { display: flex; align-items: center; gap: 10px; }
.cell-med-ico { width: 32px; height: 32px; border-radius: var(--r-xs); display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: hsl(var(--hue,200) 70% 95%); color: hsl(var(--hue,200) 65% 38%); }
[data-theme="dark"] .cell-med-ico { background: hsl(var(--hue,200) 40% 18%); color: hsl(var(--hue,200) 70% 70%); }

.avatar { width: 36px; height: 36px; border-radius: var(--r-full); background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .82rem; flex-shrink: 0; }
.avatar-sm { width: 30px; height: 30px; font-size: .72rem; }

/* ─── شارات الحالة (pills) ─── */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: var(--r-full); font-size: .76rem; font-weight: 700; white-space: nowrap; }
.pill .ico { width: .9em; height: .9em; }
.pill-pending    { background: var(--info-soft);    color: var(--info); }
.pill-processing { background: var(--brand-soft);   color: var(--brand-strong); }
.pill-shipping   { background: var(--accent-soft);  color: var(--accent); }
.pill-delivered  { background: var(--success-soft); color: var(--success); }
.pill-rejected   { background: var(--danger-soft);  color: var(--danger); }
.pill-open       { background: var(--info-soft);    color: var(--info); }
.pill-answered   { background: var(--success-soft); color: var(--success); }
.pill-closed     { background: var(--surface-3);    color: var(--text-2); }

.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: var(--r-xs); font-size: .76rem; font-weight: 700; }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-warn { background: var(--warning-soft); color: var(--warning); }

.chip { padding: 7px 15px; border-radius: var(--r-full); font-size: .84rem; font-weight: 600; background: var(--surface); border: 1px solid var(--border-2); color: var(--text-2); transition: var(--t); }
.chip:hover { border-color: var(--brand-400); color: var(--text); }
.chip.active { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; border-color: transparent; box-shadow: var(--sh-brand); }
.chip-soft { background: var(--brand-tint); color: var(--brand-strong); border: none; padding: 3px 10px; font-size: .76rem; pointer-events: none; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

/* ─── الحقول ─── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .82rem; font-weight: 700; color: var(--text-2); }
.field input, .field select, .field textarea, .select {
    width: 100%; padding: 11px 13px; border: 1px solid var(--border-2); border-radius: var(--r-sm);
    background: var(--surface); color: var(--text); transition: var(--t); font-size: .92rem;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .select:focus, .search input:focus {
    outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--brand-tint);
}
.field-icon { position: relative; display: flex; align-items: center; }
.field-icon .ico { position: absolute; right: 13px; color: var(--text-3); pointer-events: none; }
.field-icon input { padding-right: 38px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .modal-actions.full, .form-grid > .field:last-of-type { grid-column: 1 / -1; }
.form-col { display: flex; flex-direction: column; }
.select { cursor: pointer; }

/* مجموعة هاتف: مقدّمة دولية + رقم */
.phone-group { display: flex; gap: 8px; }
.phone-group input { flex: 1; }
.phone-code { width: 88px; flex-shrink: 0; text-align: center; font-weight: 700; direction: ltr; cursor: pointer; padding: 11px 6px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--brand-tint); color: var(--brand-strong); transition: var(--t); }
.phone-code:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--brand-tint); }

/* إشعار مراجعة الطلب (نموذج التسجيل) */
.auth-notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: linear-gradient(115deg, var(--brand-tint), var(--violet-soft) 90%); border: 1px solid var(--border); margin: 4px 0 16px; }
.auth-notice-ico { width: 40px; height: 40px; border-radius: var(--r-xs); background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--sh-brand); }
.auth-notice-text strong { display: block; font-size: .92rem; }
.auth-notice-text p { font-size: .8rem; color: var(--text-2); margin-top: 3px; line-height: 1.5; }

/* شريط الأدوات */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar .btn { margin-inline-start: auto; }
.toolbar .select { width: auto; min-width: 150px; }
.search { position: relative; display: flex; align-items: center; flex: 1; min-width: 200px; max-width: 380px; }
.search .ico { position: absolute; right: 13px; color: var(--text-3); }
.search input { width: 100%; padding: 10px 38px 10px 14px; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface); transition: var(--t); }

/* ─── KPI ─── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh-sm); position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--k, var(--brand)); }
.kpi-ico { width: 48px; height: 48px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--k, var(--brand)) 14%, transparent); color: var(--k, var(--brand)); flex-shrink: 0; }
.kpi-ico .ico { width: 24px; height: 24px; }
.kpi-label { font-size: .82rem; color: var(--text-2); font-weight: 600; }
.kpi-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.kpi-sub { font-size: .76rem; color: var(--text-3); }
.kpi-brand   { --k: var(--brand); }
.kpi-info    { --k: var(--violet); }
.kpi-accent  { --k: var(--sun); }
.kpi-success { --k: var(--emerald); }

.mini-kpis { display: flex; gap: 12px; flex-wrap: wrap; }
.mini-kpis.col { flex-direction: column; }
.mini-kpi { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r); border: 1px solid var(--border); }
.mini-kpi strong { font-size: 1.15rem; }

/* ─── التنبيهات ─── */
.alerts-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.alert { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--r); font-size: .85rem; font-weight: 600; border: 1px solid transparent; }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-warn { background: var(--warning-soft); color: var(--warning); }
.alert-ok { background: var(--success-soft); color: var(--success); }

/* ─── حالة فارغة ─── */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 20px; text-align: center; }
.empty-ico { width: 72px; height: 72px; border-radius: var(--r-full); display: flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--text-3); }
.empty-title { font-weight: 700; color: var(--text); }
.empty-sub { font-size: .85rem; color: var(--text-2); }

/* ─── النوافذ ─── */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(8,15,25,.55); backdrop-filter: blur(4px); animation: fade .2s var(--ease); }
.modal { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-lg); width: 100%; max-width: 480px; max-height: 92vh; display: flex; flex-direction: column; animation: pop .28s var(--spring); border: 1px solid var(--border); }
.modal-lg { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 1.1rem; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-start; margin-top: 8px; padding-top: 14px; }
.modal-actions .btn { flex: 0 0 auto; }
.modal-actions.full { grid-column: 1 / -1; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }

/* ─── الإشعارات المنبثقة (toasts) ─── */
.toast-container { position: fixed; top: 18px; left: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast { display: flex; align-items: center; gap: 11px; padding: 13px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-md); animation: toastIn .3s var(--spring); border-inline-start: 4px solid var(--brand); }
.toast-ico { width: 30px; height: 30px; border-radius: var(--r-xs); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.toast-msg { font-size: .88rem; font-weight: 600; }
.toast-success { border-inline-start-color: var(--success); } .toast-success .toast-ico { background: var(--success); }
.toast-error   { border-inline-start-color: var(--danger); }  .toast-error .toast-ico { background: var(--danger); }
.toast-warning { border-inline-start-color: var(--warning); } .toast-warning .toast-ico { background: var(--warning); }
.toast-info    { border-inline-start-color: var(--info); }    .toast-info .toast-ico { background: var(--info); }
.toast-out { animation: toastOut .28s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-40px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-40px); } }

/* ─── بطاقات المنتجات ─── */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 6px; transition: transform var(--t), box-shadow var(--t), border-color var(--t); box-shadow: var(--sh-xs); }
.product:hover { transform: translateY(-4px); box-shadow: var(--sh-md); border-color: var(--brand-300); }
.product.is-out { opacity: .72; }
.product-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.product-ico { width: 52px; height: 52px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; background: hsl(var(--hue,200) 72% 95%); color: hsl(var(--hue,200) 62% 40%); }
[data-theme="dark"] .product-ico { background: hsl(var(--hue,200) 42% 16%); color: hsl(var(--hue,200) 72% 68%); }
.product-cat { font-size: .74rem; color: var(--text-3); font-weight: 600; }
.product-name { font-size: 1rem; font-weight: 700; line-height: 1.4; }
.product-meta { font-size: .78rem; color: var(--text-2); min-height: 1.1em; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--border-2); }
.product-price { font-size: 1.1rem; font-weight: 800; }
.stock-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--r-full); font-size: .72rem; font-weight: 700; }
.stock-badge.ok { background: var(--success-soft); color: var(--success); }
.stock-badge.low { background: var(--warning-soft); color: var(--warning); }
.stock-badge.out { background: var(--danger-soft); color: var(--danger); }

/* ─── الورقة السفلية (اختيار الكمية) ─── */
.sheet-overlay { align-items: flex-end; }
.sheet { background: var(--surface); width: 100%; max-width: 460px; margin: 0 auto; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 12px 20px 22px; box-shadow: var(--sh-lg); position: relative; animation: sheetUp .32s var(--spring); }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-handle { width: 42px; height: 4px; border-radius: 999px; background: var(--border-2); margin: 4px auto 16px; }
.sheet-close { position: absolute; top: 12px; left: 12px; }
.sheet-product { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.sheet-thumb { width: 50px; height: 50px; border-radius: var(--r); background: var(--brand-tint); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sheet-prod-info { flex: 1; }
.sheet-name { font-weight: 800; font-size: 1.05rem; }
.sheet-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.sheet-unit { font-weight: 800; font-size: 1.1rem; }
.sheet-qty { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-block: 1px solid var(--border); margin-bottom: 18px; font-weight: 700; }
.sheet-actions { display: flex; gap: 10px; align-items: stretch; }
.sheet-remove { width: 52px; border-radius: var(--r); border: 1px solid var(--danger-soft); background: var(--danger-soft); color: var(--danger); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: var(--t); }
.sheet-remove:hover { background: var(--danger); color: #fff; }
.sheet-cta { flex: 1; display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-radius: var(--r); background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; font-weight: 800; box-shadow: var(--sh-brand); transition: var(--t); }
.sheet-cta:hover { transform: translateY(-1px); }
.sheet-cta span { display: inline-flex; align-items: center; gap: 7px; }
.sheet-cta-total { background: rgba(255,255,255,.2); padding: 4px 12px; border-radius: var(--r-full); }

/* ─── الدرج العددي (stepper) ─── */
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-full); padding: 3px; }
.step-btn { width: 30px; height: 30px; border-radius: var(--r-full); display: flex; align-items: center; justify-content: center; color: var(--text-2); transition: var(--t); }
.step-btn:hover { background: var(--surface); color: var(--brand); box-shadow: var(--sh-xs); }
.step-input { width: 48px; text-align: center; background: transparent; border: none; font-weight: 800; font-size: 1rem; }
.step-input:focus { outline: none; }
.step-val { min-width: 28px; text-align: center; font-weight: 800; }

/* ─── السلة ─── */
.cart-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.cart-row { display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-xs); }
.cart-ico { width: 42px; height: 42px; border-radius: var(--r-xs); background: var(--brand-tint); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.cart-info { display: flex; flex-direction: column; gap: 2px; }
.cart-line { font-weight: 800; min-width: 88px; text-align: left; }
.cart-del { width: 34px; height: 34px; border-radius: var(--r-xs); color: var(--text-3); transition: var(--t); display: flex; align-items: center; justify-content: center; }
.cart-del:hover { background: var(--danger-soft); color: var(--danger); }
.cart-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; max-width: 380px; margin-inline-start: auto; box-shadow: var(--sh-sm); }
.summary-row { display: flex; justify-content: space-between; padding: 7px 0; color: var(--text-2); }
.summary-row.total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 14px; font-size: 1.15rem; color: var(--text); font-weight: 700; }
.summary-row.total strong { font-size: 1.4rem; }
.cart-summary .btn { margin-top: 14px; }

/* ─── بطاقات الطلبيات (صيدلية) ─── */
.order-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.order-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--sh-xs); display: flex; flex-direction: column; gap: 12px; }
.order-card-head { display: flex; align-items: center; justify-content: space-between; }
.order-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }

/* خط مصغّر للحالة */
.ministep { display: flex; align-items: center; }
.ministep.rejected { color: var(--danger); font-size: .82rem; font-weight: 700; gap: 6px; }
.ministep-node { width: 18px; height: 18px; border-radius: 999px; background: var(--surface-3); border: 2px solid var(--border-2); display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.ministep-node.done { background: var(--brand); border-color: var(--brand); }
.ministep-bar { height: 3px; flex: 1; background: var(--border-2); }
.ministep-bar.done { background: var(--brand); }

/* ─── خط الحالة الكامل (تفاصيل الطلب) ─── */
.stepper-track { display: flex; align-items: flex-start; margin: 4px 0 20px; }
.stepper-step { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; flex-shrink: 0; width: 78px; }
.stepper-dot { width: 40px; height: 40px; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--text-3); border: 2px solid var(--border-2); transition: var(--t); }
.stepper-step.done .stepper-dot { background: var(--brand); color: #fff; border-color: var(--brand); }
.stepper-step.active .stepper-dot { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 0 0 5px var(--brand-tint); }
.stepper-label { font-size: .76rem; font-weight: 700; color: var(--text-2); }
.stepper-step.active .stepper-label, .stepper-step.done .stepper-label { color: var(--text); }
.stepper-time { font-size: .68rem; color: var(--text-3); }
.stepper-line { height: 3px; flex: 1; background: var(--border-2); margin-top: 19px; border-radius: 2px; }
.stepper-line.done { background: var(--brand); }
.order-rejected { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--danger-soft); color: var(--danger); border-radius: var(--r); margin-bottom: 18px; font-weight: 700; }

/* ─── شبكة المعلومات ─── */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.info-grid.tight { gap: 10px; }
.info-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 11px 13px; }
.info-label { font-size: .74rem; color: var(--text-3); font-weight: 600; margin-bottom: 3px; }
.info-value { font-weight: 700; font-size: .92rem; word-break: break-word; }

/* ─── التقارير ─── */
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.rank-row:last-child { border-bottom: none; }
.rank { width: 26px; height: 26px; border-radius: var(--r-xs); background: var(--brand-tint); color: var(--brand-strong); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: .82rem; }
.rank-name { flex: 1; font-weight: 600; }
.rank-val { color: var(--text-2); font-size: .85rem; font-weight: 700; }

/* فواتير الحساب */
.invoice-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.invoice-row:last-child { border-bottom: none; }

/* ─── الإشعارات (لوحة) ─── */
.notif-panel { position: absolute; top: calc(100% - 8px); left: 18px; width: 360px; max-width: calc(100vw - 36px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-lg); z-index: 60; overflow: hidden; animation: pop .22s var(--spring); }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-head h3 { font-size: .95rem; }
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; width: 100%; text-align: right; padding: 13px 16px; border-bottom: 1px solid var(--border); transition: var(--t); align-items: flex-start; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--brand-tint); }
.notif-dot { width: 7px; height: 7px; border-radius: 999px; background: transparent; margin-top: 7px; flex-shrink: 0; }
.notif-item.unread .notif-dot { background: var(--brand); }
.notif-ico { width: 30px; height: 30px; border-radius: var(--r-xs); background: var(--surface-3); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-title { font-weight: 700; font-size: .86rem; }
.notif-text { font-size: .8rem; color: var(--text-2); }
.notif-time { font-size: .72rem; color: var(--text-3); }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px; color: var(--text-3); }
.notif-badge { position: absolute; top: 4px; left: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .66rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* ─── الدعم ─── */
.support-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.support-intro h3 { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.support-intro h3 .ico { color: var(--brand); }
.ticket-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ticket-card { text-align: right; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 15px; display: flex; flex-direction: column; gap: 7px; transition: var(--t); box-shadow: var(--sh-xs); }
.ticket-card:hover { border-color: var(--brand-300); transform: translateY(-2px); box-shadow: var(--sh); }
.ticket-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ticket-card-last { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* المحادثة */
.thread-meta { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; padding: 4px; }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: var(--r); font-size: .9rem; }
.bubble.theirs { background: var(--surface-3); align-self: flex-start; border-bottom-right-radius: 4px; }
.bubble.mine { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; align-self: flex-end; border-bottom-left-radius: 4px; }
.bubble-from { font-size: .7rem; font-weight: 800; opacity: .7; margin-bottom: 2px; }
.bubble-time { font-size: .66rem; opacity: .65; margin-top: 3px; }
.thread-reply { display: flex; gap: 8px; margin-top: 14px; }
.thread-reply input { flex: 1; padding: 11px 14px; border: 1px solid var(--border-2); border-radius: var(--r-full); background: var(--surface); transition: var(--t); }
.thread-reply input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 4px var(--brand-tint); }
.thread-reply .btn { border-radius: var(--r-full); }
.thread-closed { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 12px; color: var(--text-2); background: var(--surface-2); border-radius: var(--r); margin-top: 12px; font-weight: 600; }
.thread-admin-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
