/* ===== elsaad - السعد | تصميم بريميوم v2 - عصري وأنيق ===== */
:root {
    --sidebar-bg: #0f172a;
    --sidebar-bg2: #1e293b;
    --sidebar-active: #14b8a6;
    --sidebar-active-glow: rgba(20,184,166,.18);
    --sidebar-text: #cbd5e1;
    --sidebar-text-dim: #64748b;
    --primary: #0f766e;
    --primary-dark: #0f5e58;
    --primary-light: #ccfbf1;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --bg: #f8fafc;
    --bg-soft: #f1f5f9;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-shadow: 0 1px 3px rgba(15,23,42,.04), 0 4px 12px rgba(15,23,42,.04);
    --card-shadow-hover: 0 4px 12px rgba(15,23,42,.08), 0 8px 24px rgba(15,23,42,.06);
    --text-main: #1e293b;
    --text-dim: #64748b;
    --topbar-h: 64px;
    --sidebar-w: 268px;
    --radius: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text-main);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ===== الهيكل ===== */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg2) 100%);
    color: var(--sidebar-text);
    position: fixed;
    inset-inline-start: 0; top: 0; bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    border-inline-end: 1px solid rgba(255,255,255,.06);
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

.main-area {
    flex: 1;
    margin-inline-start: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

/* ===== هيدر جانبي بريميوم ===== */
.sidebar-header {
    padding: 20px 18px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    background: linear-gradient(135deg, rgba(20,184,166,.08), transparent);
    position: sticky;
    top: 0;
    backdrop-filter: blur(8px);
    z-index: 2;
}
.sidebar-logo {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, #14b8a6 50%, #06b6d4 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 19px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(15,118,110,.35);
    letter-spacing: .5px;
}
.sidebar-logo.sidebar-logo-img { background: #fff; padding: 4px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.sidebar-logo.sidebar-logo-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sidebar-title { line-height: 1.25; }
.sidebar-title .t1 { color: #fff; font-weight: 800; font-size: 15px; display: block; letter-spacing: .2px; }
.sidebar-title .t2 { color: var(--sidebar-text-dim); font-size: 11.5px; display: block; font-weight: 600; margin-top: 1px; }

.sidebar-nav { padding: 10px 8px 32px; }
.nav-section {
    color: #475569;
    font-size: 10.5px; font-weight: 800;
    padding: 18px 10px 8px;
    text-transform: uppercase; letter-spacing: .8px;
    display: flex; align-items: center; gap: 8px;
}
.nav-section::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.06); }
/* ===== قوائم منسدلة مميزة ===== */
.nav-group { margin-bottom: 6px; border-radius: 10px; overflow: hidden; border: 1px solid transparent; }
.nav-group.open { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.06); }
.nav-group-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; background: transparent; border: none; cursor: pointer;
    color: #94a3b8; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
    transition: all .15s;
}
.nav-group-toggle:hover { color: #e2e8f0; background: rgba(255,255,255,.03); }
.nav-group-toggle .arrow { font-size: 10px; transition: transform .2s; opacity: .7; }
.nav-group.open .arrow { transform: rotate(180deg); }
.nav-group-items { display: none; padding: 4px 6px 8px; }
.nav-group.open .nav-group-items { display: block; }
.nav-group .nav-link { margin-bottom: 2px; }
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--sidebar-text);
    margin-bottom: 3px;
    transition: all .18s ease;
    font-size: 13.5px; font-weight: 500;
    position: relative;
    border: 1px solid transparent;
}
.nav-link .icon { width: 22px; text-align: center; font-size: 16px; opacity: .85; transition: transform .18s; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.06); transform: translateX(2px); }
.nav-link:hover .icon { transform: scale(1.08); }
.nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, #14b8a6 100%);
    color: #fff; font-weight: 700;
    box-shadow: 0 4px 12px var(--sidebar-active-glow);
    border-color: rgba(255,255,255,.12);
}
.nav-link.active .icon { opacity: 1; }

/* ===== توب بار زجاجي ===== */
.topbar {
    height: var(--topbar-h);
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--card-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 1030;
    box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.topbar-title { font-weight: 800; font-size: 16.5px; color: var(--text-main); display: flex; align-items: center; gap: 10px; }
.topbar-title::before { content: ""; width: 4px; height: 20px; background: linear-gradient(180deg, var(--primary), var(--accent)); border-radius: 4px; display: inline-block; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.lang-switch { display: flex; align-items: center; gap: 4px; margin: 0; }
.lang-btn {
    background: #fff; border: 1px solid var(--card-border);
    border-radius: 10px; padding: 6px 12px; cursor: pointer;
    color: var(--text-main); font-size: 12.5px; font-weight: 700; line-height: 1;
    transition: all .15s;
}
.lang-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.lang-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(15,118,110,.25); }

.user-menu .btn-user {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--card-border);
    border-radius: 12px; padding: 6px 12px; cursor: pointer; color: var(--text-main);
    font-weight: 600; transition: all .15s; box-shadow: var(--card-shadow);
}
.user-menu .btn-user:hover { border-color: var(--primary); box-shadow: var(--card-shadow-hover); }
.avatar {
    width: 32px; height: 32px; border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #14b8a6);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px; box-shadow: 0 2px 6px rgba(15,118,110,.25);
}
.menu-toggle { background: #fff; border: 1px solid var(--card-border); border-radius: 10px; width: 40px; height: 40px; display: none; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; box-shadow: var(--card-shadow); }

/* ===== المحتوى ===== */
.page-content { padding: 24px; flex: 1; background: radial-gradient(ellipse 800px 400px at 20% -10%, rgba(20,184,166,.06), transparent), radial-gradient(ellipse 600px 300px at 90% 0%, rgba(245,158,11,.05), transparent); }
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    transition: box-shadow .2s, transform .2s;
    overflow: hidden;
}
.card:hover { box-shadow: var(--card-shadow-hover); }
.card-header {
    padding: 16px 20px; border-bottom: 1px solid #f1f5f9;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px; background: linear-gradient(180deg, #fff, #fcfdfe);
}
.card-header h5 { margin: 0; font-size: 15px; font-weight: 800; color: var(--text-main); }
.card-body { padding: 20px; }

/* ===== أزرار بريميوم ===== */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: 10px; border: 1px solid transparent;
    font-size: 13.5px; font-weight: 700; cursor: pointer;
    transition: all .18s; font-family: inherit;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, #14b8a6 100%); color: #fff; box-shadow: 0 4px 12px rgba(15,118,110,.25); border-color: transparent; }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); color: #fff; box-shadow: 0 6px 16px rgba(15,118,110,.3); transform: translateY(-1px); }
.btn-success { background: linear-gradient(135deg, #059669, #10b981); color: #fff; }
.btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; }
.btn-outline { background: #fff; border-color: var(--card-border); color: var(--text-main); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }

/* ===== جداول ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
    background: #f8fafc; color: var(--text-dim);
    font-weight: 800; font-size: 11.5px; letter-spacing: .3px;
    padding: 12px 14px; text-align: start;
    border-bottom: 1px solid var(--card-border); white-space: nowrap;
}
.table tbody td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #f8fafc; }
.money { font-family: 'JetBrains Mono', Consolas, monospace; font-weight: 700; }
.debit { color: var(--success); } .credit { color: var(--danger); }

/* ===== شارات ===== */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 20px; font-size: 11.5px; font-weight: 800; letter-spacing: .2px; border: 1px solid transparent; }
.badge-green { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.badge-red { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.badge-gray { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge-blue { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.badge-yellow { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.status-draft { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.status-posted { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.status-cancelled { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.status-reversed { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ===== نماذج ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; font-weight: 700; color: #334155; margin-bottom: 6px; letter-spacing: .2px; }
.form-control, .form-select {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--card-border);
    border-radius: 10px; font-size: 13.5px; font-family: inherit;
    color: var(--text-main); background: #fff; transition: all .18s;
}
.form-control:focus, .form-select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15,118,110,.1); background: #fff;
}

/* ===== تنبيهات ===== */
.alert { padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 13.5px; border: 1px solid; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ===== إحصائيات ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
    background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius);
    padding: 18px 20px; display: flex; align-items: center; gap: 16px;
    box-shadow: var(--card-shadow); transition: all .2s; position: relative; overflow: hidden;
}
.stat-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, transparent, rgba(15,118,110,.03)); opacity: 0; transition: opacity .2s; }
.stat-card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }
.stat-card:hover::before { opacity: 1; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #ecfdf5; color: #059669; }
.stat-icon.orange { background: #fffbeb; color: #d97706; }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-icon.red { background: #fef2f2; color: #dc2626; }
.stat-value { font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--text-main); }
.stat-label { font-size: 12.5px; color: var(--text-dim); font-weight: 600; margin-top: 2px; }

/* ===== الشجرة ===== */
.tree { font-size: 13.5px; }
.tree-node { padding: 9px 10px; border-radius: 10px; display: flex; align-items: center; gap: 8px; transition: background .15s; }
.tree-node:hover { background: #f8fafc; }
.tree-type { font-size: 10.5px; padding: 2px 8px; border-radius: 20px; background: #f1f5f9; color: var(--text-dim); font-weight: 700; }
.leaf-dot { width: 9px; height: 9px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #14b8a6); display: inline-block; box-shadow: 0 0 0 3px rgba(15,118,110,.12); }

/* ===== تسجيل الدخول - تصميم مقسوم فاخر ===== */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(1200px 600px at 15% 20%, rgba(20,184,166,.12), transparent), radial-gradient(1000px 500px at 85% 80%, rgba(245,158,11,.10), transparent), linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    padding: 24px; position: relative; overflow: hidden;
}
.login-page::before {
    content: ""; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: .5;
}
.login-card {
    width: 100%; max-width: 440px; background: rgba(255,255,255,.98);
    backdrop-filter: blur(20px); border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.1);
    padding: 36px 32px; position: relative; border: 1px solid rgba(255,255,255,.2);
}
.login-card::before {
    content: ""; position: absolute; top: 0; inset-inline: 0; height: 4px;
    background: linear-gradient(90deg, var(--primary), #14b8a6, var(--accent));
    border-radius: 20px 20px 0 0;
}
.login-logo {
    width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, #14b8a6 55%, #06b6d4 100%);
    color: #fff; font-size: 30px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(15,118,110,.35), 0 0 0 1px rgba(255,255,255,.1) inset;
    position: relative;
}
.login-logo::after { content: ""; position: absolute; inset: 0; border-radius: 16px; background: linear-gradient(180deg, rgba(255,255,255,.18), transparent); }

/* ===== قيود ===== */
.voucher-totals {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px dashed var(--card-border); border-radius: 12px;
    font-size: 15px; font-weight: 800;
}

/* ===== أدوات ===== */
.d-flex { display: flex; } .align-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .flex-wrap { flex-wrap: wrap; } .flex-1 { flex: 1; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-dim); }
.empty-state .big { font-size: 48px; margin-bottom: 12px; opacity: .6; }
.page-title { font-size: 20px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.2px; }
.page-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 20px; font-weight: 500; }
.filters-bar {
    background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius);
    padding: 14px 18px; display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
    margin-bottom: 18px; box-shadow: var(--card-shadow);
}

/* ===== استجابة ===== */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 50px rgba(0,0,0,.4); }
    .main-area { margin-inline-start: 0; }
    .menu-toggle { display: flex; }
    .sidebar-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(4px); z-index: 1035; display: none; }
    .sidebar-overlay.show { display: block; }
}
@media (max-width: 767.98px) {
    .page-content { padding: 16px; }
    .page-content > .d-flex.justify-between { flex-direction: column; align-items: stretch; gap: 12px; }
    .filters-bar .form-control, .filters-bar .form-select { width: 100% !important; min-width: 0 !important; }
    .btn { min-height: 42px; }
    .table-wrap.mobile-cards { overflow: visible; }
    .table-wrap.mobile-cards .table thead { display: none; }
    .table-wrap.mobile-cards .table, .table-wrap.mobile-cards .table tbody, .table-wrap.mobile-cards .table tr, .table-wrap.mobile-cards .table td { display: block; width: 100%; }
    .table-wrap.mobile-cards .table tbody tr { border: 1px solid var(--card-border); border-radius: 12px; margin-bottom: 12px; padding: 10px 14px; background: #fff; box-shadow: var(--card-shadow); }
    .table-wrap.mobile-cards .table tbody td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px dashed #f1f5f9; }
    .table-wrap.mobile-cards .table tbody td::before { content: attr(data-label); font-weight: 700; color: var(--text-dim); font-size: 12px; flex-shrink: 0; }
    .table-wrap.mobile-cards .table tbody td:last-child { border-bottom: none; }
    .topbar { padding: 0 14px; }
}
@media (max-width: 575.98px) {
    .page-content { padding: 12px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .login-card { padding: 28px 22px; }
}

/* ===== طباعة ===== */
.print-theme-1 { --pa: #0f766e; --pad: #0f5e58; --pal: #ccfbf1; --pb: #99f6e4; --phb: #ffffff; }
.print-theme-2 { --pa: #1e293b; --pad: #0f172a; --pal: #f1f5f9; --pb: #cbd5e1; --phb: #ffffff; }
.print-theme-3 { --pa: #0f172a; --pad: #020617; --pal: #e2e8f0; --pb: #64748b; --phb: #0f172a; }
.print-theme-4 { --pa: #0f766e; --pad: #134e4a; --pal: #ecfdf5; --pb: #6ee7b7; --phb: #f0fdfa; }
.print-theme-5 { --pa: #d97706; --pad: #92400e; --pal: #fffbeb; --pb: #fcd34d; --phb: #ffffff; }
.print-theme-6 { --pa: #7c3aed; --pad: #5b21b6; --pal: #f5f3ff; --pb: #c4b5fd; --phb: #ffffff; }
@media print {
    .print-only { display: block !important; }
    .invoice-paper { display: block !important; }
    .sidebar, .topbar, .sidebar-overlay, .filters-bar, .no-print, .btn, .menu-toggle, .alert { display: none !important; }
    .main-area { margin: 0; } body { background: #fff; color: #000; font-size: 11pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .page-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid var(--pb) !important; }
    .table th, .table td { border: 1px solid #d5dbe0 !important; }
    .table thead th { background: var(--pa) !important; color: #fff !important; }
}
.print-header { display: none; } .print-footer { display: none; } .print-company-header { display: none; }
.design-live .print-company-header { display: flex; margin: 0; }
.design-live-frame { display: none; border: 2px solid var(--pb); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.design-live-frame.active { display: block; }

/* ===== تنبيهات ===== */
.alert-bell { position: relative; padding: 6px 10px; background: #fff; border: 1px solid var(--card-border); border-radius: 10px; box-shadow: var(--card-shadow); }
.alert-badge { position: absolute; top: -6px; left: -6px; background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; border-radius: 10px; font-size: 11px; min-width: 20px; height: 20px; line-height: 20px; padding: 0 6px; text-align: center; font-weight: 800; box-shadow: 0 2px 6px rgba(220,38,38,.3); }
.kpi-card { background: #fff; border: 1px solid var(--card-border); border-radius: 12px; padding: 18px; }
.kpi-card .kpi-value { font-size: 22px; font-weight: 800; color: var(--primary-dark); }
.kpi-card .kpi-label { color: var(--text-dim); font-size: 12.5px; margin-top: 4px; font-weight: 600; }
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.6); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 1050; padding: 16px; }
.modal-overlay.show { display: flex; }
.modal-box { background: #fff; border-radius: 16px; width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 64px rgba(15,23,42,.3); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #f1f5f9; font-weight: 800; }

/* تحسين سكرول وطباعة */
.page-content::-webkit-scrollbar { width: 6px; }

/* ===== رسوم متحركة + تحسينات GUI v3 ===== */

/* تأثير hover على البطاقات */
.card { transition: transform .2s ease, box-shadow .25s ease, border-color .25s ease; }
.card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); }

/* تأثير hover على الأزرار */
.btn { transition: all .2s cubic-bezier(.4,0,.2,1); position: relative; overflow: hidden; }
.btn:active { transform: scale(.97); }
.btn-primary { box-shadow: 0 2px 8px rgba(15,118,110,.25); }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(15,118,110,.35); transform: translateY(-1px); }
.btn-danger { box-shadow: 0 2px 8px rgba(220,38,38,.2); }
.btn-danger:hover { box-shadow: 0 4px 16px rgba(220,38,38,.3); }
.btn-success { box-shadow: 0 2px 8px rgba(5,150,105,.2); }
.btn-success:hover { box-shadow: 0 4px 16px rgba(5,150,105,.3); }

/* تأثير على صفوف الجدول */
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: #f0fdfa; }

/* تأثير على Badges */
.badge { transition: transform .15s ease; display: inline-block; }
.badge:hover { transform: scale(1.08); }

/* شريط تحميل علوي */
.loading-bar { position: fixed; top: 0; left: 0; width: 0; height: 3px; background: linear-gradient(90deg, var(--primary), #14b8a6, var(--accent)); z-index: 9999; transition: width .3s ease; box-shadow: 0 0 8px rgba(15,118,110,.4); }
.loading-bar.active { width: 70%; }
.loading-bar.done { width: 100%; opacity: 0; transition: width .2s ease, opacity .4s ease .2s; }

/* Toast notification */
.toast-container { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); z-index: 10000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 24px; border-radius: 12px; color: #fff; font-weight: 700; font-size: 13.5px; box-shadow: 0 8px 32px rgba(0,0,0,.2); backdrop-filter: blur(12px); pointer-events: auto; animation: toastIn .35s cubic-bezier(.4,0,.2,1); display: flex; align-items: center; gap: 8px; }
.toast.success { background: rgba(5,150,105,.92); border: 1px solid rgba(5,150,105,.3); }
.toast.error { background: rgba(220,38,38,.92); border: 1px solid rgba(220,38,38,.3); }
.toast.warning { background: rgba(217,119,6,.92); border: 1px solid rgba(217,119,6,.3); }
.toast.info { background: rgba(15,118,110,.92); border: 1px solid rgba(15,118,110,.3); }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px) scale(.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-20px) scale(.9); } }

/* رسم بياني للإحصائيات */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 14px; box-shadow: var(--card-shadow); transition: all .25s ease; cursor: default; }
.stat-card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-2px); border-color: var(--primary-light); }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.stat-icon.green { background: linear-gradient(135deg, #ecfdf5, #d1fae5); }
.stat-icon.red { background: linear-gradient(135deg, #fef2f2, #fecaca); }
.stat-icon.blue { background: linear-gradient(135deg, #eff6ff, #bfdbfe); }
.stat-icon.purple { background: linear-gradient(135deg, #f5f3ff, #ddd6fe); }
.stat-icon.orange { background: linear-gradient(135deg, #fffbeb, #fde68a); }
.stat-value { font-size: 20px; font-weight: 800; color: var(--text-main); line-height: 1.2; }
.stat-value.money { font-family: 'Cairo', monospace; letter-spacing: -.3px; }
.stat-label { font-size: 12.5px; color: var(--text-dim); font-weight: 600; margin-top: 2px; }

/* نموذج البحث */
.form-control, .form-select { border-radius: var(--radius-sm); border: 1.5px solid var(--card-border); padding: 10px 14px; font-size: 13.5px; transition: border-color .2s, box-shadow .2s; background: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); outline: none; }

/* بطاقات الجودة */
.qc-card { border-radius: var(--radius); padding: 16px; text-align: center; transition: all .2s ease; }
.qc-card:hover { transform: translateY(-2px); }

/* شريط التقدم */
.progress-bar { height: 8px; border-radius: 4px; background: #e2e8f0; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 4px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.progress-bar-fill.green { background: linear-gradient(90deg, #059669, #10b981); }
.progress-bar-fill.yellow { background: linear-gradient(90deg, #d97706, #f59e0b); }
.progress-bar-fill.red { background: linear-gradient(90deg, #dc2626, #ef4444); }

/* نبض للتنبيهات المهمة */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
.pulse { animation: pulse 2s infinite; }

/* ظل متحرك للشعار */
@keyframes logoGlow { 0%, 100% { box-shadow: 0 4px 12px rgba(15,118,110,.35); } 50% { box-shadow: 0 4px 20px rgba(15,118,110,.5); } }
.sidebar-logo { animation: logoGlow 3s ease-in-out infinite; }

/* تأثير ripple على الأزرار */
.btn::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,.3) 0%, transparent 60%); opacity: 0; transition: opacity .3s; }
.btn:active::after { opacity: 1; }

/* شاشة تحميل */
.page-loader { position: fixed; inset: 0; background: rgba(248,250,252,.9); display: flex; align-items: center; justify-content: center; z-index: 9998; backdrop-filter: blur(4px); }
.page-loader .spinner { width: 40px; height: 40px; border: 4px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* تحسين الجداول الصغيرة */
.table td, .table th { padding: 10px 14px; font-size: 13px; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }

/* أنيميشن للعنوان */
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.page-title { animation: slideDown .4s ease; }

/* دعم RTL */
[dir="rtl"] .stat-card { flex-direction: row; }
[dir="rtl"] .stat-icon { margin-left: 0; margin-right: auto; }
