/* ============================================
   ميزان — Design Tokens & Custom Styles
   (فوق Tailwind CDN utility classes)
   ============================================ */

:root {
    --brand-ink: #18181b;      /* zinc-900 - الشريط الجانبي والعناوين */
    --brand-accent: #2563eb;   /* blue-600 - الإيرادات / التركيز */
    --brand-positive: #059669; /* emerald-600 - صافي موجب / نجاح */
    --brand-warning: #d97706;  /* amber-600 - تنبيهات ونسب الإنجاز */
    --brand-negative: #dc2626; /* red-600 - مصروفات / تنبيهات حرجة */
    --surface: #fafafa;        /* zinc-50 - خلفية الصفحة */
    --border-soft: #e4e4e7;    /* zinc-200 */
}

html, body {
    scrollbar-gutter: stable;
}

/* سكرول بار أنحف واحترافي */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: #a1a1aa; }

/* انتقال سلس لعناصر الشريط الجانبي والقوائم */
.nav-link { transition: background-color .15s ease, color .15s ease; }

/* حالة الصلاحيات: تختفي بحسب الدور عبر JS (app.js) */
.role-hidden { display: none !important; }

/* بطاقة قياسية موحدة الشكل عبر كل الصفحات */
.card {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: .5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}

/* شارة حالة (Badge) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .7rem;
    font-weight: 600;
    padding: .15rem .55rem;
    border-radius: 999px;
    border: 1px solid transparent;
}
.badge-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.badge-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-danger  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-neutral { background: #fafafa; color: #52525b; border-color: #e4e4e7; }

/* شريط تقدم رفيع */
.progress-track { background: #f4f4f5; border-radius: 999px; height: 6px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }

/* تلميحات فارغة عند حظر صفحة على دور معين */
.access-blocked {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 5rem 1.5rem; color: #71717a;
}

/* Toast تنبيه سريع أسفل الشاشة */
.app-toast {
    position: fixed; bottom: 1.25rem; left: 1.25rem; z-index: 100;
    background: var(--brand-ink); color: #fff; font-size: .8rem;
    padding: .65rem 1rem; border-radius: .5rem; box-shadow: 0 8px 24px rgba(0,0,0,.18);
    max-width: 20rem; opacity: 0; transform: translateY(6px);
    transition: opacity .25s ease, transform .25s ease;
}
.app-toast.show { opacity: 1; transform: translateY(0); }

/* Modal بسيط */
.app-modal-overlay {
    position: fixed; inset: 0; background: rgba(24,24,27,.35);
    backdrop-filter: blur(2px); z-index: 90;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}

/* طباعة التقارير: نخفي كل حاجة غير المحتوى الأساسي */
@media print {
    #appSidebar, header, .no-print { display: none !important; }
    main { padding: 0 !important; overflow: visible !important; }
    body { background: #fff !important; }
}
