/* ============================================
   الجزء ده هو نفس الـ CSS الأصلي اللي كان في ملفك
   2-index.html بالظبط، من غير أي تغيير في أي قاعدة
   ============================================ */

:root {
    --primary-color: #000066;
    --primary-hover: #000044;
    --accent-orange: #f29100;
    --background: #0a0a23;
    --card-bg: #ffffff;
    --text-main: #000066;
    --text-muted: #475569;
    --border: #cbd5e1;
    --alert-bg: #fef2f2;
    --alert-border: #ef4444;
    --alert-text: #991b1b;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-main);
    margin: 0;
    padding: 80px 20px 30px;
    background-color: var(--background);
    background-image: 
        radial-gradient(rgba(242, 145, 0, 0.15) 1px, transparent 0),
        linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px, 20px 20px, 20px 20px;
    background-position: 0 0, 10px 10px, 10px 10px;
}

.dashboard-card {
    background: var(--card-bg);
    max-width: 1150px; 
    margin: 0 auto;
    padding: 35px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.header-section {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.brand-info { float: right; }
.brand-logo { max-width: 160px; height: auto; vertical-align: middle; margin-left: 20px; }
.header-text { display: inline-block; vertical-align: middle; border-right: 3px solid var(--accent-orange); padding-right: 15px; }
.header-text h1 { font-size: 26px; margin: 0 0 5px 0; color: var(--primary-color); font-weight: 800; }
.header-text p { font-size: 14px; margin: 0; color: var(--text-muted); }

.live-clock-container {
    float: left; text-align: left; font-family: 'Courier New', Courier, monospace;
    background: #f1f5f9; padding: 10px 15px; border-radius: 10px;
    border: 1px solid var(--border); color: var(--primary-color); font-weight: bold;
}
.live-clock-container #clock { font-size: 18px; letter-spacing: 1px; display: block; }
.live-clock-container #date { font-size: 11px; color: var(--text-muted); font-family: 'Segoe UI', sans-serif; }

.clearfix { clear: both; }
.form-row { margin-bottom: 10px; }
.form-group { box-sizing: border-box; float: right; padding-left: 15px; margin-bottom: 20px; }
.w-33 { width: 33.33%; } .w-50 { width: 50%; } .w-100 { width: 100%; }

label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; color: var(--primary-color); }
input, select, textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
    box-sizing: border-box; font-size: 15px; background-color: #f8fafc; color: #0f172a; transition: all 0.2s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0, 0, 102, 0.15); background-color: #fff; }
textarea { resize: none; height: 120px; }

.outsourcing-box {
    background: #fff8f0; padding: 25px; border-radius: 12px; border: 2px dashed var(--accent-orange); margin: 25px 0; clear: both; box-shadow: 0 4px 12px rgba(242, 145, 0, 0.05);
}
.toggle-container { display: flex; align-items: center; gap: 15px; cursor: pointer; user-select: none; }
.switch { position: relative; display: inline-block; width: 55px; height: 28px; flex-shrink: 0; }
.switch input {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .3s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .3s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--accent-orange); }
input:checked + .slider:before { transform: translateX(-27px); }
.switch-text-block h4 { margin: 0 0 3px 0; font-size: 15px; color: #7c2d12; font-weight: 700; }
.switch-text-block p { margin: 0; font-size: 12px; color: #b45309; }

.supplier-fields { display: none; margin-top: 25px; border-top: 1px dashed rgba(242, 145, 0, 0.3); padding-top: 20px; }

.notice-bar { background-color: var(--alert-bg); border: 1px solid #fca5a5; border-right: 5px solid var(--alert-border); padding: 16px 20px; border-radius: 8px; margin: 25px 0; clear: both; }
.notice-bar p { margin: 0; font-size: 15px; color: var(--alert-text); font-weight: 700; line-height: 1.6; }

.actions-section { border-top: 1px solid #e2e8f0; padding-top: 25px; text-align: left; clear: both; }
.submit-btn { background-color: var(--primary-color); color: white; padding: 14px 45px; border: none; border-radius: 8px; cursor: pointer; font-size: 16px; font-weight: bold; box-shadow: 0 4px 12px rgba(0, 0, 102, 0.2); transition: all 0.2s ease; }
.submit-btn:hover { background-color: var(--primary-hover); transform: translateY(-1px); }
.submit-btn:disabled { background-color: #cbd5e1; cursor: not-allowed; }

@media (max-width: 768px) {
    .w-33, .w-50, .w-100 { width: 100%; padding-left: 0; }
    .brand-info, .live-clock-container { float: none; text-align: center; width: 100%; margin-bottom: 15px; }
    .header-text { border-right: none; border-top: 2px solid var(--accent-orange); padding-top: 10px; margin-top: 10px; }
    .actions-section { text-align: center; } .submit-btn { width: 100%; }
}

/* ============================================
   من هنا تحت: إضافات جديدة فقط (تسجيل دخول / قائمة /
   شريط تنقل) — مبنية بنفس الألوان والخط والأسلوب اللي
   فوق، من غير ما تلمس أي قاعدة من اللي فوق
   ============================================ */

.topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    width: 100%;
    box-sizing: border-box;
    padding: 0 28px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 0;
    height: 64px;
    background: rgba(10, 10, 35, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

/* ============================================
   تخطيط الصفحة الرئيسية (أوردرات + لوحة الأداء)
   ============================================ */
.page-layout {
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
.page-layout > .dashboard-card {
    flex: 1;
    min-width: 0;
    max-width: none;
    margin: 0;
}
.leaderboard-column {
    width: 340px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 16px;
    align-self: flex-start;
    height: calc(100vh - 110px);
    max-height: calc(100vh - 110px);
}
.leaderboard-column .leaderboard-panel:first-of-type {
    flex: 1;
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.leaderboard-column .leaderboard-panel:first-of-type #leaderboardList {
    overflow-y: auto;
    flex: 1;
}
.leaderboard-column .leaderboard-panel:last-of-type {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.leaderboard-column .leaderboard-panel:last-of-type #designLeaderboardList {
    overflow-y: auto;
}
.track-column {
    width: 340px;
    flex-shrink: 0;
    position: sticky;
    top: 16px;
    align-self: flex-start;
    max-height: calc(100vh - 110px);
    display: flex;
}
.track-column .leaderboard-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.track-column .leaderboard-panel {
    background: #0f0f2e;
    border: 1px solid rgba(255,255,255,0.08);
}
.track-column .lb-title { color: #fff; }
.track-column .lb-period { color: rgba(255,255,255,.45); }
.track-column .lb-updated { color: rgba(255,255,255,.3); }
.track-column .lb-updated a { color: rgba(255,255,255,.5) !important; }
.track-column .lb-section-divider { background: rgba(255,255,255,0.1); }

/* تصميم كروت لوحة المكافآت — مطابق لشاشة العرض الخارجية بالضبط */
.leaderboard-column .leaderboard-panel { background: #0f0f2e; border: 1px solid rgba(255,255,255,.08); }
.leaderboard-column .lb-title { color: #fff; }
.leaderboard-column .lb-period { color: rgba(255,255,255,.45); }
.leaderboard-column .lb-updated { color: rgba(255,255,255,.3); }
.leaderboard-column .lb-section-divider { background: rgba(255,255,255,0.1); }

.disp-card {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}
.disp-card::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; right: 0;
    width: 4px;
    border-radius: 0 16px 16px 0;
}
.disp-card.rank-gold   { border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.07); }
.disp-card.rank-gold::before   { background: #fbbf24; }
.disp-card.rank-silver { border-color: rgba(148,163,184,.3); background: rgba(148,163,184,.07); }
.disp-card.rank-silver::before { background: #94a3b8; }
.disp-card.rank-bronze { border-color: rgba(205,127,50,.3);  background: rgba(205,127,50,.07); }
.disp-card.rank-bronze::before { background: #cd7f32; }
.disp-card.rank-normal::before { background: rgba(255,255,255,.12); }

.disp-medal    { font-size: 28px; line-height: 1; min-width: 36px; text-align: center; flex-shrink: 0; }
.disp-rank-num {
    min-width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,.08); color: rgba(255,255,255,.5);
    font-size: 14px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.disp-info { flex: 1; min-width: 0; }
.disp-name {
    font-size: 14px; font-weight: 900; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 4px;
}
.disp-meta { font-size: 11px; color: rgba(255,255,255,.4); margin-bottom: 7px; }
.disp-bar-wrap { height: 5px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.disp-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg,#000066,#f29100); transition: width .8s ease; }
.rank-gold   .disp-bar { background: linear-gradient(90deg,#f59e0b,#fde047); }
.rank-silver .disp-bar { background: linear-gradient(90deg,#64748b,#94a3b8); }
.rank-bronze .disp-bar { background: linear-gradient(90deg,#92400e,#d97706); }

.disp-pts { text-align: center; flex-shrink: 0; min-width: 60px; }
.disp-pts-num { font-size: 26px; font-weight: 900; line-height: 1; color: #f29100; }
.rank-gold   .disp-pts-num { color: #fbbf24; }
.rank-silver .disp-pts-num { color: #94a3b8; }
.rank-bronze .disp-pts-num { color: #cd7f32; }
.disp-pts-label { font-size: 10px; color: rgba(255,255,255,.35); margin-top: 2px; }
.leaderboard-panel {
    width: 100%;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.12);
    box-sizing: border-box;
}
.lb-section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    margin: 14px 12px;
}
.lb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}
.lb-title { font-size: 15px; font-weight: 800; color: var(--primary-color); }
.lb-pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,.25);
    animation: pulse-ring 1.5s ease infinite;
    flex-shrink: 0;
}
@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.55); }
    70%  { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.lb-period {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 12px;
}
.lb-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid transparent;
    transition: background .2s;
}
.lb-row:hover { background: rgba(255,255,255,0.08); }
.lb-gold   { border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.07); }
.lb-silver { border-color: rgba(148,163,184,.3);  background: rgba(148,163,184,.06); }
.lb-bronze { border-color: rgba(180,120,60,.3);   background: rgba(180,120,60,.06); }
.lb-medal  { font-size: 20px; line-height: 1; flex-shrink: 0; padding-top: 2px; }
.lb-rank-num {
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: var(--text-muted);
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 3px;
}
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 13px; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; }
.lb-bar-wrap { height: 5px; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden; margin-bottom: 5px; }
.lb-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-orange), #f59e0b); transition: width .6s ease; }
.lb-gold   .lb-bar { background: linear-gradient(90deg,#fbbf24,#f59e0b); }
.lb-silver .lb-bar { background: linear-gradient(90deg,#94a3b8,#64748b); }
.lb-bronze .lb-bar { background: linear-gradient(90deg,#cd7f32,#a0522d); }
.lb-stats { font-size: 11px; color: var(--text-muted); }
.lb-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 24px 0; }
.lb-updated { font-size: 10px; color: var(--text-muted); text-align: center; margin-top: 10px; }

.lb-track-row {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 9px 11px;
    margin-bottom: 7px;
    cursor: pointer;
    transition: background .15s;
}
.lb-track-row:hover { background: rgba(255,255,255,0.1); }
.lb-track-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lb-track-num { font-size: 11px; font-weight: 900; color: #f97316; direction: ltr; }
.lb-track-name { font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: right; }
.lb-track-rem { font-size: 11px; margin-top: 4px; font-weight: 700; }
.lb-track-row.lb-track-ok     .lb-track-rem { color: #4ade80; }
.lb-track-row.lb-track-soon   .lb-track-rem { color: #fbbf24; }
.lb-track-row.lb-track-warn   .lb-track-rem { color: #fb923c; }
.lb-track-row.lb-track-urgent .lb-track-rem { color: #f87171; }
.lb-track-row.lb-track-late   .lb-track-rem { color: #ef4444; }
.lb-track-row.lb-track-urgent,
.lb-track-row.lb-track-late { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.08); }

.track-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 11px;
    display: flex;
    align-items: center;
    gap: 13px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .3s;
}
.track-card::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; right: 0;
    width: 4px;
    border-radius: 0 14px 14px 0;
}
.track-card.oc-safe   { border-color: rgba(34,197,94,.25);  background: rgba(34,197,94,.05); }
.track-card.oc-safe::before   { background: #22c55e; }
.track-card.oc-ok     { border-color: rgba(59,130,246,.25); background: rgba(59,130,246,.05); }
.track-card.oc-ok::before     { background: #3b82f6; }
.track-card.oc-soon   { border-color: rgba(234,179,8,.3);   background: rgba(234,179,8,.06); }
.track-card.oc-soon::before   { background: #eab308; }
.track-card.oc-warn   { border-color: rgba(249,115,22,.35); background: rgba(249,115,22,.08); }
.track-card.oc-warn::before   { background: #f97316; }
.track-card.oc-urgent { border-color: rgba(239,68,68,.4);   background: rgba(239,68,68,.09); animation: track-flash 1.4s ease infinite; }
.track-card.oc-urgent::before { background: #ef4444; }
.track-card.oc-late   { border-color: rgba(239,68,68,.5);   background: rgba(239,68,68,.12); animation: track-flash .9s ease infinite; }
.track-card.oc-late::before   { background: #dc2626; }
@keyframes track-flash {
    0%,100% { border-color: rgba(239,68,68,.5); }
    50%      { border-color: rgba(239,68,68,.15); }
}
.track-num-badge {
    min-width: 46px; height: 46px; border-radius: 11px;
    background: rgba(255,255,255,.07);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    flex-shrink: 0; gap: 1px;
}
.track-num-badge .ord-hash { font-size: 9px; color: rgba(255,255,255,.35); font-weight: 700; }
.track-num-badge .ord-num  { font-size: 14px; font-weight: 900; color: #f29100; line-height: 1; }
.track-info { flex: 1; min-width: 0; }
.track-customer {
    font-size: 14px; font-weight: 900; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: 4px;
}
.track-type-date { font-size: 11px; color: rgba(255,255,255,.4); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-delivery-col { text-align: center; flex-shrink: 0; min-width: 50px; }
.track-delivery-day   { font-size: 17px; font-weight: 900; color: rgba(255,255,255,.7); line-height: 1; }
.track-delivery-month { font-size: 10px; color: rgba(255,255,255,.35); margin-top: 2px; }
.track-rem-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}
.rem-late   { background: rgba(220,38,38,.3);   color: #fca5a5; }
.rem-urgent { background: rgba(239,68,68,.22);   color: #fca5a5; }
.rem-warn   { background: rgba(249,115,22,.22);  color: #fdba74; }
.rem-soon   { background: rgba(234,179,8,.18);   color: #fde047; }
.rem-ok     { background: rgba(59,130,246,.18);  color: #93c5fd; }
.rem-safe   { background: rgba(34,197,94,.16);   color: #86efac; }

.track-viewport {
    flex: 1;
    min-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.25) transparent;
}
.track-viewport::-webkit-scrollbar { width: 6px; }
.track-viewport::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 10px; }
.track-viewport::-webkit-scrollbar-track { background: transparent; }
.track-track {
    will-change: transform;
}

.mini-track-overlay {
    display: none;
    position: fixed; inset: 0; background: rgba(0,0,20,.55);
    z-index: 99999; align-items: center; justify-content: center; padding: 18px;
}
.mini-track-overlay.open { display: flex; }
.mini-track-box {
    background: #fff; border-radius: 18px; width: min(360px, 100%);
    padding: 24px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.35);
    text-align: center;
}
.mini-track-close {
    position: absolute; top: 10px; left: 12px; background: none; border: none;
    font-size: 22px; color: #94a3b8; cursor: pointer; line-height: 1;
}
.mini-track-num { font-size: 22px; font-weight: 900; color: #f97316; margin-bottom: 14px; direction: ltr; }
.mini-track-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.mini-track-row span { color: #6b7280; }
.mini-track-row strong { color: #1f2937; }
.mini-track-rem { margin: 14px 0; font-size: 16px; font-weight: 900; }
.mini-track-rem.rem-ok     { color: #16a34a; }
.mini-track-rem.rem-safe   { color: #15803d; }
.mini-track-rem.rem-soon   { color: #ca8a04; }
.mini-track-rem.rem-warn   { color: #ea580c; }
.mini-track-rem.rem-urgent { color: #dc2626; }
.mini-track-rem.rem-late   { color: #b91c1c; }
.mini-track-done {
    width: 100%; background: #059669; color: #fff; border: none; border-radius: 10px;
    padding: 11px; font-weight: 800; cursor: pointer; font-family: inherit; margin-bottom: 8px;
}
.mini-track-done:disabled { opacity: .6; cursor: not-allowed; }
.mini-track-go {
    width: 100%; background: #000066; color: #fff; border: none; border-radius: 10px;
    padding: 11px; font-weight: 800; cursor: pointer; font-family: inherit;
}
@media (max-width: 900px) {
    .page-layout { flex-direction: column; }
    .leaderboard-column { width: 100%; position: static; max-height: none; }
    .leaderboard-panel { width: 100%; }
    .leaderboard-column .leaderboard-panel:first-of-type,
    .leaderboard-column .leaderboard-panel:last-of-type {
        height: 46vh;
        max-height: 46vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .leaderboard-column .leaderboard-panel:first-of-type #leaderboardList,
    .leaderboard-column .leaderboard-panel:last-of-type #designLeaderboardList {
        flex: 1;
        overflow-y: auto;
    }
    .track-column { width: 100%; position: static; max-height: none; }
    .track-column .leaderboard-panel { height: 60vh; }
}
.topnav-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 28px;
}
.topnav-logo img {
    height: 34px;
    width: auto;
    object-fit: contain;
}
.topnav-links {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    justify-content: center;
    flex-wrap: nowrap;
}

/* خط فاصل أبيض بين كل قائمة */
.topnav a.nav-link {
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 700;
    padding: 7px 11px;
    border-radius: 0;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.13);
    white-space: nowrap;
    transition: color .18s, background .18s, box-shadow .25s;
    letter-spacing: 0.01em;
    position: relative;
    flex-shrink: 0;
}
.topnav a.nav-link:first-child { border-left: none; }

/* وميض أورنج عند التحويم */
@keyframes nav-orange-glow {
    0%   { box-shadow: inset 0 0 0 rgba(249,115,22,0); }
    40%  { box-shadow: inset 0 -3px 14px rgba(249,115,22,0.45); }
    100% { box-shadow: inset 0 -3px 8px rgba(249,115,22,0.22); }
}
.topnav a.nav-link:hover {
    color: #fb923c;
    background: rgba(249,115,22,0.1);
    animation: nav-orange-glow .3s ease forwards;
}

/* القائمة الحالية */
.topnav a.nav-link.active {
    color: var(--accent-orange);
    background: rgba(251,146,60,0.1);
    position: relative;
}
.topnav a.nav-link.active::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-orange);
    border-radius: 2px 2px 0 0;
}

/* ===== القوائم المنسدلة في الشريط العلوي ===== */
.nav-dropdown { position: relative; flex-shrink: 0; }
.nav-dropdown-btn {
    background: none; border: none; border-left: 1px solid rgba(255,255,255,0.13);
    color: rgba(255,255,255,0.78); font-size: 14px; font-weight: 700; padding: 0 17px;
    height: 64px; cursor: pointer; font-family: inherit; white-space: nowrap;
    transition: color .18s, background .18s;
}
.nav-dropdown-btn:hover, .nav-dropdown.open .nav-dropdown-btn { color: #fb923c; background: rgba(251,146,60,0.08); }
.nav-dropdown-btn.active { color: var(--accent-orange); }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: #0a0a23;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 14px 30px rgba(0,0,0,.4);
    z-index: 9999;
    padding: 6px 0;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: 11px 18px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: rgba(255,255,255,0.07); color: #fff; }

/* ===== تثبيت رأس بطاقة الأوردرات + سكرول داخلي للقائمة ===== */
.dashboard-card-scrollable {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 100px);
    overflow: hidden;
}
.dashboard-card-fixed-top { flex-shrink: 0; }
.dashboard-card-scroll-area {
    overflow-y: auto;
    flex: 1;
    padding-left: 4px;
}
.dashboard-card-scroll-area::-webkit-scrollbar { width: 6px; }
.dashboard-card-scroll-area::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 10px; }

/* تمييز زرار المكافآت */
@keyframes rewards-shimmer {
    0%, 100% { color: #fbbf24; text-shadow: 0 0 6px rgba(251,191,36,0.35); }
    50%       { color: #fcd34d; text-shadow: 0 0 14px rgba(251,191,36,0.7); }
}
.topnav a.nav-link.rewards-link:not(.active) {
    animation: rewards-shimmer 2.5s ease-in-out infinite;
}
.topnav a.nav-link.rewards-link.active {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251,191,36,0.5);
}
.topnav-user {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
    margin-right: 28px;
}
.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 2px 4px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    max-width: 160px;
}
.profile-chip:hover,
.profile-chip:focus-visible {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    outline: none;
}
.profile-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
    font-size: 13px;
}
.profile-avatar,
.profile-photo-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--accent-orange);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    border: 2px solid rgba(255,255,255,0.85);
}
.profile-avatar img,
.profile-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.role-pill {
    font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
    background: rgba(242,145,0,0.18); color: var(--accent-orange); border: 1px solid rgba(242,145,0,0.4);
    white-space: nowrap;
}
.role-pill.employee { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.3); }
.logout-link {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 7px;
    padding: 5px 11px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.logout-link:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.06); }

/* صفحة تسجيل الدخول: نفس الكارت الأصلي بس بعرض أصغر */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.dashboard-card.login-card { max-width: 400px; text-align: center; }
.login-card .brand-logo { max-width: 130px; margin: 0 auto 20px; display: block; }
.login-card h1 { font-size: 20px; color: var(--primary-color); font-weight: 800; margin: 0 0 6px; }
.login-card p.sub { font-size: 13px; color: var(--text-muted); margin: 0 0 24px; }
.login-card .field { text-align: right; margin-bottom: 16px; }
.error-box {
    background: var(--alert-bg); border: 1px solid #fca5a5; border-right: 5px solid var(--alert-border);
    color: var(--alert-text); font-size: 13px; font-weight: 700; padding: 10px 14px; border-radius: 8px;
    margin-bottom: 16px; display: none; text-align: right;
}

/* صفحة قائمة الأوردرات */
.list-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; clear: both; }
.list-toolbar input, .list-toolbar select { width: auto; }
.list-toolbar .grow { flex: 1; min-width: 180px; }
.list-toolbar .spacer { flex: 1; }
.orders-count { color: var(--text-muted); font-size: 13px; }

.order-row {
    border: 1px solid var(--border);
    border-right: 5px solid var(--primary-color);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 14px;
}
.order-row.is-outsourced { border-right-color: var(--accent-orange); }
.order-row.is-shipping {
    border-right-color: #0d9488;
    background: linear-gradient(135deg, #f0fdfa 0%, #fff 14%);
}
.shipping-badge {
    background: #f0fdfa; color: #0f766e; border: 1px solid #5eead4;
    font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 20px;
}
.order-row-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.order-row-client { font-weight: 800; font-size: 16px; color: var(--text-main); }
.order-row-phone { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-family: 'Courier New', monospace; }
.order-row-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.badge { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 20px; border: 1px solid; }
.badge-design { background: #eef2ff; color: var(--primary-color); border-color: #c7d2fe; }
.badge-outsource { background: #fff8f0; color: #b45309; border-color: var(--accent-orange); }
.badge-status-pending { background: #f1f5f9; color: var(--text-muted); border-color: var(--border); }
.badge-status-progress { background: #fff8f0; color: #b45309; border-color: var(--accent-orange); }
.badge-status-ready { background: #ecfdf5; color: #047857; border-color: #6ee7b7; }
.badge-status-delivered { background: #ecfdf5; color: #065f46; border-color: #34d399; }
.badge-status-cancelled { background: var(--alert-bg); color: var(--alert-text); border-color: var(--alert-border); text-decoration: line-through; }

.order-row-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
}
.order-row-grid .lbl { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.order-row-grid .val { font-size: 13px; font-weight: 700; color: var(--text-main); }
.order-row-note { margin-top: 10px; font-size: 12px; color: var(--text-muted); background: #f8fafc; border-radius: 8px; padding: 8px 12px; }
.order-row-actions { display: flex; gap: 8px; }
.btn-sm {
    font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 7px; cursor: pointer; border: 1px solid;
}
.btn-sm.edit { background: #eef2ff; color: var(--primary-color); border-color: #c7d2fe; }
.btn-sm.delete { background: var(--alert-bg); color: var(--alert-text); border-color: #fca5a5; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* نافذة التعديل (للمدير) */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,10,35,.6); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-backdrop.open { display: flex; }
.modal-backdrop .dashboard-card { max-width: 640px; max-height: 88vh; overflow-y: auto; }
.modal-backdrop .dashboard-card h3 { font-size: 18px; color: var(--primary-color); font-weight: 800; margin: 0 0 18px; }
#previewModal { z-index: 700; }
.profile-modal-backdrop { z-index: 850; }
.profile-modal-card { max-width: 720px !important; }

/* ===== تبويبات البروفايل ===== */
.profile-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}
.ptab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    font-family: inherit;
}
.ptab-btn:hover { color: var(--primary-color); }
.ptab-btn.active {
    color: var(--accent-orange);
    border-bottom-color: var(--accent-orange);
}

/* ===== قائمة العملاء ===== */
.customers-mgmt { display: flex; flex-direction: column; gap: 12px; }
.cust-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.cust-search-input {
    flex: 1;
    min-width: 160px;
    padding: 8px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
}
.cust-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}
.cust-row:last-child { border-bottom: none; }
.cust-row:hover { background: #f8fafc; }
.cust-info { display: flex; flex-direction: column; gap: 2px; }
.cust-name { font-size: 14px; font-weight: 700; color: var(--primary-color); }
.cust-phone { font-size: 12px; color: #6b7280; direction: ltr; text-align: right; }
.cust-del-btn {
    background: none;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    color: #ef4444;
    transition: background .12s;
    flex-shrink: 0;
}
.cust-del-btn:hover { background: #fee2e2; }
.profile-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

/* ===== كروت الملخص الفخمة ===== */
.lux-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}
.lux-card {
    position: relative;
    border-radius: 18px;
    padding: 18px 20px;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(0,0,30,.18);
}
.lux-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 90% -10%, rgba(255,255,255,.22), transparent 60%);
}
.lux-card-icon { font-size: 26px; margin-bottom: 6px; }
.lux-card-label { font-size: 11.5px; font-weight: 700; opacity: .85; }
.lux-card-value { font-size: 21px; font-weight: 900; margin-top: 4px; letter-spacing: .2px; }
.lux-salary { background: linear-gradient(135deg, #064e3b, #059669); }
.lux-loans  { background: linear-gradient(135deg, #7c2d12, #ea580c); }
.lux-points { background: linear-gradient(135deg, #1e1b4b, #6d28d9); }
.lux-absence { background: linear-gradient(135deg, #7f1d1d, #dc2626); }

.lux-net-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 18px;
}
.lux-net-title { font-size: 13px; font-weight: 900; color: #000066; margin-bottom: 10px; }
.lux-net-breakdown { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.lux-net-line { display: flex; justify-content: space-between; font-size: 12px; color: #4b5563; }
.lux-net-line span:last-child { font-weight: 800; }
.lux-net-line.neg span:last-child { color: #dc2626; }
.lux-net-line.pos span:last-child { color: #059669; }
.lux-net-total {
    text-align: center; font-size: 22px; font-weight: 900; color: #000066;
    border-top: 1px dashed #cbd5e1; padding-top: 10px;
}

/* ===== كل الموظفين (أدمن/مدير) ===== */
.all-emp-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.all-emp-toolbar input {
    flex: 1; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 9px; font-size: 13px; font-family: inherit;
}
.all-emp-toolbar button {
    background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 9px; padding: 9px 16px;
    font-size: 12.5px; font-weight: 800; cursor: pointer; font-family: inherit;
}
table.all-emp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.all-emp-table th { background: #000066; color: #fff; padding: 9px 8px; text-align: right; font-size: 11px; }
.all-emp-table td { padding: 9px 8px; border-bottom: 1px solid #f1f5f9; }
.all-emp-role { font-size: 10px; color: #9ca3af; }
.all-emp-view-btn {
    background: #eef2ff; color: #3730a3; border: none; border-radius: 7px;
    padding: 6px 10px; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap;
}

.salary-adjust-panel { border: 1.5px solid #e5e7eb; border-radius: 14px; padding: 16px; background: #fff; }
.salary-adjust-panel h4 { margin: 0 0 6px; color: #000066; font-size: 15px; }
.salary-adjust-panel p { margin: 0 0 14px; color: #6b7280; font-size: 12px; }
.salary-adjust-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.salary-adjust-panel label { display: block; color: #000066; font-size: 12px; font-weight: 900; margin-bottom: 10px; }
.salary-adjust-panel input,
.salary-adjust-panel select,
.salary-adjust-panel textarea { width: 100%; box-sizing: border-box; margin-top: 6px; border: 1.5px solid #d1d5db; border-radius: 10px; padding: 10px; font-family: inherit; font-size: 13px; }
.salary-adjust-panel textarea { resize: vertical; }
#salaryAdjustmentBtn { border: none; background: #000066; color: #fff; border-radius: 12px; padding: 12px 20px; font-family: inherit; font-weight: 900; cursor: pointer; }
.salary-adjust-status { margin-top: 10px; border-radius: 10px; padding: 10px; font-size: 12px; font-weight: 800; }
.salary-adjust-list { margin-top: 16px; display: grid; gap: 10px; }
.salary-adjust-empty { text-align: center; color: #6b7280; border: 1px dashed #d1d5db; border-radius: 12px; padding: 16px; font-size: 12px; }
.salary-adjust-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #e5e7eb; border-right: 5px solid #059669; border-radius: 12px; padding: 12px; background: #f8fafc; }
.salary-adjust-item.deduction { border-right-color: #dc2626; }
.salary-adjust-item strong { display: block; color: #111827; font-size: 13px; }
.salary-adjust-item span { display: block; color: #4b5563; font-size: 12px; margin-top: 3px; }
.salary-adjust-item small { display: block; color: #9ca3af; font-size: 11px; margin-top: 4px; }
.salary-adjust-item button { border: 1px solid #fecaca; background: #fff1f2; color: #b91c1c; border-radius: 8px; padding: 7px 10px; font-family: inherit; font-weight: 900; cursor: pointer; }

@media (max-width: 640px) {
    .lux-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .salary-adjust-grid { grid-template-columns: 1fr; }
}

.lux-timeline {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 20px;
    max-height: 160px;
    overflow-y: auto;
}
.lux-timeline-item { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; border-bottom: 1px solid #eef2f7; }
.lux-timeline-item:last-child { border-bottom: none; }
.lux-timeline-dot { width: 7px; height: 7px; border-radius: 50%; background: #6d28d9; margin-top: 6px; flex-shrink: 0; }
.lux-timeline-msg { font-size: 12.5px; font-weight: 700; color: #1f2937; line-height: 1.5; }
.lux-timeline-time { font-size: 10.5px; color: #94a3b8; margin-top: 2px; }
.lux-timeline-empty { text-align: center; font-size: 12px; color: #94a3b8; padding: 8px 0; }

/* ===== قفل البيانات الحساسة ===== */
.lux-lock-gate {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 22px;
    text-align: center;
    margin-bottom: 20px;
}
.lux-lock-icon { font-size: 30px; margin-bottom: 8px; }
.lux-lock-text { font-size: 12.5px; color: #6b7280; margin: 0 0 14px; max-width: 380px; margin-inline: auto; line-height: 1.6; }
.lux-lock-row { display: flex; gap: 8px; justify-content: center; max-width: 320px; margin: 0 auto; }
.lux-lock-row input {
    flex: 1; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 13px; font-family: inherit;
}
.lux-lock-row button {
    background: linear-gradient(135deg,#000066,#1d2b8c); color: #fff; border: none;
    border-radius: 10px; padding: 10px 18px; font-weight: 800; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.lux-lock-error { color: #b91c1c; font-size: 12px; font-weight: 700; margin-top: 10px; }

/* ===== بوب أب احتفالي بالنقط ===== */
.points-popup-overlay {
    position: fixed; inset: 0; background: rgba(10,10,35,.75);
    display: flex; align-items: center; justify-content: center;
    z-index: 99999; animation: pointsFadeIn .25s ease;
}
@keyframes pointsFadeIn { from { opacity: 0; } to { opacity: 1; } }
.points-popup-card {
    background: linear-gradient(160deg, #1e1b4b, #6d28d9 55%, #f59e0b);
    border-radius: 24px; padding: 36px 30px; max-width: 360px; width: 90%;
    text-align: center; color: #fff; box-shadow: 0 30px 70px rgba(0,0,0,.5);
    animation: pointsPopIn .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pointsPopIn { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.points-popup-confetti { font-size: 30px; margin-bottom: 4px; }
.points-popup-trophy { font-size: 52px; margin-bottom: 6px; }
.points-popup-num { font-size: 44px; font-weight: 900; color: #fde68a; }
.points-popup-label { font-size: 16px; font-weight: 800; margin: 2px 0 14px; }
.points-popup-msg { font-size: 13px; line-height: 1.7; opacity: .9; margin-bottom: 20px; }
.points-popup-close {
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.4);
    color: #fff; border-radius: 12px; padding: 10px 26px; font-weight: 800;
    font-size: 14px; cursor: pointer; font-family: inherit;
}
.points-popup-close:hover { background: rgba(255,255,255,.28); }

/* ===== زرار العين ===== */
.lux-eye-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
}
.lux-eye-label { font-size: 11px; color: #9ca3af; font-weight: 700; }
.lux-eye-btn {
    background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 50%;
    width: 32px; height: 32px; font-size: 15px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.lux-eye-btn:hover { background: #e2e8f0; }
.lux-blurred { filter: blur(7px); user-select: none; pointer-events: none; transition: filter .15s; }
.profile-modal-head h3 { margin-bottom: 4px !important; }
.profile-modal-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}
.profile-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}
.profile-photo-box {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}
.profile-photo-preview {
    width: 86px;
    height: 86px;
    font-size: 24px;
    border-color: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.profile-upload-label {
    display: inline-flex;
    width: auto;
    background: var(--primary-color);
    color: #fff;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    margin-bottom: 8px;
}
.profile-photo-box p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}
.profile-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.loader { text-align: center; padding: 50px; color: var(--text-muted); }

/* إضافات الإنتاج والصلاحيات والطباعة */
.btn-sm.print { background: #f8fafc; color: var(--primary-color); border-color: var(--border); }
.btn-sm.report { background: #fff8f0; color: #b45309; border-color: var(--accent-orange); }
.btn-sm.whatsapp { background: #25D366; color: #fff; border-color: #25D366; }
.btn-sm.readywa { background: #ff9800; color: #fff; border-color: #ff9800; font-weight: 800; }
.print-btn, .secondary-btn {
    background: #f8fafc;
    color: var(--primary-color);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 13px 24px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
    margin-left: 10px;
}
.print-btn:hover, .secondary-btn:hover { border-color: var(--accent-orange); color: #b45309; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
    clear: both;
}
.stat-box {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    background: #f8fafc;
}
.stat-box span {
    display: block;
    color: var(--accent-orange);
    font-size: 28px;
    font-weight: 900;
}
.stat-box small {
    color: var(--text-muted);
    font-weight: 700;
}

.user-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 220px auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border);
    border-right: 5px solid var(--primary-color);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}
.user-meta strong {
    display: block;
    color: var(--primary-color);
    font-size: 15px;
}
.user-meta span {
    display: inline-block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .print-btn, .secondary-btn { width: 100%; margin: 0 0 10px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .user-row { grid-template-columns: 1fr; }
    .profile-chip { max-width: 160px; }
    .profile-photo-box { align-items: flex-start; flex-direction: column; }
    .profile-actions { flex-direction: column-reverse; }
    .profile-actions .submit-btn,
    .profile-actions .secondary-btn { width: 100%; margin: 0; }
    .material-item-row { grid-template-columns: 1fr; }
    
/* ─── روابط الشركة (profile modal) ─── */
.company-links-section {
    border-top: 1.5px solid #e2e8f0;
    margin-top: 18px;
    padding-top: 16px;
}
.company-links-section h4 {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0 0 12px;
}
.company-link-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.company-link-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.company-link-row input {
    flex: 1;
    margin: 0;
    font-size: 13px;
    direction: ltr;
    text-align: left;
}
.copy-link-btn {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    color: #000066;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
    flex-shrink: 0;
}
.copy-link-btn:hover { background: #000066; color: #fff; border-color: #000066; }
.copy-link-btn.copied { background: #22c55e; color: #fff; border-color: #22c55e; }
.company-links-save-row {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

/* ─── Topnav: قايمة Hamburger للشاشات المتوسطة والصغيرة ─── */
.nav-hamburger {
    display: none;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 19px;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 10px;
    line-height: 1;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.16); }

@media (max-width: 760px) {
    .nav-hamburger { display: flex; }
    .topnav:has(.nav-hamburger) .topnav-links {
        display: none;
        position: fixed;
        top: 64px;
        right: 0;
        left: 0;
        flex-direction: column;
        align-items: stretch;
        background: rgba(8, 8, 30, 0.99);
        backdrop-filter: blur(10px);
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        padding: 6px 0 16px;
        z-index: 9998;
        box-shadow: 0 12px 30px rgba(0,0,0,.5);
    }
    .topnav-links.nav-open { display: flex; }
    .topnav a.nav-link {
        width: 100%;
        text-align: right;
        padding: 15px 24px;
        border-left: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        font-size: 14px;
    }
    .topnav a.nav-link:hover { background: rgba(255,255,255,0.06); }
}

/* ─── Topnav mobile ─── */
@media (max-width: 700px) {
    .topnav { padding: 0 12px; }
    .topnav-logo { margin-left: 8px; }
    .topnav-logo img { height: 26px; }
    .nav-hamburger { margin-left: 6px; width: 34px; height: 34px; font-size: 17px; }
    .topnav-user { margin-right: 0; gap: 4px; }
    #navUserName { display: none; }
    .role-pill { font-size: 10px; padding: 3px 7px; }
    .profile-chip-name { display: none; }
    .logout-link { padding: 4px 8px; font-size: 11px; }
}

@media (max-width: 420px) {
    .topnav-logo img { height: 22px; }
    .role-pill { display: none; }
}

/* ─── تكاليف الأوردر ─── */
.order-item-price { margin: 0; text-align: left; direction: ltr; }
.order-item-total {
    font-weight: 700;
    color: #000066;
    font-size: 14px;
    text-align: left;
    direction: ltr;
    padding: 0 4px;
}
.order-grand-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #eff6ff;
    border: 2px solid #000066;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 10px;
    font-weight: 900;
    color: #000066;
    font-size: 16px;
}
.order-grand-total-row span:last-child {
    font-size: 20px;
    direction: ltr;
}

.order-items-head { display: none; }
    .order-item-row { grid-template-columns: 1fr; }
    .remove-material-row { width: 100%; }
    .remove-order-item { width: 100%; }
    .wide-preview-summary { grid-template-columns: 1fr; }
    .preview-summary-grid { grid-template-columns: 1fr; }
}

/* ============================================
   قسم رفع الملفات
   ============================================ */
.upload-box {
    background: #f0f4ff;
    padding: 25px;
    border-radius: 12px;
    border: 2px dashed var(--primary-color);
    margin: 25px 0;
    clear: both;
    box-shadow: 0 4px 12px rgba(0, 0, 102, 0.05);
}
.upload-box-header { display: flex; align-items: flex-start; gap: 14px; }
.upload-box-header .upload-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.upload-box-header h4 { margin: 0 0 4px 0; font-size: 15px; color: var(--primary-color); font-weight: 700; }
.upload-box-header p { margin: 0; font-size: 12px; color: var(--text-muted); }
.upload-btn-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: background 0.2s;
    margin-top: 16px;
    border: none;
}
.upload-btn-label:hover { background: var(--primary-hover); }
.upload-btn-label input[type="file"] { display: none; }
.upload-file-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.upload-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
}
.upload-file-item .file-name { color: var(--text-main); font-weight: 600; flex: 1; word-break: break-all; }
.upload-file-item .file-size { color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.upload-file-item .remove-file {
    color: var(--alert-text); cursor: pointer; font-size: 18px; font-weight: 700;
    background: none; border: none; padding: 0 4px; line-height: 1; flex-shrink: 0;
}
.upload-file-item .remove-file:hover { color: #7f1d1d; }

/* روابط الملفات في قوائم الأوردرات */
.order-files { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.order-files-label { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.file-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #eef2ff;
    color: var(--primary-color);
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-link:hover { background: #c7d2fe; }

/* قسم تحميل الملفات في صفحة الإنتاج */
.files-download-box {
    margin-top: 12px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-right: 4px solid var(--primary-color);
    border-radius: 10px;
    padding: 14px 16px;
}
.files-download-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}
.file-download-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    margin-top: 4px;
}
.file-download-all-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.file-direct-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 6px 6px 0 0;
    padding: 9px 14px;
    border-radius: 8px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 12px;
}
.file-direct-link:hover { background: var(--primary-hover); color: #fff; }

/* حالات رفع الملف في صفحة الأوردر الجديد */
.upload-file-item.uploading { border-color: var(--accent-orange); background: #fff8f0; }
.upload-file-item.done     { border-color: #6ee7b7; background: #ecfdf5; }
.upload-file-item.error    { border-color: #fca5a5; background: #fef2f2; }

.file-transfer-progress {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: min(380px, calc(100vw - 44px));
    background: #ffffff;
    border: 1px solid #bbf7d0;
    border-right: 5px solid #16a34a;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.22);
    z-index: 300;
    transform: translateY(24px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.file-transfer-progress.show {
    transform: translateY(0);
    opacity: 1;
}
.file-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 8px;
}
.file-progress-top span { color: #15803d; direction: ltr; }
.file-progress-track {
    height: 10px;
    overflow: hidden;
    background: #dcfce7;
    border-radius: 999px;
}
.file-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #16a34a, #86efac);
    background-size: 180% 100%;
    animation: progressMove 1s linear infinite;
    transition: width .25s ease;
}
.file-progress-detail {
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@keyframes progressMove {
    from { background-position: 0 0; }
    to { background-position: 180% 0; }
}

.internal-chat {
    position: fixed;
    right: 22px;
    bottom: 92px;
    z-index: 290;
}
.chat-fab {
    width: 54px;
    height: 54px;
    border: none;
    border-radius: 50%;
    background: #000066;
    color: #fff;
    box-shadow: 0 12px 30px rgba(0,0,0,.28);
    cursor: pointer;
    font-size: 22px;
    position: relative;
}
.chat-fab-live {
    width: auto;
    height: 50px;
    border-radius: 26px;
    padding: 0 18px 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #6d28d9, #000066);
}
.chat-fab-icon { font-size: 19px; line-height: 1; }
.chat-fab-label {
    font-size: 13px;
    font-weight: 900;
    font-family: 'Segoe UI', Arial, sans-serif;
    letter-spacing: .2px;
    white-space: nowrap;
}
.chat-fab-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74,222,128,.7);
    animation: chatLivePulse 1.6s infinite;
}
@keyframes chatLivePulse {
    0%   { box-shadow: 0 0 0 0 rgba(74,222,128,.7); }
    70%  { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
@media (max-width: 480px) {
    .chat-fab-label { display: none; }
    .chat-fab-live { width: 54px; height: 54px; border-radius: 50%; padding: 0; justify-content: center; }
}
#chatUnreadBadge {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    border: 2px solid #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
}
.chat-panel {
    position: absolute;
    right: 0;
    bottom: 66px;
    width: min(760px, calc(100vw - 44px));
    height: min(520px, calc(100vh - 130px));
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 18px 44px rgba(0,0,0,.3);
    display: none;
    overflow: hidden;
}
.chat-panel.open {
    display: flex;
    flex-direction: column;
}
.chat-head {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: #000066;
    color: #fff;
}
.chat-head button {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}
.chat-body {
    height: calc(100% - 48px);
    min-height: 0;
    display: grid;
    grid-template-columns: 230px 1fr;
    flex: 1;
}
.chat-contacts {
    border-left: 1px solid #e2e8f0;
    overflow-y: auto;
    background: #f8fafc;
}
.chat-contact {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    text-align: right;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    background: transparent;
    padding: 9px 12px;
    cursor: pointer;
    position: relative;
}
.chat-contact.active,
.chat-contact:hover {
    background: #eef2ff;
}
.chat-avatar {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #3b4bd1);
    color: #fff;
    font-size: 12px; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-avatar.online::after {
    content: '';
    position: absolute;
}
.chat-contact-info { min-width: 0; flex: 1; }
.chat-contact span {
    display: block;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-contact small {
    color: var(--text-muted);
    font-size: 11px;
}
.chat-thread {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: 42px 1fr auto;
}
.chat-thread-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border-bottom: 1px solid #e2e8f0;
    color: var(--primary-color);
    font-weight: 900;
}
.chat-messages {
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    background: #fff;
}
.chat-message-row {
    display: flex;
    align-items: flex-end;
    gap: 7px;
    margin-bottom: 10px;
}
.chat-message-row.mine { flex-direction: row-reverse; }
.chat-message {
    max-width: 78%;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}
.chat-message.mine {
    background: #dcfce7;
    color: #14532d;
}
.chat-message.theirs {
    background: #eef2ff;
    color: var(--primary-color);
}
.chat-message small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 10px;
}
.chat-message-sender {
    display: block;
    margin-bottom: 3px;
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 900;
}
.chat-message.mine .chat-message-sender { color: #166534; }
.chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e2e8f0;
    position: relative;
    flex-shrink: 0;
    background: #fff;
}
.chat-form input {
    flex: 1;
    min-width: 0;
    width: auto;
    height: 42px;
    margin: 0;
}
.chat-form button {
    flex-shrink: 0;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: var(--accent-orange);
    color: #111827;
    font-weight: 900;
    padding: 0 14px;
    cursor: pointer;
    white-space: nowrap;
}
.chat-form button:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.chat-emoji-btn {
    width: 42px;
    padding: 0 !important;
    background: #f8fafc !important;
    color: var(--primary-color) !important;
    border: 1px solid var(--border) !important;
}
.chat-emoji-panel {
    position: absolute;
    right: 10px;
    bottom: 58px;
    width: 260px;
    max-width: calc(100% - 20px);
    display: none;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    z-index: 2;
}
.chat-emoji-panel.open { display: grid; }
.chat-emoji-option {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    min-height: 34px;
    font-size: 18px;
}
.chat-emoji-option:hover { background: #eef2ff; border-color: var(--primary-color); }
.chat-contact-unread {
    min-width: 19px;
    height: 19px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
}
.chat-empty {
    padding: 18px;
    color: var(--text-muted);
    text-align: center;
    font-size: 13px;
}

@media (max-width: 720px) {
    .chat-body { grid-template-columns: 135px 1fr; }
    .internal-chat { right: 14px; bottom: 82px; }
}

/* ============================================
   نظام الإشعارات
   ============================================ */
.notif-wrap { position: relative; display: none; }
.notif-bell {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.28);
    color: #fff;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    font-size: 16px;
    position: relative;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.notif-bell:hover,
.notif-bell:focus-visible {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    background: rgba(255,255,255,0.16);
    outline: none;
}
.notif-bell.has-unread {
    animation: notifBellShake 1.8s ease infinite;
}
.notif-bell.has-unread::after {
    content: '';
    position: absolute;
    inset: -7px;
    border: 2px solid var(--accent-orange);
    border-radius: 50%;
    animation: notifPulse 1.4s ease-out infinite;
}
@keyframes notifPulse {
    from { opacity: .8; transform: scale(.85); }
    to { opacity: 0; transform: scale(1.25); }
}
@keyframes notifBellShake {
    0%, 70%, 100% { transform: rotate(0deg); }
    74% { transform: rotate(-14deg); }
    78% { transform: rotate(11deg); }
    82% { transform: rotate(-8deg); }
    86% { transform: rotate(5deg); }
    90% { transform: rotate(-3deg); }
    94% { transform: rotate(0deg); }
}
.notif-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--alert-border);
    color: #fff;
    border: 2px solid #120f2b;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    min-width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    width: min(460px, calc(100vw - 28px));
    max-height: 520px;
    overflow-y: auto;
    z-index: 200;
    text-align: right;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    color: var(--primary-color);
}
.notif-dropdown-head strong { font-size: 13px; font-weight: 900; }
.notif-dropdown-head span {
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--accent-orange);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}
.notif-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-align: right;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    background: #fff;
    cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: #eef2ff; }
.notif-item.read { background: #fff; opacity: .68; }
.notif-item:hover { background: #fff7ed; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-unread-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--accent-orange); flex-shrink: 0; margin-top: 5px;
}
.notif-msg { font-size: 13px; color: var(--text-main); font-weight: 600; line-height: 1.5; }
.notif-item.unread .notif-msg { color: var(--primary-color); font-weight: 700; }
.notif-item.read .notif-msg { color: var(--text-muted); font-weight: 500; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-mark-all-read {
    background: none; border: none; color: var(--accent-orange);
    font-size: 11.5px; font-weight: 800; cursor: pointer; font-family: inherit;
}
.notif-mark-all-read:hover { text-decoration: underline; }
.notif-open-hint {
    display: block;
    margin-top: 6px;
    color: var(--accent-orange);
    font-size: 11px;
    font-weight: 900;
}
.notif-empty { padding: 24px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.notif-section-title {
    padding: 10px 16px 8px;
    background: #f8fafc;
    color: var(--primary-color);
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
    font-weight: 900;
}
.notif-section-title.unread-title {
    background: #fff7ed;
    color: #b45309;
}
.notif-status-strip {
    max-width: 1150px;
    margin: 0 auto 16px;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(255,255,255,0.25);
    border-right: 5px solid var(--accent-orange);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}
.notif-strip-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--primary-color);
}
.notif-strip-head strong { font-size: 14px; font-weight: 900; }
.notif-strip-head span {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-orange);
}
.notif-strip-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
}
.notif-strip-item {
    text-align: right;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
    color: var(--text-main);
    padding: 9px 11px;
    cursor: pointer;
}
.notif-strip-item.unread {
    background: #eef2ff;
    border-color: #c7d2fe;
}
.notif-strip-item span {
    display: block;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-strip-item small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
}
.notif-strip-empty {
    color: var(--text-muted);
    font-size: 12px;
    padding: 8px 0;
}
.notif-preview-btn {
    margin-top: 8px;
    border: 1px solid var(--primary-color);
    background: #eef2ff;
    color: var(--primary-color);
    border-radius: 8px;
    padding: 7px 12px;
    cursor: pointer;
    font-weight: 800;
    font-size: 12px;
}
.notif-preview-btn:hover { border-color: var(--accent-orange); color: var(--accent-orange); }

.task-popup-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 35, 0.72);
    z-index: 500;
    padding: 18px;
}
.task-popup-backdrop.open { display: flex; }
.task-popup-backdrop.previewing { display: none; }
.task-popup-card {
    width: min(520px, 100%);
    background: #fff;
    border-radius: 14px;
    border: 1px solid #c7d2fe;
    box-shadow: 0 26px 70px rgba(0,0,0,0.32);
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.task-popup-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-orange);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 22px;
    flex: 0 0 44px;
}
.task-popup-body { flex: 1; min-width: 0; }
.task-popup-body h3 {
    margin: 0 0 8px;
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 900;
}
.task-popup-body p {
    margin: 0 0 12px;
    color: var(--text-main);
    line-height: 1.7;
    font-weight: 700;
}
.task-popup-meta { color: var(--text-muted); font-size: 12px; margin-bottom: 16px; }
.task-popup-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.task-btn {
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 900;
}
.task-btn.primary { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.task-btn.primary:hover { background: var(--primary-hover); }
.task-btn.ghost { background: #fff; color: var(--primary-color); }
.task-btn.ghost:disabled { opacity: .45; cursor: not-allowed; }
.task-popup-hint { margin-top: 10px; color: #b45309; font-size: 12px; font-weight: 700; }

.handoff-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 900;
}
.handoff-status.pending { background: #fff7ed; color: #b45309; border: 1px solid #fed7aa; }
.handoff-status.received { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.handoff-status.viewed { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

.wide-preview .dashboard-card {
    width: min(1040px, calc(100vw - 40px));
    max-width: 1040px;
}
.wide-preview-content {
    text-align: right;
    font-size: 14px;
    line-height: 1.8;
}
.wide-preview-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.wide-preview-summary div,
.wide-preview-notes {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}
.materials-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
.materials-preview-table th,
.materials-preview-table td {
    border: 1px solid #cbd5e1;
    padding: 12px;
    text-align: right;
    vertical-align: top;
}
.materials-preview-table th {
    background: #eef2ff;
    color: var(--primary-color);
}
.wide-preview-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}
.material-status-select {
    width: auto;
    min-width: 150px;
    padding: 7px 10px;
    font-size: 12px;
}
.material-request-form textarea#materialsText { min-height: 160px; }

.materials-items-box {
    border: 1px solid #dbe4f0;
    background: #f8fafc;
    border-radius: 8px;
    padding: 14px;
    margin: 8px 0 18px;
}
.materials-items-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.materials-items-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 15px;
}
.secondary-btn.compact {
    width: auto;
    padding: 8px 12px;
    font-size: 12px;
    margin: 0;
}
.material-item-row {
    display: grid;
    grid-template-columns: minmax(220px, 2.2fr) minmax(90px, .7fr) minmax(150px, 1.2fr) 42px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.material-item-row input {
    margin: 0;
}
.order-items-head,
.order-item-row {
    display: grid;
    grid-template-columns: minmax(140px, 1.5fr) minmax(75px, .6fr) minmax(120px, 1fr) minmax(85px, .65fr) minmax(80px, .6fr) 42px;
    gap: 8px;
    align-items: center;
}
.order-items-head {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 8px;
    padding: 0 2px;
}
.order-item-row {
    margin-bottom: 8px;
}
.order-item-row input {
    margin: 0;
}
.remove-order-item {
    width: 40px;
    height: 40px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #be123c;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 900;
}
.order-items-preview {
    margin-top: 10px;
    overflow-x: auto;
}
.order-items-preview table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.order-items-preview th,
.order-items-preview td {
    border: 1px solid #e2e8f0;
    padding: 8px 10px;
    text-align: right;
    font-size: 12px;
}
.order-items-preview th {
    background: #eef2ff;
    color: var(--primary-color);
}
.preview-order-layout {
    text-align: right;
}
.preview-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}
.preview-summary-cell {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-right: 4px solid var(--accent-orange);
    border-radius: 8px;
    padding: 10px 12px;
}
.preview-summary-cell span {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 4px;
}
.preview-summary-cell strong {
    display: block;
    color: var(--primary-color);
    font-size: 13px;
}
.preview-section-title {
    color: var(--primary-color);
    font-weight: 900;
    margin: 10px 0 8px;
    padding-right: 8px;
    border-right: 4px solid var(--accent-orange);
}
.preview-items-table {
    margin-top: 0;
}
.preview-notes {
    margin-top: 10px;
    background: #fff8f0;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-main);
    font-size: 13px;
}
.app-feedback-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 30, .58);
    z-index: 1000;
    padding: 18px;
}
.app-feedback-overlay.open { display: flex; }
.app-feedback-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    border-top: 6px solid var(--accent-orange);
    box-shadow: 0 22px 60px rgba(0,0,0,.35);
    text-align: center;
    padding: 28px 28px 24px;
    position: relative;
    animation: successPopIn .28s cubic-bezier(.26,1.36,.4,1);
}
.app-feedback-overlay.success .app-feedback-card { border-top-color: #16a34a; }
.app-feedback-overlay.error .app-feedback-card { border-top-color: var(--alert-border); }
.app-feedback-close {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 900;
}
.app-feedback-icon {
    width: 68px;
    height: 68px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ecfdf5;
    color: #16a34a;
    font-size: 34px;
    font-weight: 900;
    margin-bottom: 12px;
}
.app-feedback-overlay.error .app-feedback-icon {
    background: var(--alert-bg);
    color: var(--alert-border);
}
.app-feedback-card h3 {
    margin: 0 0 8px;
    color: var(--primary-color);
    font-size: 19px;
}
.app-feedback-card p {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-weight: 700;
    line-height: 1.6;
}
.app-feedback-ok {
    border: 0;
    border-radius: 8px;
    background: var(--primary-color);
    color: #fff;
    padding: 11px 28px;
    font-weight: 900;
    cursor: pointer;
}
.app-feedback-ok:hover { background: var(--primary-hover); }
.remove-material-row {
    width: 40px;
    height: 40px;
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #be123c;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 900;
}
.btn-sm.receive-material {
    background: #ecfdf5;
    color: #047857;
    border-color: #86efac;
}

/* خانة التوجيه في أوردر جديد */
.assign-box {
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-right: 4px solid var(--primary-color);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    clear: both;
}
.assign-box label { color: var(--primary-color); }
.assign-box select { background: #fff; }

/* ============================================
   معاينة النقاط في موديل التنفيذ
   ============================================ */
.points-preview-box {
    padding: 12px 16px;
    border-radius: 10px;
    background: #f0fdf4;
    border: 1px solid #86efac;
    font-size: 14px;
    font-weight: 600;
}
.pts-great { color: #065f46; }
.pts-good  { color: #166534; }
.pts-ok    { color: #854d0e; }
.pts-late  { color: #991b1b; }

/* ============================================
   صفحة المكافآت
   ============================================ */
.rewards-legend {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
}
.legend-title { font-weight: 800; font-size: 14px; color: var(--primary-color); margin-bottom: 10px; }
.legend-items { display: flex; flex-wrap: wrap; gap: 8px; }
.legend-item {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.legend-item.gold   { background: #fef9c3; color: #713f12; border: 1px solid #fde047; }
.legend-item.silver { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.legend-item.bronze { background: #fff7ed; color: #7c2d12; border: 1px solid #fdba74; }
.legend-item.late1  { background: #fefce8; color: #713f12; border: 1px solid #fde68a; }
.legend-item.late2  { background: #fff7ed; color: #9a3412; border: 1px solid #fb923c; }
.legend-item.late3  { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

.rewards-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 8px;
}

/* بطاقة موظف */
.reward-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.rank-gold   { border-right: 5px solid #f59e0b; }
.rank-silver { border-right: 5px solid #94a3b8; }
.rank-bronze { border-right: 5px solid #cd7c3d; }
.rank-normal { border-right: 5px solid var(--border); }

.reward-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}
.reward-rank  { font-size: 32px; line-height: 1; min-width: 40px; text-align: center; }
.reward-info  { flex: 1; }
.reward-name  { font-size: 17px; font-weight: 800; color: var(--primary-color); }
.reward-meta  { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.reward-total-pts {
    font-size: 28px;
    font-weight: 900;
    color: var(--accent-orange);
    text-align: center;
    line-height: 1;
}
.reward-total-pts span { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); }

.reward-bar-wrap {
    height: 8px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}
.reward-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-orange));
    border-radius: 10px;
    transition: width 0.5s;
}
.rank-gold   .reward-bar { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.rank-silver .reward-bar { background: linear-gradient(90deg, #64748b, #94a3b8); }

.reward-orders-list { border-top: 1px solid #f1f5f9; padding-top: 12px; }
.reward-order-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 12px;
    border-bottom: 1px dashed #f1f5f9;
}
.reward-order-row:last-child { border-bottom: none; }
.reward-order-num  { color: var(--accent-orange); font-weight: 800; min-width: 38px; }
.reward-order-name { flex: 1; color: var(--text-main); font-weight: 600; }
.reward-order-timing { color: var(--text-muted); min-width: 140px; text-align: center; font-size: 11px; }
.reward-order-pts  { color: var(--primary-color); font-weight: 800; min-width: 60px; text-align: left; }
.reward-more { font-size: 11px; color: var(--text-muted); padding: 6px 0 0; text-align: center; }

@media (max-width: 600px) {
    .rewards-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .reward-order-timing { display: none; }
}

/* ============================================
   شاشة نجاح حفظ الأوردر — v1.1
   ============================================ */
.success-overlay {
    position: fixed; inset: 0; background-color: var(--background);
    background-image:
        radial-gradient(rgba(242, 145, 0, 0.15) 1px, transparent 0),
        linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px, 20px 20px, 20px 20px;
    background-position: 0 0, 10px 10px, 10px 10px;
    display: none; align-items: center; justify-content: center;
    z-index: 999; padding: 20px;
}
.success-overlay.open { display: flex; animation: successFadeIn 0.25s ease; }
@keyframes successFadeIn { from { opacity: 0; } to { opacity: 1; } }

#confettiCanvas {
    position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}

.success-card {
    background: #fff; border-radius: 20px; padding: 36px 40px;
    max-width: 420px; width: 100%; text-align: center; position: relative; z-index: 2;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: successPopIn 0.4s cubic-bezier(.26,1.36,.4,1);
}
.success-close-btn {
    position: absolute; top: 14px; left: 14px;
    width: 30px; height: 30px; border-radius: 50%; border: none;
    background: #f1f5f9; color: var(--text-muted); font-size: 15px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.15s ease;
}
.success-close-btn:hover { background: #e2e8f0; color: var(--primary-color); }
@keyframes successPopIn {
    0% { transform: scale(0.7) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.success-check {
    width: 80px; height: 80px; margin: 0 auto 16px;
}
.success-check svg { width: 100%; height: 100%; }
.success-check circle {
    stroke: #16a34a; stroke-width: 3; stroke-dasharray: 166; stroke-dashoffset: 166;
    animation: successCircle 0.35s ease forwards;
}
.success-check path {
    stroke: #16a34a; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 48; stroke-dashoffset: 48;
    animation: successTick 0.3s 0.2s ease forwards;
}
@keyframes successCircle { to { stroke-dashoffset: 0; } }
@keyframes successTick { to { stroke-dashoffset: 0; } }

.success-card h2 {
    font-size: 19px; color: var(--primary-color); font-weight: 800; margin: 0 0 22px;
}

.success-order-card {
    background: #f8fafc; border: 1px solid var(--border); border-radius: 12px;
    padding: 16px 18px; margin-bottom: 24px; text-align: right;
}
.success-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid #e2e8f0;
}
.success-row:last-child { border-bottom: none; }
.success-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.success-value { font-size: 14px; color: var(--primary-color); font-weight: 700; }
.success-value.serial { font-size: 18px; color: var(--accent-orange); font-weight: 800; }

.success-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.success-btn {
    flex: 1; min-width: 100px; padding: 12px 14px; border-radius: 9px; border: none;
    font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.15s ease;
}
.success-btn.primary { background: var(--primary-color); color: #fff; }
.success-btn.primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.success-btn.ghost { background: #f1f5f9; color: var(--primary-color); }
.success-btn.ghost:hover { background: #e2e8f0; }
.success-btn.whatsapp { background: #25D366; color: #fff; }
.success-btn.whatsapp:hover { background: #1ea952; transform: translateY(-1px); }

@media (max-width: 480px) {
    .success-actions { grid-template-columns: 1fr; }
}

/* ============================================================
   قسم التصميم — Design Section Styles
   ============================================================ */

/* بادجات حالة التصميم */
.badge-design-waiting {
    background: #fef3c7; color: #92400e; border-color: #fcd34d;
}
.badge-design-progress {
    background: #ede9fe; color: #5b21b6; border-color: #c4b5fd;
}
.badge-design-pending {
    background: #fff7ed; color: #c2410c; border-color: #fdba74;
}
.badge-design-proof {
    background: #eff6ff; color: #1d4ed8; border-color: #93c5fd;
}
.badge-design-done {
    background: #ecfdf5; color: #047857; border-color: #6ee7b7;
}

/* صف الأوردر في قسم التصميم */
.design-order-row {
    border-right: 4px solid #c4b5fd;
}
.design-order-row.design-in-progress {
    border-right-color: #7c3aed;
    background: linear-gradient(135deg, #faf5ff 0%, #fff 100%);
}

/* أزرار إجراءات التصميم — تصميم موحّد لكل الحالات */
.design-action-btn {
    font-size: 12.5px;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: transform .12s, box-shadow .12s;
    white-space: nowrap;
}
.design-action-btn:hover { transform: translateY(-1px); }
.design-action-btn.start {
    background: #ede9fe; color: #5b21b6; border-color: #c4b5fd;
}
.design-action-btn.start:hover { background: #ddd6fe; }
.design-action-btn.done {
    background: #fff7ed; color: #c2410c; border-color: #fdba74;
}
.design-action-btn.done:hover { background: #ffedd5; }
.design-action-btn.approve {
    background: linear-gradient(135deg,#059669,#10b981); color: #fff; border-color: transparent;
    box-shadow: 0 4px 12px rgba(5,150,105,.25);
}
.design-action-btn.approve:hover { box-shadow: 0 6px 16px rgba(5,150,105,.35); }
.design-action-btn.pending-note {
    background: #f1f5f9; color: #64748b; cursor: default;
}
.design-timeline-wrap { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.design-timeline-note {
    font-size: 12px; color: #475569; background: #f8fafc; border-radius: 8px;
    padding: 6px 10px; display: inline-block; width: fit-content;
}

/* تابات صفحة الإنتاج */
.production-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.prod-tab {
    background: #f1f5f9; color: #475569; border: none; border-radius: 20px;
    padding: 9px 18px; font-size: 13px; font-weight: 800; cursor: pointer; font-family: inherit;
}
.prod-tab.active { background: #000066; color: #fff; }
.prod-tab[data-tab="ready"].active { background: #f97316; }
.prod-tab[data-tab="ready_for_delivery"].active { background: #16a34a; }
.prod-tab[data-tab="delivered"].active { background: #059669; }
.prod-tab[data-tab="in_progress"].active { background: #7c3aed; }

.prod-action-btn {
    font-size: 12.5px; font-weight: 800; padding: 8px 16px; border-radius: 20px;
    border: none; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.prod-action-btn.deliver { background: linear-gradient(135deg,#059669,#10b981); color: #fff; }
.prod-action-btn.ship-on  { background: #f0fdfa; color: #0f766e; border: 1px solid #5eead4; }
.prod-action-btn.ship-off { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.design-action-btn.pending-note:hover { transform: none; }
.design-action-btn.edit {
    background: #eff6ff; color: #1d4ed8; border-color: #93c5fd;
}
.design-action-btn.edit:hover { background: #dbeafe; }
.proof-locked-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #92400e;
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 8px;
    padding: 8px 12px;
}
.send-proof-btn {
    margin-top: 10px;
    background: #25D366; color: #fff; border: none;
    border-radius: 8px; padding: 9px 16px; font-size: 12.5px; font-weight: 800;
    cursor: pointer; display: block;
}
.send-proof-btn:hover { background: #1ebe5a; }

/* مؤشر تدفق العمل */
.design-workflow-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #f5f3ff, #fdf4ff);
    border: 1px solid #e9d5ff;
    border-radius: 14px;
    padding: 16px 24px;
    margin-bottom: 20px;
}
.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.workflow-step-active { opacity: 1; }
.workflow-step-icon { font-size: 28px; }
.workflow-step-label {
    font-size: 12px; font-weight: 700; color: var(--text-main);
    text-align: center;
}
.workflow-arrow {
    font-size: 20px; color: #9333ea; font-weight: 700;
}

/* إحصائيات التصميم */
.stat-box-design-waiting {
    border-top: 3px solid #fcd34d;
}
.stat-box-design-progress {
    border-top: 3px solid #7c3aed;
}

/* موديل تأكيد التصميم */
.design-confirm-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
}
.design-confirm-icon { font-size: 28px; flex-shrink: 0; }
.design-confirm-box strong { display: block; color: #047857; font-size: 14px; margin-bottom: 4px; }
.design-confirm-box p { color: var(--text-muted); font-size: 13px; margin: 0; }

/* تنبيه نجاح التصميم */
.design-success-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #047857;
    color: #fff;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 8px 30px rgba(4,120,87,0.35);
    z-index: 9999;
    transition: transform 0.35s cubic-bezier(.21,1.02,.73,1);
    white-space: nowrap;
}
.design-success-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* بادج قسم التصميم في الـ nav */
a.nav-link.design-link { position: relative; }

/* ============================================
   بند الشحن — Shipping Box
   ============================================ */
.shipping-box {
    background: #f0f9ff;
    border: 2px dashed #0ea5e9;
}
.shipping-box .switch-text-block h4 { color: #0c4a6e; }
.shipping-box .switch-text-block p  { color: #0369a1; }
.shipping-send-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0ea5e9;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}
.shipping-send-btn:hover { background: #0284c7; transform: translateY(-1px); }

@media (max-width: 700px) {
    .design-workflow-indicator { flex-wrap: wrap; gap: 8px; }
    .workflow-arrow { font-size: 14px; }
}

/* ============================================================
   التقارير الشهرية
   ============================================================ */
.reports-heading {
  font-size: 18px;
  font-weight: 900;
  color: #1e40af;
  border-bottom: 2px solid #bfdbfe;
  padding-bottom: 10px;
  margin-bottom: 20px;
}
.monthly-report-card {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  padding: 22px 26px;
  margin-bottom: 18px;
  transition: box-shadow 0.2s;
}
.monthly-report-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.mr-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.mr-month {
  font-size: 17px;
  font-weight: 900;
  color: #1e40af;
}
.mr-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
}
.mr-top-badge {
  background: linear-gradient(135deg,#fef3c7,#fde68a);
  border: 1.5px solid #f59e0b;
  border-radius: 24px;
  padding: 6px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
  white-space: nowrap;
}
.mr-summary {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: #475569;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.mr-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #3b82f6;
  margin-bottom: 10px;
  user-select: none;
}
.mr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.mr-table th {
  background: #e2e8f0;
  padding: 8px 12px;
  text-align: right;
  font-weight: 700;
  color: #334155;
}
.mr-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}
.mr-table tr:last-child td { border-bottom: none; }
.mr-table tr:hover td { background: #f1f5f9; }
.cert-from-report-btn {
  margin-top: 14px;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.cert-from-report-btn:hover { background: #d97706; }

.ext-display-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  margin-right: 10px;
  transition: background .2s;
}
.ext-display-btn:hover { background: rgba(255,255,255,.26); }

/* ============================================================
   السايدبار الجانبي الجديد (مفعّل بس على الصفحات اللي معمول لها التحويل
   عبر body.sidebar-layout — عشان مايأثرش على باقي الصفحات القديمة)
   ============================================================ */
body.sidebar-layout {
    display: flex;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}
.app-sidebar {
    width: 210px;
    flex-shrink: 0;
    background: #0a0a23;
    border-left: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 500;
    transition: transform .25s ease;
}
.app-sidebar::-webkit-scrollbar { width: 5px; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 10px; }

.sidebar-logo { padding: 18px 18px 14px; flex-shrink: 0; }
.sidebar-logo img { height: 28px; width: auto; object-fit: contain; }

.sidebar-nav { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-group-label {
    font-size: 10.5px;
    font-weight: 800;
    color: rgba(255,255,255,.32);
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 16px 10px 6px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 9px;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
    position: relative;
}
.sidebar-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-link.active { background: rgba(242,145,0,.16); color: #f29100; }
.sidebar-icon { font-size: 15px; flex-shrink: 0; width: 18px; text-align: center; }
.sidebar-caret { margin-right: auto; font-size: 13px; opacity: .55; transition: transform .15s; }
.sidebar-link.popover-open .sidebar-caret { transform: rotate(-90deg); }

.sidebar-popover {
    display: none;
    position: fixed;
    width: 250px;
    max-height: 70vh;
    overflow-y: auto;
    background: #0f0f2e;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(0,0,0,.45);
    padding: 14px 16px;
    z-index: 600;
}
.sidebar-popover.open { display: block; }
.sidebar-popover .lb-title { color: #fff; }
.sidebar-popover .lb-period { color: rgba(255,255,255,.45); }
.sidebar-popover .lb-updated { color: rgba(255,255,255,.3); }
.sidebar-popover .lb-header { margin-bottom: 4px; }

.sidebar-footer {
    margin-top: auto;
    flex-shrink: 0;
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-user-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sidebar-user-info #navUserName { font-size: 11.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .role-pill { align-self: flex-start; margin-top: 2px; }
.sidebar-footer .logout-link {
    background: rgba(255,255,255,.08);
    border: none;
    width: 30px; height: 30px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}
.sidebar-footer .logout-link:hover { background: rgba(239,68,68,.25); }
.sidebar-footer .notif-wrap { position: relative; flex-shrink: 0; }

.app-main {
    flex: 1;
    min-width: 0;
    padding: 20px 24px;
    overflow-x: hidden;
}
body.sidebar-layout .page-layout { max-width: none; }

.sidebar-mobile-toggle {
    display: none;
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 700;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: #0a0a23;
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,10,.5);
    z-index: 499;
}
.sidebar-overlay.open { display: block; }

@media (max-width: 1024px) {
    body.sidebar-layout .app-sidebar {
        position: fixed;
        right: 0;
        top: 0;
        transform: translateX(100%);
    }
    body.sidebar-layout .app-sidebar.mobile-open { transform: translateX(0); }
    .sidebar-mobile-toggle { display: flex; align-items: center; justify-content: center; }
    .app-main { padding: 64px 14px 20px; }
}

body.sidebar-layout .internal-chat { right: auto; left: 22px; }
@media (max-width: 1024px) {
    body.sidebar-layout .internal-chat { left: 14px; bottom: 14px; }
}
