body { font-family: 'Cairo', sans-serif; }

.nav-item {
  display: block;
  padding: 10px 18px;
  color: rgba(255,255,255,.75);
  cursor: pointer;
  border-right: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.1); color: #fff; border-color: #4fb0ff; font-weight: 700; }
.nav-group-title {
  padding: 14px 18px 4px;
  font-size: 11px;
  letter-spacing: .05em;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
}

table.data-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
table.data-table th, table.data-table td { padding: 8px 10px; border-bottom: 1px solid #eef0f2; text-align: right; }
/* v18: تحسين تناسق الجداول - أعمدة فيها شارات/أزرار متعددة بتترص عمودي بدل ما
   تلف أفقي وتخلي عرض العمود مش ثابت من صف للتاني */
/* v14: تكبير خانة اسم الصنف فى صفوف بنود الفواتير/عروض الأسعار لوضوح أكتر */
/* v20: تكبير إضافي بناءً على طلب أحمد */
table.data-table .col-item-name, table.data-table td.item-name-cell { min-width: 320px; }
table.data-table .col-item-name input, table.data-table td.item-name-cell input { min-width: 300px; }
table.data-table th { background: #f6f8fa; font-weight: 700; color: #374151; }
table.data-table tr:hover td { background: #fafcff; }

.card { background: #fff; border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 20px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; border: none; }
.btn-primary { background: #0f4c81; color: #fff; }
.btn-primary:hover { background: #0c3c68; }
.btn-secondary { background: #eef1f4; color: #1f2937; }
.btn-secondary:hover { background: #e2e6ea; }
.btn-danger { background: #fde8e8; color: #b91c1c; }
.btn-danger:hover { background: #fbd5d5; }
.form-input, .form-select {
  width: 100%; border: 1px solid #d8dde3; border-radius: 8px; padding: 8px 10px; font-size: 14px;
}
.form-input:focus, .form-select:focus { outline: none; border-color: #0f4c81; box-shadow: 0 0 0 2px rgba(15,76,129,.15); }
/* حذف أسهم الزيادة/النقصان من كل خانات الأرقام فى البرنامج كله */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
/* خانات مقاسات كارت القص - أكبر وأوضح */
.measure-input { font-size: 16px !important; padding: 10px 8px !important; text-align: center; }
.form-label { display:block; font-size: 12px; font-weight: 700; color: #4b5563; margin-bottom: 4px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,20,30,.5);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal-box { background: #fff; border-radius: 16px; max-width: 640px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 24px; }
/* v20: مودال أعرض لشاشات الإدخال الكبيرة (زي كارت تشغيل القص) */
.modal-box-wide { max-width: 1100px; }

.badge { display:inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-green { background:#e6f7ee; color:#0a7a3d; }
.badge-yellow { background:#fff6e0; color:#8a6100; }
.badge-gray { background:#eef1f4; color:#4b5563; }
.badge-red { background:#fde8e8; color:#c81e1e; }
.badge-blue { background:#e8f1fd; color:#1d4ed8; }
.badge-purple { background:#f3e8fd; color:#7e22ce; }
.badge-teal { background:#e6f7f5; color:#0f766e; }
.badge-indigo { background:#eef0fd; color:#4338ca; }
.badge-orange { background:#fff1e6; color:#c2540a; }

.kpi-value { font-size: 26px; font-weight: 800; color:#0f2438; }
.kpi-label { font-size: 13px; color:#6b7280; font-weight:700; }

/* حقول الأرقام والتواريخ بالإنجليزي دايماً */
input[type=number], input[type=date] { direction: ltr; text-align: right; }

/* طباعة الفواتير */
#printArea { position: fixed; top: 0; left: -10000px; width: 794px; background: #fff; }
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { display: block; position: absolute; top: 0; left: 0; width: 100%; }
  .no-print { display: none !important; }
}
.print-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.print-header img { max-height: 150px; max-width: 260px; object-fit: contain; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.print-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.print-table th, .print-table td { border: 1px solid #999; padding: 6px 8px; text-align: right; }
.print-table th { background: #f0f0f0; }

/* =========================================================
   v19-fix8: لوحة التحكم - كروت ملوّنة بأيقونات (بدل الكروت البيضاء المتشابهة)
   ========================================================= */
.kpi-card { position: relative; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,20,30,.1); }
.kpi-card::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 4px; }
.kpi-card .kpi-icon {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; margin-bottom: 10px;
}

.kpi-blue::before { background: linear-gradient(90deg,#1d4ed8,#3b82f6); } .kpi-blue .kpi-icon { background:#e8f1fd; }
.kpi-orange::before { background: linear-gradient(90deg,#c2540a,#f97316); } .kpi-orange .kpi-icon { background:#fff1e6; }
.kpi-red::before { background: linear-gradient(90deg,#c81e1e,#ef4444); } .kpi-red .kpi-icon { background:#fde8e8; }
.kpi-green::before { background: linear-gradient(90deg,#0a7a3d,#10b981); } .kpi-green .kpi-icon { background:#e6f7ee; }
.kpi-purple::before { background: linear-gradient(90deg,#7e22ce,#a855f7); } .kpi-purple .kpi-icon { background:#f3e8fd; }
.kpi-yellow::before { background: linear-gradient(90deg,#8a6100,#f59e0b); } .kpi-yellow .kpi-icon { background:#fff6e0; }
.kpi-teal::before { background: linear-gradient(90deg,#0f766e,#14b8a6); } .kpi-teal .kpi-icon { background:#e6f7f5; }
.kpi-indigo::before { background: linear-gradient(90deg,#4338ca,#6366f1); } .kpi-indigo .kpi-icon { background:#eef0fd; }
.kpi-emerald::before { background: linear-gradient(90deg,#047857,#34d399); } .kpi-emerald .kpi-icon { background:#ecfdf5; }
.kpi-rose::before { background: linear-gradient(90deg,#be123c,#f43f5e); } .kpi-rose .kpi-icon { background:#ffe4e9; }

.section-heading {
  display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 8px;
  padding-right: 10px; border-right: 4px solid #0f4c81; color: #0f2438;
}

/* شارت المبيعات اليومية - تدرج لوني للأعمدة */
.daily-bar { background: linear-gradient(180deg,#3b82f6,#1d4ed8); border-radius: 6px 6px 2px 2px; transition: opacity .15s; }
.daily-bar:hover { opacity: .8; }

/* v20-1: شريط فلترة الفترة فى الداشبورد - ثابت أعلى الشاشة أثناء التمرير
   (الداشبورد بقى طويل جدًا بعد إضافة كل الأقسام الجديدة) */
.dashboard-filter-sticky {
  position: sticky; top: 0; z-index: 20; background: #f6f8fa;
  padding: 10px 4px; margin: -10px -4px 12px; border-bottom: 1px solid #e5e9ee;
}

/* v20-4: شارت المبيعات والربحية - 3 أعمدة مصغّرة (مبيعات/تكلفة/ربح) جنب بعض لكل خانة */
.trend-bar { width: 8px; border-radius: 3px 3px 1px 1px; transition: opacity .15s; }
.trend-bar:hover { opacity: .75; }
.trend-bar-sales { background: linear-gradient(180deg,#3b82f6,#1d4ed8); }
.trend-bar-cost { background: linear-gradient(180deg,#fb923c,#f97316); }
.trend-bar-profit { background: linear-gradient(180deg,#34d399,#0a7a3d); }
.trend-bar-loss { background: linear-gradient(180deg,#f87171,#c81e1e); }
