/* ===============================
   Falcon 7AI - Dashboard Styles
   =============================== */

:root {
  --primary: #0D3076;
  --primary-dark: #2563EB;
  --primary-light: #e8edff;
  --bg: #E5EEFF;
  --bg-card: #ffffff;
  --success: #15bb8b;
  --success-light: #e3f7ee;
  --warning: #f9a826;
  --warning-light: #fff3df;
  --danger: #ef4444;
  --danger-light: #ffe8ea;
  --info-purple: #f0e9ff;
  --navy: #15233d;
  --navy-light: #6b7794;
  --border: #e3e7f1;
  --gray: #c9d0e0;
  --shadow-sm: 0 2px 6px rgba(21, 35, 61, .04);
  --shadow-md: 0 6px 20px rgba(37, 73, 235, .08);
  --shadow-lg: 0 12px 36px rgba(37, 73, 235, .12);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all .25s ease;
}

* { box-sizing: border-box; }

html, body {
  font-family: 'Droid-Arabic-Kufi', sans-serif;
  background: var(--bg);
  color: var(--navy);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  /* الاتجاه يُورَّث من <html dir> ليعمل RTL/LTR تلقائيًا (لا نُثبّته على rtl) */
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
a:hover { color: var(--primary); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ============ Layout ============ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: #fff;
  min-height: 100vh;
  padding: 24px 18px;
  position: fixed;
  top: 0;
  inset-inline-start: 0; /* يمين في RTL، يسار في LTR تلقائيًا */
  z-index: 1040;
  box-shadow: -4px 0 18px rgba(21,35,61,.04);
  transition: var(--transition);
}

.sidebar.collapsed { width: 80px; padding: 24px 12px; }
.sidebar.collapsed .nav-text,
.sidebar.collapsed .sidebar-logo .logo-text { display: none; }
.sidebar.collapsed .sidebar-toggle i { transform: rotate(180deg); }
.sidebar.collapsed .nav-link { justify-content: center; padding: 12px; }
.sidebar.collapsed .has-submenu > .nav-link::after,
.sidebar.collapsed .submenu { display: none !important; }

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 36px;
  height: 60px;
}
.sidebar-logo img { width: 48px; height: auto; }

.sidebar-toggle {
  position: absolute;
  top: 78px;
  inset-inline-end: -14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  color: var(--primary);
  z-index: 5;
  padding: 0;
  transition: background .25s ease, color .25s ease, box-shadow .25s ease;
}
.sidebar-toggle i { transition: transform .25s ease; }
.sidebar-toggle:hover { background: var(--primary); color: #fff; }

.sidebar-nav { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sidebar-nav .nav-item { position: relative; }
 
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--navy);
  font-weight: 600;
  font-size: 15px;
}
.sidebar-nav .nav-link .nav-icon {
  width: 34px; height: 34px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
  transition: var(--transition);
}
.sidebar-nav .nav-link:hover { background: var(--primary-light); }
.sidebar-nav .nav-link.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37,73,235,.32);
}
.sidebar-nav .nav-link.active .nav-icon {
  background: var(--success);
  color: #fff;
}

.submenu {
  list-style: none;
  padding: 8px 36px 0 0;
  margin: 4px 0 0;
  display: none;
  flex-direction: column;
  gap: 6px;
}
.submenu.show { display: flex; }
.submenu li a {
  display: block;
  font-size: 14px;
  color: var(--navy-light);
  padding: 6px 0;
}
.submenu li a:hover { color: var(--primary); }

.has-submenu > .nav-link::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 11px;
  margin-inline-start: auto;
  color: currentColor;
  transition: transform .25s ease;
}
.has-submenu.open > .nav-link::after { transform: rotate(180deg); }

/* Main wrap */
.main-wrap {
  flex: 1;
  margin-inline-start: 220px; /* تنقلب تلقائيًا مع اتجاه اللغة */
  padding: 0 28px 28px;
  min-width: 0;
  transition: var(--transition);
}
.sidebar.collapsed ~ .main-wrap { margin-inline-start: 80px; }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  flex-wrap: wrap;
  justify-content: space-between;
}
.user-pill {
  display: flex;
  align-items: center;
  flex-direction: row; /* طبيعي للـLTR؛ يُعكس في RTL أدناه */
  gap: 10px;
  background: #fff;
  padding: 6px 6px 6px 14px;
  border-radius: 40px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  min-width: 150px;
}
[dir="rtl"] .user-pill { flex-direction: row-reverse; padding: 6px 14px 6px 6px; }
.user-pill img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.user-pill .user-info { text-align: start; } /* محاذاة بداية اللغة (يسار في الإنجليزية) */
.user-pill .user-name { font-weight: 700; font-size: 14px; line-height: 1.1; }
.user-pill .user-role { font-size: 12px; color: var(--navy-light); }
.user-pill i { color: var(--navy-light); margin-inline-end: auto; }

.icon-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.icon-btn:hover { background: var(--primary); color: #fff; }
.icon-btn .badge-dot {
  position: absolute; top: 8px; left: 8px;
  width: 9px; height: 9px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

.search-box {
  flex: 1 1 520px;
  max-width: 760px;
  min-width: 220px;
  position: relative;
  background: #fff;
  border-radius: 40px;
  box-shadow: var(--shadow-sm);
  padding: 4px 56px 4px 4px;
}
.topbar-user-contet{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}
.topbar-user-contet .dropdown-wrap,
.topbar-user-contet .mobile-toggle {
  flex: 0 0 auto;
}
.search-box::before {
  content: "\f002";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 4px; left: 4px;
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}
.search-box .select2-container--default .select2-selection--single,
.search-box .search-input {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  height: 42px;
  padding: 10px 14px !important;
}
.search-box .select2-container--default .select2-selection--single .select2-selection__arrow { display: none; }

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 18px 0 24px;
}
.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
  position: relative;
  padding-right: 14px;
}

/* تلوين عنوان الصفحة بالأزرق — مُستخدَم في 18 شاشة عبر class="page-title title-blue"
   لكنه لم يكن معرّفًا، فكانت العناوين تظهر بلون navy بدل الأزرق المقصود. */
.title-blue,
.page-title.title-blue { color: var(--primary); }
 
 .page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.back-btn {
  width: 44px; height: 44px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--primary-dark);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.back-btn:hover { background: #fff; }

/* Buttons */
.btn-primary,
.btn-success,
.btn-warning,
.btn-danger,
.btn-dark,
.btn-outline,
.btn-light,
.btn-dark-red {
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}
.btn-primary { background: var(--primary-dark); color: #fff !important; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-success { background: var(--success); color: #fff !important; }
.btn-success:hover { background: #11a075; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-warning { background: var(--warning); color: #fff !important; }
.btn-warning:hover { background: #e09000; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: #fff !important; }
.btn-dark-red { background: #730000; color: #fff !important; }
.btn-danger:hover ,.btn-dark-red:hover{ background: #cc2f2f; transform: translateY(-1px); }
.btn-dark { background: #6c757d; color: #fff !important; }
.btn-dark:hover { background: #555; }
.btn-light { background: #eef2fb; color: var(--navy); border: 1px solid var(--border); }
.btn-light:hover { background: #e2e8f5; border-color: #c3ccde; transform: translateY(-1px); }
.btn-sm { padding: 7px 13px !important; font-size: 13px !important; }
.btn-outline { background: transparent; color: var(--success); border: 1.5px solid var(--success); }
.btn-outline:hover { background: var(--success); color: #fff !important; }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 26px; font-size: 16px; }

/* Cards */
.card-glass {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.invoice-items-page .card-glass{
  background: transparent;
}
/* Welcome cards (home) */
.welcome-grid-br{
    display: flex;
  align-items: center;
  flex-wrap: wrap;
   gap: 30px;
}
 .welcome-grid-items{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
   gap: 30px;
 }
.welcome-title {
  flex: 0 0 100%;
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 6px;
}
.weather-card {
  background: linear-gradient(160deg, #f6c34a, #d18a3c);
  border-radius: var(--radius-lg);
  padding: 18px;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 240px;
  height: 100%;
  flex: 0 1 320px;
  box-shadow: var(--shadow-md);
}
.weather-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../images/a6d8c41a11cf88b69233dff9974584bd5e7c90b5.jpg') center/cover;
  opacity: .35;
  z-index: 0;
}
.weather-card > * { position: relative; z-index: 1; }
.weather-temp { font-size: 42px; font-weight: 800; line-height: 1; }
.weather-place { font-size: 14px; opacity: .9; }
.weather-info {
  position: absolute;
  bottom: 14px; right: 14px; left: 14px;
  z-index: 2;
}
.weather-date { font-weight: 700; }
.weather-state { font-size: 13px; opacity: .85; }
.weather-icon { display: flex; align-items: center; gap: 6px; font-size: 13px; }

.module-card {
  flex: 0 0 48%;
  width: 48%;
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: space-between;
  font-weight: 800;
  font-size: 18px;
  color: var(--navy);
  position: relative;
  min-height: 110px;
 
  cursor: pointer;
  transition: var(--transition);
  background: #fff;
  box-shadow: 0px 0px 10px 0px #00000040;
}
.module-card-text{
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 30px;
}
.module-card-text .title{
  font-size: 32px;
  font-weight: bold;
}
 
.module-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--navy); }
.module-card .module-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 20px;
 
}
.module-card .arrow {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--navy);
}
.module-card.module-blue { background: var(--primary-light); }
.module-card.module-blue .module-icon { background: linear-gradient(135deg, #3b6ef6, #2348c9); box-shadow: 0 6px 14px -5px #3b6ef6; }
.module-card.module-green { background: var(--success-light); }
.module-card.module-green .module-icon { background: linear-gradient(135deg, #1ec48f, #0e9e72); box-shadow: 0 6px 14px -5px #1ec48f; }
.module-card.module-yellow { background: var(--warning-light); }
.module-card.module-yellow .module-icon { background: linear-gradient(135deg, #fbab3c, #f08a1d); box-shadow: 0 6px 14px -5px #fbab3c; }
.module-card.module-purple { background: var(--info-purple); }
.module-card.module-purple .module-icon { background: linear-gradient(135deg, #8b5cf6, #6d34e6); box-shadow: 0 6px 14px -5px #8b5cf6; }

/* stats */
.stats-section {
  margin-top: 50px;
  display: flex;
  gap: 18px;
}
.stats-section .stats-box:first-child {flex: 2 1 0; }
.stats-section .stats-box:last-child {  flex: 1 1 0; }
 
.section-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  position: relative;
  padding-right: 12px;
  margin: 0 0 18px;
}
.section-title.text-blue { color: var(--primary); }
.section-title::before {
  content: "";
  position: absolute;
  right: 0; top: 4px; bottom: 4px;
  width: 3px; border-radius: 4px;
  background: currentColor;
}
.stat-grid {
    background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
      min-height: 200px;
}
.stat-card {
  flex: 1 1 calc((100% - 24px) / 3);
  text-align: center;
  padding: 14px;
}
.stat-card img { width: 52px; height: 52px; object-fit: contain; }
.stat-card .stat-num {
  font-size: 20px;
  font-weight: 800;
  margin-top: 8px;
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--navy-light);
  margin-top: 2px;
}
.stat-card.s-blue .stat-num { color: var(--primary); }
.stat-card.s-warn .stat-num { color: var(--warning); }
.stat-card.s-success .stat-num { color: var(--success); }
/* المتغيّرات s-danger و s-purple كانت مُستخدَمة في لوحة التحكم/التقارير بلا تعريف. */
.stat-card.s-danger .stat-num { color: var(--danger); }
.stat-card.s-purple .stat-num { color: #7c4dff; }

/* ============ بطاقات مؤشّرات احترافية (KPI) — لوحة المنصة/التحكم ============ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
/* شريط لوني عند حافة البداية */
.kpi-card::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--kpi, var(--primary-dark));
}
/* توهّج خفيف في الزاوية بلون البطاقة */
.kpi-card::after {
  content: "";
  position: absolute;
  inset-block-start: -34px;
  inset-inline-start: -34px;
  width: 92px; height: 92px;
  border-radius: 50%;
  background: var(--kpi, var(--primary-dark));
  opacity: .07;
}
.kpi-icon {
  flex: 0 0 54px;
  width: 54px; height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  font-size: 23px;
  color: #fff;
  background: linear-gradient(135deg, var(--kpi, var(--primary-dark)), var(--kpi2, var(--primary)));
  box-shadow: 0 8px 16px -6px var(--kpi, var(--primary-dark));
}
.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
  color: var(--navy);
}
.kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-light);
  margin-top: 5px;
}
/* ألوان المتغيّرات */
.kpi-blue   { --kpi: #3b6ef6; --kpi2: #2348c9; }
.kpi-green  { --kpi: #1ec48f; --kpi2: #0e9e72; }
.kpi-orange { --kpi: #fbab3c; --kpi2: #f08a1d; }
.kpi-red    { --kpi: #f4525f; --kpi2: #e0303f; }
.kpi-purple { --kpi: #8b5cf6; --kpi2: #6d34e6; }
.kpi-teal   { --kpi: #14c0c8; --kpi2: #0e97ab; }
.kpi-indigo { --kpi: #5566f0; --kpi2: #3b45d4; }
.kpi-pink   { --kpi: #f25fae; --kpi2: #df3f93; }

/* شبكة KPI بثلاثة أعمدة (لصفحات ٦ كروت — تناسق ٣+٣) */
.kpi-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 992px) { .kpi-grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .kpi-grid.cols-3 { grid-template-columns: 1fr; } }

/* ============ شبكة معلومات أنيقة (صفحات العرض) — ٤ أعمدة متناسقة ============ */
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .info-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .info-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .info-grid { grid-template-columns: 1fr; } }
.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: #f7f9fc;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: var(--transition);
}
.info-item:hover { border-color: #c3ccde; background: #fff; box-shadow: var(--shadow-sm); }
.info-label { font-size: 12.5px; font-weight: 600; color: var(--navy-light); }
.info-label i { color: var(--primary-dark); margin-inline-end: 6px; }
.info-value { font-size: 15px; font-weight: 700; color: var(--navy); word-break: break-word; }

/* شارة حالة على شكل حبّة */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700;
  padding: 5px 13px; border-radius: 20px;
  white-space: nowrap;
}
.pill.is-active    { background: var(--success-light); color: #0f7a52; }
.pill.is-suspended { background: var(--danger-light); color: #b91c1c; }
.pill.is-trial     { background: var(--warning-light); color: #9a6700; }

/* ============ شرائح اختيار أنيقة (Checkbox chips) ============ */
.check-chip-group { display: flex; flex-wrap: wrap; gap: 12px; }
.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}
.check-chip:hover { border-color: #c3ccde; }
.check-chip input[type="checkbox"] {
  width: 17px; height: 17px;
  margin: 0;
  accent-color: var(--primary-dark);
  cursor: pointer;
}
.check-chip:has(input:checked) {
  border-color: var(--primary-dark);
  background: var(--primary-light);
  color: var(--primary);
}

@media (max-width: 992px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .kpi-grid { grid-template-columns: 1fr; } }
.empty-state {
    background: #fff;
  border-radius: var(--radius-lg);
      min-height: 200px;
  text-align: center;
  font-size: 16px;
  color: var(--gray);
  padding: 50px 0;
  font-weight: 700;
}

/* ============ Tables ============ */
.table-wrap {
  background: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  min-width: 720px;
}
.data-table thead {
  background: #2563EB;
  color: #fff;
}
.data-table th {
  padding: 16px 12px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.data-table tbody td {
  padding: 14px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr:nth-child(even) { background: #f6f8ff; }
.data-table tbody tr:hover { background: var(--primary-light); }
.data-table .row-id { color: var(--danger); font-weight: 700; }
.cell-img {
  width: 42px; height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, #b6d6ff, #8ab4f8);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.action-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 3px;
  color: #fff;
  font-size: 13px;
  background: var(--navy-light); /* لون افتراضي محايد بدل الباهت/الشفاف */
  box-shadow: 0 2px 5px rgba(21, 35, 61, .12);
  transition: var(--transition);
}
/* ألوان مميّزة ومتناسقة لكل إجراء */
.action-btn.view   { background: #2563EB; }                 /* أزرق — عرض */
.action-btn.edit   { background: #f59e0b; }                 /* كهرماني — تعديل */
.action-btn.toggle { background: #14b8a6; }                 /* تركوازي — تفعيل/إيقاف */
.action-btn.delete { background: #ef4444; }                 /* أحمر — حذف */
.action-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px -4px rgba(21, 35, 61, .35); filter: brightness(1.05); }

.tab-toggle { display: inline-flex; gap: 26px; margin-bottom: 16px; }
.tab-toggle a {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-light);
  position: relative;
}
.tab-toggle a.active { color: var(--primary); }
.tab-toggle a.active::after {
  content:"";
  position: absolute;
  bottom: -8px; right: 0; left: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 4px;
}

/* Status pills */
.status { font-weight: 700; font-size: 13px; }
.status.completed { color: var(--success); }
.status.pending { color: var(--warning); }
.status.new { color: var(--primary); }

/* ============ Forms ============ */
.form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
}
.form-grid .form-group { flex: 1 1 calc((100% - 24px) / 2); }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}
.form-control,
.select2-container--default .select2-selection--single {
  border: 1.5px solid var(--border);
  background: #fff;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: inherit;
  font-size: 14px;
  color: var(--navy);
  outline: none;
  transition: var(--transition);
  width: 100%;
  height: auto;
  box-shadow: 0 1px 2px rgba(21, 35, 61, .04);
}
.form-control:hover,
.select2-container--default .select2-selection--single:hover { border-color: #c3ccde; }
.form-control:focus,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(37, 73, 235, .12);
}
.form-control.has-success { border-color: var(--success); }
.form-control::placeholder { color: var(--navy-light); }

textarea.form-control { resize: vertical; min-height: 100px; }

/* select2 customizations */
.select2-container--default .select2-selection--single {
  height: 50px;
  padding-top: 12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 0;
  color: var(--navy);
  line-height: 1.4;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 50px;
  inset-inline-end: 12px; inset-inline-start: auto;
}
.select2-dropdown { border: 1px solid var(--border); border-radius: var(--radius-md); }

.form-actions { margin-top: 26px; display: flex; gap: 10px; flex-wrap: wrap; }

/* image upload */
.upload-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--navy-light);
  font-weight: 700;
  transition: var(--transition);
}
.upload-box:hover { border-color: var(--primary); color: var(--primary); }
.upload-box i { font-size: 42px; margin-bottom: 8px; }

/* Invoice page chips */
.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.choice-grid .choice-chip { flex: 1 1 calc((100% - 36px) / 4); }
.choice-grid.cols-3 .choice-chip { flex-basis: calc((100% - 24px) / 3); }
.choice-chip {
  background: #fff;
  border: none;
  padding: 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #fff;
  transition: var(--transition);
}
.choice-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.choice-chip.is-blue { background: var(--primary); }
.choice-chip.is-cyan { background: #43b4d4; }
.choice-chip.is-yellow { background: var(--warning); }
.choice-chip.is-green { background: var(--success); }
.choice-chip.is-navy { background: #0e2a52; }
.choice-chip.is-deep-blue { background: #1C449C; }
.choice-chip.is-dark { background: #000C26; }

.invoice-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px 22px;
  font-weight: 800;
  font-size: 18px;
  margin-top: 18px;
}
.invoice-summary .total { color: var(--success); font-size: 22px; }

.cart-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.cart-actions > * { flex: 1 1 calc((100% - 30px) / 4); }
.btn-cli a{
  width: 180px;
  height: 50px;
}

/* ============ Auth pages ============ */
.auth-page {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 18px;
}
.auth-card {
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  max-width: 1280px;
  gap: 30px;
}
.auth-card > * { flex: 1 1 calc((100% - 30px) / 2); }
.auth-form-wrap { padding: 30px; }
.auth-title { font-size: 56px; font-weight: 800; margin: 0 0 8px; color: var(--primary);}
.auth-subtitle { color: var(--navy-light); font-size: 15px; margin: 0 0 26px; }
.auth-logo { display: flex; justify-content: center; }
.auth-logo img { max-width: 360px; width: 100%; }
.auth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 8px;
}
.auth-meta label { display: inline-flex; align-items: center; gap: 6px; }
.auth-meta a { color: var(--navy-light); }

.code-inputs {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  margin: 14px 0 24px;
}
.code-inputs input {
  width: 60px; height: 60px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  background: #fff;
  outline: none;
  box-shadow: var(--shadow-sm);
  color: var(--navy);
}
.code-inputs input.filled { background: var(--success); color: #fff; }
.code-inputs input:focus { border-color: var(--success); }

/* Modal styling for popups */
.modal-content {
  border-radius: var(--radius-lg);
  border: none;
  background: var(--primary-light);
  text-align: center;
  padding: 28px;
}
.modal-content .check-icon {
  width: 90px; height: 90px;
  margin: 0 auto 18px;
  background: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--success);
  font-size: 38px;
}
.modal-content p { font-weight: 700; font-size: 16px; }

/* ============ Branch detail ============ */
.branches-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px;
}
.branches-stats .stat-card { padding: 8px; }
.branches-stats .stat-card { flex: 1 1 calc((100% - 36px) / 4); }

/* ============ Welcome (intro) ============ */
.intro-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}
.intro-card { max-width: 580px; }
.intro-card img { max-width: 240px; margin-bottom: 20px; }
.intro-card h1 { font-size: 30px; font-weight: 800; margin-bottom: 10px; }
.intro-card p { color: var(--navy-light); font-size: 15px; margin-bottom: 26px; }

/* ============ Owl carousel arrows ============ */
.owl-theme .owl-nav button.owl-prev,
.owl-theme .owl-nav button.owl-next {
  background: #fff !important;
  width: 38px; height: 38px;
  border-radius: 50% !important;
  color: var(--primary) !important;
  box-shadow: var(--shadow-sm);
  font-size: 16px !important;
}
.owl-theme .owl-dots .owl-dot.active span {
  background: var(--primary) !important;
}

/* ============ Dropdowns (user / notifications / cart) ============ */
.dropdown-wrap { position: relative; }
.user-pill, .icon-btn { user-select: none; }
.dropdown-menu-custom {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 280px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 14px 40px rgba(21,35,61,.14);
  padding: 10px 0;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.dropdown-wrap.open > .dropdown-menu-custom {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-menu-custom .dropdown-header {
  padding: 8px 14px;
  font-weight: 800;
  color: var(--navy);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.dropdown-menu-custom .dropdown-header .badge {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  border-radius: 10px;
  padding: 2px 8px;
}
.dropdown-menu-custom a,
.dropdown-menu-custom .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--navy);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.dropdown-menu-custom a:hover,
.dropdown-menu-custom .dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.dropdown-menu-custom a > i:first-child {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.dropdown-menu-custom a.text-danger { color: var(--danger) !important; }
.dropdown-menu-custom a.text-danger > i:first-child {
  background: var(--danger-light) !important;
  color: var(--danger) !important;
}
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.dropdown-footer {
  padding: 10px 14px;
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}
.dropdown-footer:hover { background: var(--primary-light); }

.user-dropdown-head {
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  text-align: center;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin: -10px 0 6px;
}
.user-dropdown-head img {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.4);
  margin-bottom: 8px;
}
.user-dropdown-head .name { font-weight: 800; }
.user-dropdown-head .mail { font-size: 12px; opacity: .85; }

/* Notification list */
.notif-list { list-style: none; padding: 0; margin: 0; max-height: 320px; overflow-y: auto; }
.notif-list li {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  transition: var(--transition);
}
.notif-list li:hover { background: var(--primary-light); }
.notif-list li:last-child { border: 0; }
.notif-list .notif-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.notif-list .notif-icon.green { background: var(--success-light); color: var(--success); }
.notif-list .notif-icon.blue { background: var(--primary-light); color: var(--primary); }
.notif-list .notif-icon.orange { background: var(--warning-light); color: var(--warning); }
.notif-list .notif-icon.red { background: var(--danger-light); color: var(--danger); }
.notif-list .notif-body { flex: 1; }
.notif-list .notif-title { font-weight: 700; margin-bottom: 2px; color: var(--navy); }
.notif-list .notif-time { font-size: 11px; color: var(--navy-light); }

/* ============ Orders / sales POS page ============ */
.orders-grid {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.orders-grid > :not(.cart-panel) { flex: 1 1 0; min-width: 0; }
.orders-grid .cart-panel { flex: 0 0 22%; }
.product-card {
  background: #fff;
  border-radius: 14px;
  padding: 0;
  text-align: start;
  position: relative;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(21,35,61,.16);
  overflow: hidden;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.product-card .product-img {
  height: 160px;
  background: linear-gradient(135deg, #f3e7d3, #d8c4a4);
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  color: #6b4e2a;
  font-size: 38px;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}
.product-card .product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-info {
  padding: 14px 16px 16px;
  min-height: 128px;
  display: flex;
  flex-direction: column;
}
.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  gap: 10px;
  margin-bottom: 8px;
}
.price-tag img{
  max-width: 20px;
}
.product-card .product-name {
  font-weight: 800;
  font-size: 16px;
  color: var(--primary);
  line-height: 1.5;
  margin-bottom: 16px;
}
.product-card .product-cat {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  text-align: end;
}
.product-card .price-tag {
  position: static;
  background: transparent;
  border-radius: 0;
  padding: 0;
  font-weight: 700;
  font-size: 13px;
  color: var(--success);
  box-shadow: none;
  white-space: nowrap;
}
.product-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  gap: 12px;
}
.product-card .cart-add-btn {
  width: 42px;
  height: 42px;
  background: var(--warning);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.product-card .cart-add-btn:hover { background: var(--success); transform: translateY(-1px); }

/* زر «إضافة للسلة» — كان كلاسه (.add-cart) بلا تعريف فظهر بشكل المتصفح الافتراضي */
.product-card .add-cart {
  width: 100%;
  border: none;
  border-radius: 11px;
  padding: 11px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #3b6ef6, #2348c9);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 14px -6px #3b6ef6;
  transition: var(--transition);
}
.product-card .add-cart i { font-size: 15px; }
.product-card .add-cart:hover { transform: translateY(-2px); box-shadow: 0 11px 20px -8px #3b6ef6; filter: brightness(1.05); }
.product-card .add-cart:active { transform: translateY(0); filter: brightness(.97); }
.qty-control {
  display: flex;
  align-items: center;
  gap: 12px;
  direction: ltr;
}
.qty-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  color: #fff;
  background: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.qty-btn:hover { transform: scale(1.08); }
.qty-btn.product-minus {
  background: #b7b7b7;
}
.product-qty {
  min-width: 18px;
  text-align: center;
  color: var(--primary);
  font-weight: 800;
  font-size: 20px;
}

.cart-panel {
  background: #fff;
  border: 1px solid #d5e1f4;
  border-radius: 14px;
  padding: 0 14px 16px;
  box-shadow: 0 2px 8px rgba(21,35,61,.14);
  position: sticky;
  top: 20px;
  height: fit-content;
  overflow: hidden;
}
.cart-panel-title { display: none; }
.cart-mini-table {
  width: calc(100% + 28px);
  margin: 0 -14px;
  font-size: 11px;
  border-collapse: collapse;
  table-layout: fixed;
}
.cart-mini-table thead th {
  background: #dfeafe;
  color: #111827;
  padding: 12px 6px;
  font-weight: 800;
  text-align: center;
}
.cart-mini-table tbody td {
  padding: 10px 6px;
  border-bottom: 1px solid #edf0f5;
  text-align: center;
  color: #8a8f99;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-mini-table tbody td:first-child {
  text-align: start;
}
.cart-remove {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.cart-summary {
  padding-top: 12px;
}
.cart-products-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8a8f99;
  font-size: 11px;
  margin-bottom: 12px;
}
.cart-clear {
  border: 0;
  background: transparent;
  color: var(--danger);
  font-size: 11px;
  padding: 0;
  cursor: pointer;
}
.cart-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  padding: 0;
  font-size: 15px;
  border-top: 0;
  margin: 0 0 12px;
  color: #111827;
}
.cart-total-line .v { color: #111827; font-size: 15px; }
.cart-count-text {
  display: none;
}
.cart-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cart-fast-sale,
.cart-open-link {
  min-height: 28px;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.cart-fast-sale { background: #4caf50; }
.cart-open-link { background: #2d94df; }
.cart-fast-sale:hover,
.cart-open-link:hover { color: #fff; filter: brightness(.96); }

/* ============ Tax invoice page ============ */
.tax-invoice-page {
  background: #e9f0ff;
  border-radius: 4px;
  padding: 28px;
}
.tax-invoice-paper {
  background: #fff;
  border-radius: 4px;
  padding: 24px 28px 26px;
  box-shadow: var(--shadow-sm);
}
.tax-invoice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.tax-qr {
  width: 88px;
  height: 88px;
  border: 1px solid var(--border);
  background: #f5f7fb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  font-size: 24px;
}
.tax-title-box {
  min-width: 330px;
  border: 1px solid #c9dcf7;
  background: #f5f9ff;
  border-radius: 3px;
  padding: 16px 24px;
  text-align: center;
  color: var(--primary);
}
.tax-title-box h1 {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 6px;
}
.tax-title-box span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2px;
}
.tax-brand {
  min-width: 110px;
  text-align: center;
  color: var(--primary);
}
.tax-brand img {
  display: block;
  width: 70px;
  margin: 0 auto 6px;
}
.tax-brand strong,
.tax-brand span {
  display: block;
  line-height: 1.2;
}
.tax-brand strong { font-size: 15px; }
.tax-brand span { font-size: 12px; }
.tax-info-band {
  background: #f1f4f9;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  margin-bottom: 28px;
}
.tax-info-col {
  flex: 1 1 0;
  font-size: 12px;
}
.tax-info-col span {
  display: block;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.tax-info-col strong {
  display: block;
  color: var(--navy);
  font-size: 12px;
  margin-bottom: 14px;
}
.tax-info-center { text-align: center; }
.tax-table-wrap {
  overflow-x: auto;
}
.tax-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  text-align: center;
}
.tax-table thead {
  background: #eaf2ff;
  color: var(--primary);
}
.tax-table th {
  padding: 14px 10px;
  font-size: 11px;
  font-weight: 800;
}
.tax-table td {
  padding: 18px 10px;
  border-bottom: 1px solid #edf1f6;
  font-size: 12px;
  color: var(--navy);
}
.tax-table td:nth-child(2) {
  text-align: right;
}
.tax-table td strong,
.tax-table td span {
  display: block;
}
.tax-table td strong {
  font-size: 13px;
  margin-bottom: 4px;
}
.tax-table td span {
  color: var(--navy-light);
  font-size: 10px;
}
.tax-qty {
  display: inline-flex !important;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #cfe5ff;
  color: var(--primary) !important;
  font-weight: 800;
}
.tax-invoice-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
}
.tax-total-card {
  width: 220px;
  background: #2866d8;
  color: #fff;
  border-radius: 3px;
  padding: 14px 16px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .24);
}
.tax-total-card span,
.tax-total-card small {
  display: block;
  font-size: 10px;
  font-weight: 800;
  opacity: .9;
}
.tax-total-card strong {
  display: inline-block;
  font-size: 30px;
  line-height: 1;
  margin-top: 8px;
}
.tax-total-card b {
  display: inline-block;
  font-size: 14px;
  margin-right: 12px;
}
.tax-summary {
  min-width: 220px;
  color: var(--navy);
}
.tax-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 12px;
}
.tax-summary span {
  color: var(--navy-light);
  font-size: 11px;
}
.tax-summary strong {
  font-size: 14px;
}
.tax-notes {
   background: #f0f5ff;
  padding: 18px;
  text-align: center;
}
.tax-notes h3 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}
.tax-notes p {
  margin: 4px 0;
  color: var(--navy-light);
  font-size: 11px;
}

/* ============ Dashboard settings pages ============ */
.dashboard-page {
  background: #e9f0ff;
  padding: 24px 28px 28px;
  min-height: 560px;
}
.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.dashboard-subtitle {
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
  margin: 12px 14px 0 0;
}
.dashboard-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dashboard-form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
}
.dashboard-form-grid .form-group {
  flex: 1 1 calc((100% - 24px) / 2);
}
.dashboard-page .form-group label {
  color: var(--primary);
  font-size: 13px;
  text-align: start;
}
.dashboard-page .form-control,
.dashboard-page .select2-container--default .select2-selection--single {
  min-height: 38px;
  border-radius: 4px;
  padding: 10px 14px;
  box-shadow: none;
  font-size: 12px;
}
.dashboard-page .form-control.has-success {
  border-color: var(--success);
}
.dashboard-textarea {
  min-height: 116px;
}
.dashboard-upload {
  min-height: 116px;
  background: #fff;
  border-radius: 4px;
  color: var(--navy-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
}
.dashboard-upload i {
  font-size: 22px;
  color: #9aa6ba;
}
.dashboard-save {
  min-height: 36px;
  border-radius: 4px;
  padding: 9px 18px;
}
.language-tabs {
  display: flex;
  gap: 16px;
}
.language-tab {
  flex: 1 1 0;
  min-height: 38px;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--primary-dark);
  cursor: pointer;
}
.language-tab.is-active {
  background: var(--success);
}
.language-tab input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary-dark);
}
.display-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.display-options h3 {
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
  margin: 4px 0 2px;
}
.setting-switch-row {
  min-height: 42px;
  background: #fff;
  border-radius: 4px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--navy);
  font-size: 12px;
  cursor: pointer;
}
.setting-switch-row input {
  display: none;
}
.setting-switch-row i {
  width: 34px;
  height: 18px;
  border-radius: 20px;
  background: #dbe5f5;
  position: relative;
  transition: var(--transition);
}
.setting-switch-row i::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-dark);
  transition: var(--transition);
}
.setting-switch-row input:checked + i {
  background: #d7e5ff;
}
.setting-switch-row input:checked + i::before {
  right: 19px;
}

/* ============ Deferred payment page ============ */
.pay-page {
  background: #e9f0ff;
  padding: 28px;
  min-height: 560px;
}
.pay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}


.form-check-vio{
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Coupon Radio Design */
.card-glass-voi.card-glass .row > .col-md-3:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 35px;
    direction: rtl;
}

/* Radio Item */
.card-glass-voi.card-glass .form-check {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
    flex-direction: row-reverse;
}

/* Label */
.card-glass-voi.card-glass .form-check-label {
    font-size: 18px;
    font-weight: 500;
    color: #8f96a8;
    cursor: pointer;
    margin: 0;
    line-height: 1;
}

/* Hide Bootstrap Default Style */
.card-glass-voi.card-glass .form-check-input {
    appearance: none;
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    border-radius: 0 !important;
    border: 0;
    background-color: #ffffff;
    margin: 0;
    cursor: pointer;
    position: relative;
    box-shadow: none;
    outline: none;
    transition: all 0.25s ease;
}

/* Checked Shape */
.card-glass-voi.card-glass .form-check-input:checked {
    background-color: #ffffff;
    border-radius: 10px !important;
    border: 2px solid #1f67ff;
}

/* Inner Blue Circle */
.card-glass-voi.card-glass .form-check-input:checked::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
     background-color: #1f67ff;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Focus Remove Bootstrap Shadow */
.card-glass-voi.card-glass .form-check-input:focus {
    box-shadow: none;
    outline: none;
}

/* Hover */
.card-glass-voi.card-glass .form-check:hover .form-check-label {
    color: #5f6b85;
}

.card-glass-voi.card-glass .form-check:hover .form-check-input {
    transform: scale(1.04);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .card-glass-voi.card-glass .row > .col-md-3:first-child {
        justify-content: flex-start;
        gap: 25px;
        flex-wrap: wrap;
        margin-bottom: 15px;
    }

    .card-glass-voi.card-glass .form-check-label {
        font-size: 18px;
    }

    .card-glass-voi.card-glass .form-check-input {
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }

    .card-glass-voi.card-glass .form-check-input:checked::before {
        width: 22px;
        height: 22px;
    }
}
.pay-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.pay-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
}
.pay-grid .form-group {
  flex: 1 1 calc((100% - 24px) / 2);
}
.pay-page .form-group label,
.pay-methods > label {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 7px;
}
.pay-input {
  min-height: 46px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pay-input.is-success { border-color: var(--success); }
.pay-input.is-warning { border-color: var(--warning); }
.pay-input input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--navy);
  font-family: inherit;
  font-size: 13px;
}
.pay-input span,
.pay-input i {
  color: var(--warning);
  font-size: 13px;
  flex: 0 0 auto;
}
.pay-input.is-success span { color: var(--success); }
.pay-input.has-icon {
  flex-direction: row-reverse;
}
.pay-notes {
  width: 100%;
  min-height: 190px;
  border: 1px solid #bfc8d8;
  border-radius: 7px;
  background: #fff;
  resize: vertical;
  outline: 0;
  padding: 18px;
  color: var(--navy);
  font-family: inherit;
  font-size: 13px;
}
.pay-notes::placeholder {
  color: #b6bdca;
}
.pay-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pay-method-list {
  display: flex;
  gap: 24px;
}
.pay-method {
  flex: 1 1 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
}
.pay-method input {
  width: 18px;
  height: 18px;
  margin: 0 12px;
  accent-color: var(--primary-dark);
}
.pay-method-name {
  flex: 1 1 auto;
  min-height: 46px;
  background: #9daac1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
.pay-method b {
  width: 80px;
  text-align: center;
  color: var(--navy);
  font-size: 12px;
}
.pay-submit {
  min-height: 44px;
  border-radius: 7px;
  margin-top: 8px;
}

.cat-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.cat-tabs::-webkit-scrollbar { height: 4px; }
.cat-tab {
  white-space: nowrap;
  background: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-light);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.cat-tab.active, .cat-tab:hover { background: var(--primary); color: #fff; }

@media (max-width: 992px) {
  .orders-grid { flex-direction: column; }
  .orders-grid > :not(.cart-panel),
  .orders-grid .cart-panel { flex: 1 1 auto; width: 100%; }
  .cart-panel { position: static; }
  .orders-grid .row > [class*="col-"] {
    flex: 0 0 50%;
    max-width: 50%;
  }
  .product-card .product-img {
    height: 150px;
  }
  .tax-invoice-head,
  .tax-info-band,
  .tax-invoice-footer {
    flex-wrap: wrap;
  }
  .tax-title-box {
    min-width: 260px;
  }
  .dashboard-page,
  .pay-page,
  .tax-invoice-page {
    padding: 22px;
  }
}

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .welcome-grid .module-card { flex-basis: calc((100% - 18px) / 2); }
  .weather-card { margin-top: 30px;flex-basis: 100%; min-height: 180px; }
  .stats-section { flex-direction: column; }
  .stats-section .stats-box { flex: 1 1 auto; }
  .branches-stats .stat-card { flex-basis: calc((100% - 12px) / 2); }
  .choice-grid .choice-chip,
  .choice-grid.cols-3 .choice-chip { flex-basis: calc((100% - 12px) / 2); }
  .cart-actions > * { flex-basis: calc((100% - 10px) / 2); }
  .form-grid .form-group { flex-basis: 100%; }
}

@media (max-width: 900px) {
  .auth-card { flex-direction: column; }
  .auth-card > * { flex: 1 1 auto; width: 100%; }
  .auth-logo { display: none; }
  .auth-title { font-size: 42px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
    width: 240px;
  }
  .sidebar.show { transform: translateX(0); }
  .sidebar.collapsed { transform: translateX(100%); width: 240px; padding: 24px 18px; }
  .sidebar.collapsed .nav-text,
  .sidebar.collapsed .sidebar-logo .logo-text { display: inline; }
  .sidebar.collapsed .nav-link { justify-content: space-between; padding: 12px 16px; }
  .sidebar.collapsed .has-submenu > .nav-link::after { display: inline-block !important; }
  .sidebar .sidebar-toggle {
    left: 14px;
    top: 24px;
    width: 34px;
    height: 34px;
  }
  .sidebar.collapsed .sidebar-toggle i { transform: none; }
  .main-wrap, .sidebar.collapsed ~ .main-wrap { margin-right: 0; padding: 0 14px 20px; }
  .topbar {
    gap: 8px;
    align-items: center;
  }
  .topbar-user-contet {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .user-pill { min-width: auto; padding: 4px 10px 4px 4px; }
  .user-pill .user-info { display: none; }
  .search-box { order: 5; flex-basis: 100%; max-width: 100%; min-width: 100%; }
  .welcome-grid .module-card { flex-basis: 100%; }
  .stat-grid .stat-card { flex-basis: calc((100% - 12px) / 2); }
  .auth-title { font-size: 34px; }
  .code-inputs input { width: 48px; height: 48px; font-size: 18px; }
  .data-table { min-width: 600px; }
  .page-title { font-size: 22px; }
  .page-header {
    align-items: flex-start;
    gap: 12px;
  }
  .page-actions {
    width: 100%;
  }
  .page-actions > * {
    flex: 1 1 auto;
  }
  .card-glass,
  .stats-box,
  .branches-stats {
    padding: 16px;
    border-radius: var(--radius-md);
  }
  .orders-grid .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .product-card .product-img {
    height: 180px;
  }
  .product-info {
    min-height: 118px;
  }
  .cart-mini-table {
    font-size: 11px;
  }
  .choice-grid .choice-chip,
  .choice-grid.cols-3 .choice-chip,
  .cart-actions > * {
    flex-basis: 100%;
  }
  .mobile-toggle { display: inline-flex !important; }
  .tax-invoice-page { padding: 14px; }
  .tax-invoice-paper { padding: 16px; }
  .tax-invoice-head,
  .tax-info-band,
  .tax-invoice-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .tax-title-box,
  .tax-total-card {
    width: 100%;
    min-width: 0;
  }
  .tax-info-center { text-align: right; }
  .dashboard-page { padding: 18px 14px; }
  .dashboard-form-grid .form-group,
  .language-tab {
    flex-basis: 100%;
  }
  .language-tabs {
    flex-direction: column;
  }
  .pay-page { padding: 18px 14px; }
  .pay-grid .form-group,
  .pay-method {
    flex-basis: 100%;
  }
  .pay-method-list {
    flex-direction: column;
  }
}

@media (max-width: 576px) {
  .main-wrap,
  .sidebar.collapsed ~ .main-wrap {
    padding: 0 10px 18px;
  }
  .topbar {
    padding: 12px 0;
  }
  .icon-btn,
  .mobile-toggle,
  .back-btn {
    width: 40px;
    height: 40px;
  }
  .search-box {
    padding-right: 48px;
  }
  .search-box::before {
    width: 36px;
    height: 36px;
  }
  .page-title {
    font-size: 20px;
    padding-inline-start: 10px;
  }
  .btn-primary,
  .btn-success,
  .btn-warning,
  .btn-danger,
  .btn-dark,
  .btn-outline {
    width: 100%;
    padding: 11px 14px;
  }
  .welcome-grid,
  .stats-section,
  .stat-grid,
  .branches-stats,
  .form-grid,
  .choice-grid,
  .cart-actions {
    gap: 12px;
  }
  .stat-grid .stat-card,
  .branches-stats .stat-card {
    flex-basis: 100%;
  }
  .invoice-summary {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    font-size: 15px;
  }
  .auth-page {
    padding: 18px 10px;
  }
  .auth-form-wrap {
    padding: 18px 0;
  }
  .code-inputs {
    gap: 8px;
  }
  .code-inputs input {
    width: 42px;
    height: 42px;
  }
  .dropdown-menu-custom {
    left: auto;
    right: 0;
    min-width: min(280px, calc(100vw - 28px));
  }
  .tax-title-box {
    min-width: 0;
    padding: 14px;
  }
  .tax-qr {
    width: 76px;
    height: 76px;
  }
  .tax-table,
  .data-table {
    min-width: 560px;
  }
  .tax-total-card {
    padding: 14px;
  }
  .dashboard-head,
  .pay-head {
    align-items: flex-start;
  }
  .dashboard-subtitle,
  .display-options h3 {
    font-size: 16px;
  }
  .pay-notes {
    min-height: 150px;
  }
}

.mobile-toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(21,35,61,.45);
  z-index: 1030;
}
.sidebar-overlay.show { display: block; }

/* ============ UX Enhancements (loading states, toasts, dismissable alerts) ============ */

/* زر في حالة التحميل: يعطّل التفاعل ويُظهر دوّارة مكان المحتوى */
.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
  opacity: .85;
}
.is-loading > * { visibility: hidden; }
.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, .55);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fl-spin .6s linear infinite;
}
/* للأزرار الفاتحة/المحدّدة تكون الدوّارة داكنة لتظهر على الخلفية الفاتحة */
.btn-light.is-loading::after,
.btn-outline.is-loading::after,
.btn-sm.is-loading::after { border-color: rgba(37, 73, 235, .25); border-top-color: var(--primary-dark); }

@keyframes fl-spin { to { transform: rotate(360deg); } }

/* دوّارة مدمجة داخل حقول البحث (بحث العميل في الكاشير) */
.input-spinner {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  width: 16px; height: 16px;
  margin-top: -8px;
  border: 2px solid var(--gray);
  border-top-color: var(--primary-dark);
  border-radius: 50%;
  animation: fl-spin .6s linear infinite;
  pointer-events: none;
}

/* عنصر نتيجة بحث العميل: حالة hover واضحة */
.client-result:hover { background: var(--primary-light); }

/* ============ Toasts ============ */
#fl-toasts {
  position: fixed;
  inset-block-start: 18px;
  inset-inline-end: 18px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 36px));
}
.fl-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  background: #fff;
  border-inline-start: 4px solid var(--primary-dark);
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  animation: fl-toast-in .25s ease;
}
.fl-toast.is-out { animation: fl-toast-out .25s ease forwards; }
.fl-toast .fl-toast-icon { font-size: 18px; line-height: 1.4; }
.fl-toast .fl-toast-body { flex: 1; }
.fl-toast .fl-toast-close {
  background: none; border: 0; cursor: pointer;
  color: var(--navy-light); font-size: 16px; line-height: 1; padding: 0;
}
.fl-toast.success { border-inline-start-color: var(--success); }
.fl-toast.success .fl-toast-icon { color: var(--success); }
.fl-toast.error { border-inline-start-color: var(--danger); }
.fl-toast.error .fl-toast-icon { color: var(--danger); }
.fl-toast.info { border-inline-start-color: var(--primary-dark); }
.fl-toast.info .fl-toast-icon { color: var(--primary-dark); }

@keyframes fl-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fl-toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* ============ Dismissable flash alerts ============ */
.alert.js-flash { position: relative; display: flex; align-items: center; gap: 8px; }
.alert.js-flash .flash-close {
  margin-inline-start: auto;
  background: none; border: 0; cursor: pointer;
  color: inherit; opacity: .6; font-size: 18px; line-height: 1; padding: 0 4px;
}
.alert.js-flash .flash-close:hover { opacity: 1; }
.alert.is-out { transition: opacity .3s ease, transform .3s ease; opacity: 0; transform: translateY(-6px); }

/* ============ Inline form validation ============ */
.form-control.is-invalid,
.is-invalid .select2-selection,
.select2-selection.is-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}
.invalid-feedback {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger);
}
.invalid-feedback::before {
  content: "\f06a"; /* fa exclamation-circle */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-inline-end: 5px;
}

/* ============ Global search (topbar) ============ */
.global-search { position: relative; width: 100%; max-width: 420px; }
.global-search-icon {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--navy-light);
  font-size: 14px;
  pointer-events: none;
}
.global-search-input {
  width: 100%;
  padding: 11px 42px 11px 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--navy);
  transition: var(--transition);
}
.global-search-input:focus {
  outline: none;
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(37, 73, 235, .1);
}
.global-search-spinner {
  position: absolute;
  inset-inline-end: 14px;
  top: 50%;
  margin-top: -8px;
  width: 16px; height: 16px;
  border: 2px solid var(--gray);
  border-top-color: var(--primary-dark);
  border-radius: 50%;
  animation: fl-spin .6s linear infinite;
}
.global-search-results {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: 360px;
  overflow-y: auto;
  z-index: 1200;
  padding: 6px;
}
.global-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--navy);
  text-decoration: none;
  transition: background .15s ease;
}
.global-search-item:hover { background: var(--primary-light); }
.global-search-item .gs-icon {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 13px;
}
.global-search-item .gs-label { flex: 1; font-size: 13.5px; font-weight: 600; }
.global-search-item .gs-type {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy-light);
  background: #f1f4fb;
  padding: 2px 8px;
  border-radius: 20px;
}
.global-search-empty {
  padding: 18px;
  text-align: center;
  color: var(--navy-light);
  font-size: 13px;
  font-weight: 600;
}

/* ============ Topbar badge count + dropdown empty state ============ */
.icon-btn { position: relative; }
.badge-count {
  position: absolute;
  inset-block-start: -4px;
  inset-inline-end: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}
.dropdown-empty {
  padding: 22px 16px;
  text-align: center;
  color: var(--navy-light);
  font-size: 13px;
  font-weight: 600;
}
.dropdown-empty i { display: block; font-size: 22px; margin-bottom: 6px; opacity: .6; }
.notif-list li.notif-empty { cursor: default; }

/* ============ Error pages (403/404/419/500/503) ============ */
.error-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.error-wrap { width: 100%; max-width: 520px; }
.error-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 32px;
  text-align: center;
}
.error-logo { height: 46px; margin-bottom: 18px; }
.error-code {
  font-size: 84px;
  font-weight: 800;
  line-height: 1;
  color: var(--primary-dark);
  letter-spacing: 2px;
}
.error-icon {
  font-size: 30px;
  color: var(--warning);
  margin: 6px 0 14px;
}
.error-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 10px;
}
.error-text {
  font-size: 15px;
  color: var(--navy-light);
  line-height: 1.7;
  margin: 0 0 26px;
}
.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
@media (max-width: 480px) {
  .error-code { font-size: 64px; }
  .error-actions { flex-direction: column; }
  .error-actions .btn-primary,
  .error-actions .btn-outline { width: 100%; }
}

/* ============ Phase 1: القائمة الجانبية المطوية + شريط البيع المثبّت + بطاقات الانتظار ============ */

/* القائمة مطوية افتراضيًا وتتمدّد عند المرور بالماوس (أجهزة بمؤشّر فقط) دون دفع المحتوى. */
@media (hover: hover) and (pointer: fine) {
  .sidebar.collapsed:hover { width: 220px; padding: 24px 18px; box-shadow: -8px 0 24px rgba(21,35,61,.10); }
  .sidebar.collapsed:hover .nav-text,
  .sidebar.collapsed:hover .sidebar-logo .logo-text { display: inline; }
  .sidebar.collapsed:hover .nav-link { justify-content: flex-start; padding: 12px 16px; }
  .sidebar.collapsed:hover .has-submenu > .nav-link::after { display: inline-block !important; }
  /* أثناء توسيع القائمة بالمرور: أظهر القائمة الفرعية المفتوحة رغم بقاء كلاس collapsed */
  .sidebar.collapsed:hover .submenu.show { display: flex !important; }
}
/* المحتوى يحجز عرض القائمة المطوية فقط؛ تمدّد الـHover يتراكب فوق المحتوى (مساحة أكبر). */

/* شريط البيع المثبّت أثناء التمرير: البحث + الأقسام + زر السلة (requires ص1) */
.pos-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg, #f4f6fb);
  padding: 10px 0;
  margin-bottom: 8px;
}
.pos-sticky-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pos-sticky-row .form-control { flex: 1; }
.pos-cart-link { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }

/* بطاقة الانتظار الحاجبة (Loading State) — requires ص8 */
.fl-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(21, 35, 61, .35);
  backdrop-filter: blur(2px);
}
.fl-overlay.show { display: flex; }
.fl-overlay-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 36px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  text-align: center;
  min-width: 220px;
}
.fl-overlay-spinner { font-size: 34px; color: var(--primary, #2549eb); display: block; margin-bottom: 12px; }
.fl-overlay-msg { font-size: 15px; color: #15233d; font-weight: 600; }

/* ============ تحسين شاشة البيع (POS) — بطاقات منتجات بصور وتسلسل بصري ============ */
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding-block-end: 6px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.cat-tabs .cat-tab { flex: 0 0 auto; border: 1.5px solid #e1e6ef; background: #fff; color: #15233d; border-radius: 999px; padding: 8px 16px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .15s ease; }
.cat-tabs .cat-tab:hover { border-color: var(--primary, #2549eb); }
.cat-tabs .cat-tab.active { background: var(--navy, #15233d); border-color: var(--navy, #15233d); color: #fff; }

.product-card { background: #fff; border: 1px solid #eef1f6; border-radius: 14px; overflow: hidden; cursor: pointer; height: 100%; display: flex; flex-direction: column; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(21, 35, 61, .10); border-color: var(--primary, #2549eb); }
.product-card:active { transform: translateY(0); }
.product-thumb { position: relative; aspect-ratio: 1 / 1; background: linear-gradient(135deg, #eef2ff, #e7ecf7); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb-letter { font-size: 38px; font-weight: 800; color: #9aa6c4; }
.product-cat-badge { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; background: rgba(21, 35, 61, .72); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-name { font-size: 15px; font-weight: 700; color: #15233d; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-foot { margin-block-start: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-foot .price-tag { font-size: 15px; font-weight: 800; color: var(--primary-dark, #1b34b8); }
.product-foot .price-tag small { font-size: 11px; font-weight: 600; color: #8a93a6; }
.product-add-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--primary, #2549eb); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.product-card:hover .product-add-btn { background: var(--primary-dark, #1b34b8); }

/* حالات فارغة احترافية (أيقونة + نص) */
.pos-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px 16px; color: #9aa6c4; text-align: center; }
.pos-empty i { font-size: 40px; opacity: .6; }
.pos-empty span { font-size: 15px; }
.pos-empty-sm { padding: 16px 8px; gap: 6px; }
.pos-empty-sm i { font-size: 22px; }
.pos-empty-sm span { font-size: 13px; }

/* ============ تحسين صفحة السلة (تجميع منطقي + بطاقة ملخص + سلال متروكة) ============ */
.cart-footer { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; margin-block-start: 16px; }
.cart-actions-secondary { display: flex; gap: 10px; flex-wrap: wrap; }
.cart-actions-secondary .btn-outline { background: #fff; border: 1.5px solid #e1e6ef; color: #15233d; border-radius: 10px; padding: 10px 16px; font-weight: 600; cursor: pointer; transition: all .15s ease; }
.cart-actions-secondary .btn-outline:hover { border-color: var(--primary, #2549eb); color: var(--primary, #2549eb); }
.cart-summary-card { background: #fff; border: 1px solid #eef1f6; border-radius: 14px; padding: 16px; min-width: 300px; flex: 1 1 320px; max-width: 420px; box-shadow: 0 6px 18px rgba(21, 35, 61, .05); }
.cart-summary-card .cs-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; color: #5b6577; }
.cart-summary-card .cs-total { border-block-start: 1px dashed #e1e6ef; margin-block-start: 4px; padding-block-start: 10px; font-size: 16px; color: #15233d; }
.cart-summary-card .cs-total strong { color: var(--primary-dark, #1b34b8); font-size: 20px; font-weight: 800; }
.cart-summary-card .btn-primary { margin-block-start: 12px; }

.btn-danger { background: #fde8e8; border: 1.5px solid #f5c2c2; color: #b91c1c; border-radius: 10px; cursor: pointer; transition: all .15s ease; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

.parked-info { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block-end: 12px; padding: 10px 12px; background: #f6f8fc; border-radius: 10px; }
.parked-client { font-weight: 700; color: #15233d; }
.parked-badge { font-size: 13px; background: #eef2ff; color: #1b34b8; padding: 2px 10px; border-radius: 999px; }
.parked-price { font-weight: 800; color: #0f7a52; }
.parked-time { font-size: 12px; color: #8a93a6; margin-inline-start: auto; }
.parked-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.parked-nav { display: flex; align-items: center; gap: 8px; }
.parked-nav #pkPos { font-size: 13px; color: #8a93a6; }
.parked-actions { display: flex; gap: 8px; }

/* الأيقونات الاتجاهية تُكتب طبيعيةً للـLTR في الـHTML، وتُقلب فقط في RTL (العربية) */
[dir="rtl"] .back-btn i,
[dir="rtl"] .module-card .arrow i,
[dir="rtl"] .parked-nav button i,
[dir="rtl"] .pos-empty a i { transform: scaleX(-1); }

/* عزل ثنائي الاتجاه للأرقام والعملة (يمنع تداخل «123 ر.س» داخل واجهة إنجليزية) */
.price-tag, .cart-total-line .v, .cs-line strong, .ci-line, .parked-price,
.kpi-value, .tax-total-card strong { unicode-bidi: isolate; }

/* أزرار الكمية/الحذف داخل ملخص السلة بصفحة البيع */
.cart-mini-table .mini-qty-cell { white-space: nowrap; }
.cart-mini-table .mc-qty { display: inline-block; min-width: 18px; text-align: center; font-weight: 700; }
.cart-mini-table .cart-remove { background: none; border: 0; color: #b91c1c; cursor: pointer; font-size: 16px; line-height: 1; }

/* شارة كود اللغة في زر مبدّل اللغة بالهيدر */
.icon-btn .lang-code {
  font-size: 11px;
  font-weight: 700;
  margin-inline-start: 3px;
  vertical-align: middle;
}

/* مبدّل اللغة على صفحات المصادقة (زاوية الصفحة) */
.auth-lang-switch {
  position: fixed;
  top: 16px;
  inset-inline-end: 16px;
  z-index: 50;
  display: flex;
  gap: 6px;
  background: rgba(255,255,255,.9);
  border: 1px solid #e1e6ef;
  border-radius: 999px;
  padding: 4px 6px;
}
.auth-lang-switch a {
  font-size: 12px;
  font-weight: 700;
  color: #15233d;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
}
.auth-lang-switch a.active { background: var(--primary, #2549eb); color: #fff; }

/* ============ دعم الاتجاه LTR (الإنجليزية) — قلب التخطيط بالكامل ============ */
/* القائمة الجانبية تنتقل لليسار والمحتوى يُزاح لليسار بدل اليمين. */
[dir="ltr"] .sidebar { right: auto; left: 0; box-shadow: 4px 0 18px rgba(21, 35, 61, .04); }
[dir="ltr"] .main-wrap { margin-right: 0; margin-left: 220px; }
[dir="ltr"] .sidebar.collapsed ~ .main-wrap { margin-right: 0; margin-left: 80px; }
[dir="ltr"] .sidebar-toggle i { transform: scaleX(-1); }
[dir="ltr"] .sidebar.collapsed .sidebar-toggle i { transform: scaleX(-1) rotate(180deg); }

@media (hover: hover) and (pointer: fine) {
  [dir="ltr"] .sidebar.collapsed:hover { box-shadow: 8px 0 24px rgba(21, 35, 61, .10); }
}

/* الجوال: القائمة تنزلق من اليسار في الوضع الإنجليزي. */
@media (max-width: 768px) {
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  [dir="ltr"] .sidebar.show { transform: translateX(0); }
  [dir="ltr"] .sidebar.collapsed { transform: translateX(-100%); }
  [dir="ltr"] .main-wrap,
  [dir="ltr"] .sidebar.collapsed ~ .main-wrap { margin-right: 0; margin-left: 0; }
  [dir="ltr"] .sidebar .sidebar-toggle { left: auto; right: 14px; }
}

/* محاذاة النص لليسار في الوضع الإنجليزي (افتراضي LTR). */
[dir="ltr"] body,
[dir="ltr"] .page-title,
[dir="ltr"] .section-title { text-align: left; }

/* أزرار أيقونية لطريقة/نوع الدفع (requires ص3) */
.opt-group { display: flex; flex-wrap: wrap; gap: 10px; }
.opt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1.5px solid #e1e6ef;
  border-radius: 12px;
  background: #fff;
  color: #15233d;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.opt-btn i { font-size: 18px; color: #8a93a6; }
.opt-btn:hover { border-color: var(--primary, #2549eb); }
.opt-btn.active { border-color: var(--primary, #2549eb); background: var(--primary-light, #eef2ff); color: var(--primary-dark, #1b34b8); }
.opt-btn.active i { color: var(--primary, #2549eb); }
