/* خط لبنان (static/lb.js) — إضافات صغيرة فوق app.css */
.lb-pill{display:inline-flex;align-items:center;gap:4px;border-radius:20px;padding:2px 10px;font-size:12.5px;font-weight:600;white-space:nowrap}
.lb-kpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px;margin-bottom:14px}
.lb-kpi{background:var(--surface);border:1px solid var(--box-line);border-radius:var(--r);padding:12px 14px;box-shadow:var(--sh-1)}
.lb-kpi small{display:block;color:var(--muted);font-size:12.5px}
.lb-kpi b{font-size:24px;font-variant-numeric:tabular-nums}
.lb-errs{border:1px solid #F0C3BF;background:var(--red-soft);border-radius:var(--r-sm);padding:10px 14px;margin:10px 0;max-height:40vh;overflow:auto}
.lb-errs b{display:block;margin-bottom:4px;color:#9B1C1C}
.lb-errs li{margin-inline-start:18px}
.lb-warns{border:1px solid #EBD99A;background:var(--amber-soft);border-radius:var(--r-sm);padding:10px 14px;margin:10px 0}
.lb-warns li{margin-inline-start:18px}
.in.bad{border-color:#D14343 !important;background:#FFF5F5}
.lb-two{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.lb-four{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.lb-party h3{margin:0 0 8px;font-size:15px}
.lb-party .pin{font-size:12.5px;color:var(--muted);font-weight:400}
.lb-lines input.in,.lb-lines select.in{min-height:32px;padding:4px 6px}
.lb-lines td{padding:4px 5px}
.lb-lines td.calc{color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.lb-tot{display:flex;gap:18px;flex-wrap:wrap;background:#F4F6FA;border-radius:var(--r-sm);padding:8px 12px;margin-top:8px}
.lb-tot b{font-variant-numeric:tabular-nums}
.lb-trips{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px}
.lb-trip{background:var(--surface);border:1px solid var(--box-line);border-radius:var(--r);padding:12px 14px;display:flex;flex-direction:column;gap:6px;box-shadow:var(--sh-1)}
.lb-trip .h{display:flex;justify-content:space-between;align-items:center;gap:8px}
.lb-trip .h b{font-size:16px}
.lb-trip .m{color:var(--muted);font-size:13px}
.lb-sum{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.lb-sum h4{margin:0 0 6px;font-size:14px}
.lb-warn-num{color:#B45309;font-size:12.5px;margin-top:3px}
.lb-busy{font-size:12.5px;color:#9B1C1C}
.lb-free{font-size:12.5px;color:var(--green)}
.lb-sel td:first-child{width:28px}
/* صفحة طباعة الجدولين: نفس شكل ملف Excel */
.lb-sheet{background:#fff;padding:14px;overflow:auto}
.lb-sheet table{border-collapse:collapse;margin:0 auto;direction:rtl}
.lb-sheet td{border:1px solid #000;text-align:center;vertical-align:middle;padding:2px 4px;white-space:pre-line}
.lb-sheet.wb{font-family:Arial,sans-serif;font-size:11pt}
.lb-sheet.mf{font-family:Calibri,Arial,sans-serif;font-size:12pt;font-weight:700}
.lb-sheet .b{font-weight:700}
.lb-sheet .mt{border-top:2px solid #000}.lb-sheet .mb{border-bottom:2px solid #000}
.lb-sheet .ms{border-right:2px solid #000}.lb-sheet .me{border-left:2px solid #000}
.lb-sheet .nob{border:none}
@media (max-width:760px){.lb-two,.lb-four{grid-template-columns:1fr}}
@media print{
  .lb-noprint{display:none !important}
  .lb-sheet{padding:0}
  @page{size:A4 portrait;margin:8mm}
}
/* نوع البضاعة: سعر الكيلو تحت الخانة (8.5) */
.lb-gp{display:block;font-size:11.5px;line-height:1.3;min-height:15px;margin-top:2px}

/* 8.6: الوزن الصافي التلقائي، المنشأ الأجنبي، تسعير التصفية */
.lb-lines input.lb-auto{color:var(--muted)}
.lb-foreign{background:#FFF7ED !important;border-color:var(--orange) !important}
.lb-it{padding:2px 6px;border-radius:6px;margin:2px 0;white-space:nowrap}
.lb-price td{vertical-align:middle}
.lb-pin{margin:2px 0;white-space:nowrap}.lb-pin small{font-size:11px}

/* (8.14) ملخص الرحلة مسكّر افتراضياً وبينفتح بكبسة */
.lb-sumbox>summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:8px}
.lb-sumbox>summary::-webkit-details-marker{display:none}
.lb-sumbox>summary::before{content:'';width:8px;height:8px;border:solid var(--muted);border-width:0 2px 2px 0;transform:rotate(135deg);transition:transform .15s;flex:none}
.lb-sumbox[open]>summary::before{transform:rotate(45deg)}
.lb-sumbox>summary h2{margin:0}
.lb-sumbox[open]>summary{margin-bottom:10px}
.lb-sumbox[open]>summary small{display:none}
/* (8.33) تسعير التصفية بالتخصيص: كل صنف وخانة سعره على نفس الخط (سطر فرعي بارتفاع ثابت 40)، وبيتلوّنوا سوا */
.lb-price tr.cust td{vertical-align:middle}          /* الخانات اللي إلها قيمة وحدة (الرقم، المرسل، الوزن، الطريقة، الأجور، الحالة) بالنص */
.lb-price tr.cust td.lb-sub{vertical-align:top;padding-top:6px;padding-bottom:6px}
.lb-price tr.cust .lb-sub>.lb-it,.lb-price tr.cust .lb-sub>.lb-pin{height:40px;box-sizing:border-box;display:flex;align-items:center;gap:6px;margin:0;border-radius:6px;
  border-bottom:1px dashed var(--line-2);transition:background-color .12s}
.lb-price tr.cust .lb-sub>:last-child{border-bottom:0}
.lb-price tr.cust .lb-sub>.lb-it{justify-content:space-between}
.lb-price tr.cust .lb-it .lb-itn{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.lb-price tr.cust .lb-it .lb-itf{flex:none}
.lb-price tr.cust .lb-pin .in{height:32px;padding-block:0}
.lb-price tr.cust .lb-pin small{color:var(--muted)}
.lb-price tr.cust .lb-sub>.hl{background:var(--accent-soft);box-shadow:inset 3px 0 0 var(--accent)}
.lb-price tr.cust .lb-sub>.lb-it.lb-foreign.hl{background:#FDEBD8 !important}
/* (8.33) التصفية والفاتورة: كل قيمة بالنص تحت عنوان عاموده (إلا اسم الصنف/الأصناف)، وخانة تحديد الصنف للدمج أكبر */
.lb-price th,.lb-price td{text-align:center}
.lb-price th.lb-items,.lb-price td.lb-items{text-align:start}   /* (8.37) الأصناف (بالصنف مش برقم العامود) */
.lb-price td .chk{justify-content:center}
.lb-price td .lb-pin{justify-content:center}
.lb-price td select.in{margin-inline:auto}
.lb-inv th,.lb-inv td{text-align:center}
.lb-inv th.lb-name,.lb-inv td.lb-name{text-align:start}
.lb-inv td .in{display:inline-block}
.lb-inv td.lb-pk{width:46px;cursor:pointer}
.lb-inv input[data-pick]{width:22px;height:22px;cursor:pointer;vertical-align:middle}
.lb-inv tr:has(input[data-pick]:checked) td{background:var(--accent-soft)}

/* (8.34) زر «إخراج من الرحلة» بقائمة إشعارات الرحلة */
.lb-out-td{white-space:nowrap;text-align:center}
.lb-out{color:var(--orange);border-color:#F2CFB0;background:var(--orange-soft)}
.lb-out:hover{border-color:var(--orange);background:#F9DEC6}
.lb-out svg{width:15px;height:15px}

/* (8.36) التصفية: الإجمالي ملوّن متل كشف التوزيع، وخانة الحوالة */
/* (8.36) الإجمالي آخر عامود قبل الحالة، بخانة زرقا فاتحة (مو العامود كله) */
.lb-price td.lb-totc .rt{display:inline-block;min-width:76px;background:#EAF4FF;border-radius:var(--r-sm);padding:8px 12px}
.lb-haw.bad{border-color:var(--red);background:var(--red-soft)}

/* (8.36) إدارة وتتبع شؤون الخط (لبنان) */
.lt-list th.lt-tot,.lt-list td.lt-tot{background:#EAF4FF}
.lt-sum{margin:10px 0 12px}
.lt-card .sumbar.fin small.muted{display:block;font-size:11px}
/* (8.36) خانة الحوالة بنص السطر (أفقياً وعمودياً، حتى بسطور التخصيص الطويلة) */
.lb-price td.lb-hawtd{vertical-align:middle;text-align:center}
.lb-price td.lb-hawtd .lb-haw{display:block;margin-inline:auto;text-align:center}

/* (8.37) التصفية مضغوطة لتوسع بشاشة اللابتوب بلا سحب: المرسل والمرسل إليه بعامود، القائم والحجم بعامود،
   الطرود والوزن تحت اسم الصنف، والحالة علامة ملوّنة بعامود ضيّق */
.lb-price th{white-space:normal;line-height:1.3;vertical-align:bottom}
.lb-price th small{display:block;font-weight:500;font-size:11.5px}
.lb-price td.lb-pp{min-width:96px;max-width:150px;line-height:1.35}
.lb-price td.lb-pp span,.lb-price td.lb-wv span{display:block}
.lb-price td.lb-pp small{display:block;margin-top:3px;color:var(--muted);font-size:12px}
.lb-price td.lb-wv{white-space:nowrap;line-height:1.35}
.lb-price td.lb-wv small{color:var(--muted);font-size:11.5px}
.lb-price td.lb-wv>small{display:block;margin-top:3px}
.lb-price td.lb-items{min-width:170px}
.lb-price .lb-items .lb-it{max-width:250px;white-space:normal;line-height:1.3}
.lb-price .lb-itn small.lb-itm{display:block;font-size:11.5px;color:var(--muted);font-weight:400}
.lb-price tr.cust .lb-items .lb-it .lb-itn{white-space:normal;overflow:hidden}
.lb-price tr.cust .lb-items .lb-it .lb-itn>*:not(.lb-itm){white-space:nowrap}
.lb-price td.lb-totc .rt{min-width:64px;padding:8px 10px}
.lb-price .lb-stc{width:34px;padding-inline:4px}
.lb-st{display:inline-block;width:20px;height:20px;border-radius:50%;vertical-align:middle;background:center/12px 12px no-repeat}
.lb-st.saved{background-color:#DCFCE7;box-shadow:inset 0 0 0 1.5px #22A05A;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.3l2.8 2.8 6.2-6.4' fill='none' stroke='%23166534' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
.lb-st.dirty{background-color:#FEF3C7;box-shadow:inset 0 0 0 1.5px #D99A06;
  background-image:radial-gradient(circle,#B45309 0 3.5px,transparent 4px)}
.lb-st.unsaved{background-color:#fff;box-shadow:inset 0 0 0 1.5px #9AA6B8;border:0;outline:1.5px dashed transparent}
.lb-stkey{display:inline-flex;align-items:center;gap:5px;font-size:12px;color:var(--muted);margin-inline-end:14px;white-space:nowrap}
.lb-stkey .lb-st{width:16px;height:16px;background-size:10px 10px}
.lb-stkey .lb-st.dirty{background-image:radial-gradient(circle,#B45309 0 2.8px,transparent 3.2px)}
.lb-stkey .lb-st+.lb-st,.lb-stkey .lb-st{margin-inline-start:6px}
/* (8.39) الصنف المرفق ضمن طرد السطر اللي فوقه (Ctrl+M) */
.lb-lines tr.lb-att td{background:#F7F9FC}
.lb-lines td.lb-att-d{position:relative}
.lb-lines td.lb-att-d::before{content:'↳';position:absolute;inset-inline-start:12px;top:17px;color:#6B7A93;font-weight:700;pointer-events:none}
.lb-lines td.lb-att-d input.in{padding-inline-start:26px}
.lb-lines td.lb-att-x{background:#EEF1F6;text-align:center}
.lb-lines td.lb-acts{white-space:nowrap;width:70px}
