/* ============================================================
   Ponytail Sales & Commissions — UI/UX Design System
   Reference: docs/design/UI-UX.md — Enterprise Modern / RTL-first
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* brand */
  --pt-primary-900: #0B1F33;
  --pt-primary-800: #0F2B46;
  --pt-primary-700: #123A5C;
  --pt-primary-600: #1D4E79;
  --pt-primary-500: #2563EB;
  --pt-primary-100: #E8F1F8;

  /* semantic */
  --pt-success-700: #15803D;
  --pt-success-100: #DCFCE7;
  --pt-warning-700: #B45309;
  --pt-warning-100: #FEF3C7;
  --pt-danger-700: #B91C1C;
  --pt-danger-100: #FEE2E2;
  --pt-info-700: #0369A1;
  --pt-info-100: #E0F2FE;

  /* points & commission */
  --pt-points-700: #7C3AED;
  --pt-points-100: #F3E8FF;
  --pt-commission-700: #D97706;
  --pt-commission-100: #FFFBEB;

  /* neutral */
  --pt-bg: #F5F7FA;
  --pt-surface: #FFFFFF;
  --pt-border: #E2E8F0;
  --pt-border-strong: #CBD5E1;
  --pt-text: #0F172A;
  --pt-text-2: #475569;
  --pt-text-3: #94A3B8;

  /* shape */
  --pt-radius: 14px;
  --pt-radius-sm: 10px;
  --pt-radius-lg: 18px;

  /* elevation */
  --pt-shadow-sm: 0 1px 2px rgba(11, 31, 51, .06), 0 1px 3px rgba(11, 31, 51, .05);
  --pt-shadow: 0 4px 14px rgba(11, 31, 51, .07), 0 2px 4px rgba(11, 31, 51, .05);
  --pt-shadow-lg: 0 18px 45px rgba(11, 31, 51, .16);

  /* font */
  --pt-font: 'IBM Plex Sans Arabic', 'Tajawal', 'Cairo', system-ui, sans-serif;
  --pt-font-display: 'Tajawal', 'IBM Plex Sans Arabic', 'Cairo', sans-serif;

  /* layout */
  --pt-sidebar-w: 264px;
  --pt-topbar-h: 66px;
}

/* ---------- Base ---------- */
html, body { height: 100%; }
body {
  font-family: var(--pt-font);
  background: var(--pt-bg);
  color: var(--pt-text);
  font-size: .925rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--pt-font-display); font-weight: 700; }
a { text-decoration: none; }

::selection { background: rgba(37, 99, 235, .18); }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Bootstrap primary accent ---------- */
.btn-primary {
  --bs-btn-bg: var(--pt-primary-700);
  --bs-btn-border-color: var(--pt-primary-700);
  --bs-btn-hover-bg: var(--pt-primary-600);
  --bs-btn-hover-border-color: var(--pt-primary-600);
  --bs-btn-active-bg: var(--pt-primary-800);
  --bs-btn-active-border-color: var(--pt-primary-800);
  --bs-btn-disabled-bg: var(--pt-primary-700);
  --bs-btn-disabled-border-color: var(--pt-primary-700);
}
.btn-outline-primary {
  --bs-btn-color: var(--pt-accent);
  --bs-btn-border-color: #BFDBFE;
  --bs-btn-hover-bg: var(--pt-primary-500);
  --bs-btn-hover-border-color: var(--pt-primary-500);
}
.text-primary { color: var(--pt-primary-500) !important; }
.bg-primary { background-color: var(--pt-primary-600) !important; }
.btn { border-radius: var(--pt-radius-sm); font-weight: 600; }
.btn-lg { border-radius: var(--pt-radius); }
.btn i { vertical-align: -.1em; }
.dropdown-item.active, .dropdown-item:active { background-color: var(--pt-primary-500); }
.form-control, .form-select { border-radius: var(--pt-radius-sm); border-color: var(--pt-border-strong); padding: .5rem .8rem; }
.form-control:focus, .form-select:focus {
  border-color: var(--pt-primary-500);
  box-shadow: 0 0 0 .22rem rgba(37, 99, 235, .13);
}
.form-label { font-weight: 600; font-size: .84rem; color: var(--pt-text-2); margin-bottom: .35rem; }
.input-group-text { border-radius: var(--pt-radius-sm); border-color: var(--pt-border-strong); background: #F8FAFC; }

/* soft badges (status colors) */
.badge { font-weight: 600; padding: .42em .68em; border-radius: 50px; font-size: .74em; }
.badge.bg-success { background: var(--pt-success-100) !important; color: var(--pt-success-700); }
.badge.bg-danger { background: var(--pt-danger-100) !important; color: var(--pt-danger-700); }
.badge.bg-warning { background: var(--pt-warning-100) !important; color: var(--pt-warning-700); }
.badge.bg-info { background: var(--pt-info-100) !important; color: var(--pt-info-700); }
.badge.bg-secondary { background: #F1F5F9 !important; color: var(--pt-text-2); }
.badge.bg-light { background: #F1F5F9 !important; color: var(--pt-text); }
.badge.bg-dark { background: var(--pt-primary-800) !important; color: #fff; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Sidebar (dark navy, right in RTL) ---------- */
.sidebar {
  width: var(--pt-sidebar-w);
  flex: 0 0 var(--pt-sidebar-w);
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  background: linear-gradient(180deg, var(--pt-primary-800) 0%, var(--pt-primary-900) 100%);
  color: #CBD9E8;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), width .28s ease, flex-basis .28s ease;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: 1.15rem 1.2rem;
  cursor: pointer;
}
.brand-logo {
  width: auto;
  height: 40px;
  max-width: 150px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35));
}
.brand-text b { display: block; font-size: 1.05rem; color: #fff; letter-spacing: .2px; }
.brand-text span { display: block; font-size: .7rem; color: #7E9BB8; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .7rem .75rem; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); }
.nav-section { margin-bottom: .9rem; }
.nav-label {
  font-size: .68rem;
  font-weight: 700;
  color: #5E7A97;
  padding: .45rem .8rem .3rem;
  letter-spacing: .4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .8rem;
  border-radius: var(--pt-radius-sm);
  color: #AFC3D9;
  font-weight: 600;
  font-size: .88rem;
  margin-bottom: 2px;
  transition: all .15s ease;
}
.nav-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.active {
  background: linear-gradient(90deg, #2563EB, #1D4E79);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
}
.nav-link .nav-badge {
  margin-inline-start: auto;
  font-size: .68rem;
  background: rgba(255, 255, 255, .14);
  color: #E2E8F0;
  border-radius: 50px;
  padding: .05rem .5rem;
}

.sidebar-foot { padding: .85rem .85rem; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar-user { display: flex; align-items: center; gap: .7rem; padding: .4rem .2rem .6rem; }
.uname { font-weight: 700; font-size: .9rem; color: #fff; line-height: 1.3; }
.urole { font-size: .72rem; color: #7E9BB8; }
.logout-btn {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem .75rem;
  border-radius: var(--pt-radius-sm);
  color: #FCA5A5;
  font-weight: 600; font-size: .86rem;
  transition: background .15s ease;
}
.logout-btn:hover { background: rgba(220, 38, 38, .14); color: #FECACA; }

.avatar {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  color: #fff;
  font-weight: 700; font-size: .9rem;
}

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(11, 31, 51, .5);
  z-index: 1035;
  backdrop-filter: blur(2px);
}

/* collapsed (desktop) */
body.sidebar-collapsed .sidebar { width: 80px; flex-basis: 80px; }
body.sidebar-collapsed .sidebar .brand-text,
body.sidebar-collapsed .sidebar .nav-link span,
body.sidebar-collapsed .sidebar .nav-label,
body.sidebar-collapsed .sidebar .sidebar-user > div:last-child,
body.sidebar-collapsed .sidebar .logout-btn span { display: none; }
body.sidebar-collapsed .sidebar .nav-link { justify-content: center; padding: .6rem; }
body.sidebar-collapsed .sidebar .sidebar-brand { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed .sidebar .brand-logo { height: 34px; max-width: 66px; }
body.sidebar-collapsed .sidebar .logout-btn { justify-content: center; }
body.sidebar-collapsed .sidebar .sidebar-user { justify-content: center; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .6rem 1.35rem;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pt-border);
  min-height: var(--pt-topbar-h);
}
.hamburger {
  border: 0;
  background: #F1F5F9;
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 1.25rem;
  color: var(--pt-text);
  transition: all .15s ease;
}
.hamburger:hover { background: var(--pt-primary-100); color: var(--pt-primary-600); }
.topbar-title h1 { font-size: 1.12rem; font-weight: 800; margin: 0; }
.crumb { font-size: .73rem; color: var(--pt-text-3); font-weight: 500; }
.topbar-meta { display: flex; align-items: center; gap: .6rem; margin-inline-start: auto; }

/* topbar search */
.topbar-search { position: relative; width: 260px; margin-inline-start: auto; }
.topbar-search input {
  width: 100%;
  border: 1px solid var(--pt-border);
  background: #F8FAFC;
  border-radius: 50px;
  padding: .5rem 2.4rem .5rem 1rem;
  font-size: .85rem;
  transition: all .18s ease;
}
.topbar-search input:focus { background: #fff; border-color: var(--pt-primary-500); box-shadow: 0 0 0 .2rem rgba(37,99,235,.12); }
.topbar-search i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: .9rem; color: var(--pt-text-3); font-size: .9rem; }

/* icon button (bell) */
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border: 1px solid var(--pt-border);
  background: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--pt-text-2);
  font-size: 1.05rem;
  transition: all .15s ease;
}
.icon-btn:hover { background: var(--pt-primary-100); color: var(--pt-primary-600); }
.icon-btn .dot {
  position: absolute; top: 5px; inset-inline-end: 5px;
  min-width: 16px; height: 16px;
  padding: 0 3px;
  border-radius: 50px;
  background: #EF4444;
  color: #fff;
  font-size: .62rem; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid #fff;
}

.topbar-user {
  display: flex; align-items: center; gap: .5rem;
  padding: .25rem .6rem .25rem .35rem;
  background: #F8FAFC;
  border: 1px solid var(--pt-border);
  border-radius: 50px;
  cursor: pointer;
  transition: all .15s ease;
}
.topbar-user:hover { border-color: var(--pt-primary-500); }
.topbar-user .avatar { width: 30px; height: 30px; flex-basis: 30px; font-size: .72rem; }
.topbar-user b { font-size: .84rem; }
.topbar .dropdown-menu { border-radius: 14px; border: 1px solid var(--pt-border); box-shadow: var(--pt-shadow-lg); padding: .5rem; }
.topbar .dropdown-menu .dropdown-item { border-radius: 9px; padding: .5rem .8rem; font-size: .87rem; }
.topbar .dropdown-menu .dropdown-item:hover { background: #F1F5F9; }
.dropdown-item.text-danger:hover { background: var(--pt-danger-100); }

/* ---------- Notification center ---------- */
.scroll-mt { scroll-margin-top: 90px; }
.topbar .dropdown-menu.notif-menu { width: 350px; max-width: 94vw; }
.notif-list { max-height: 390px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: flex-start; gap: .6rem;
  border-radius: 10px; padding: .55rem .65rem; text-decoration: none;
  color: var(--pt-text); transition: background .12s ease;
}
.notif-item:hover { background: #F1F5F9; color: var(--pt-text); }
.notif-item.unread { background: var(--pt-primary-100); }
.notif-item.unread:hover { background: #DBEAFE; }
.notif-ic { font-size: 1.05rem; color: var(--pt-primary-600); margin-top: .15rem; }
.notif-title { font-size: .85rem; font-weight: 600; line-height: 1.4; }
.notif-time { font-size: .72rem; margin-top: .1rem; }
.notif-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #EF4444;
  flex-shrink: 0; margin-top: .4rem; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18);
}
.notif-empty { text-align: center; color: var(--pt-text-2); font-size: .85rem; padding: 1.4rem .5rem; }
.list-group .notif-row.unread { background: var(--pt-primary-100); }
.list-group .notif-row.unread:hover { background: #DBEAFE; }

.page-content { padding: 1.35rem; flex: 1; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius);
  box-shadow: var(--pt-shadow-sm);
  background: var(--pt-surface);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .95rem 1.15rem;
  background: transparent;
  border-bottom: 1px solid var(--pt-border);
}
.card-header h5 { font-weight: 800; font-size: .98rem; display: flex; align-items: center; gap: .55rem; margin: 0; }
.head-icon {
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border-radius: 10px;
  background: var(--pt-primary-100);
  color: var(--pt-primary-600);
  font-size: 1rem;
}
.card-body { padding: 1.15rem; }

/* ---------- Stat cards ---------- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: .9rem; margin-bottom: 1.3rem; }
.stat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: 1.05rem;
  height: 100%;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius);
  box-shadow: var(--pt-shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  inset-inline-start: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--pt-primary-500);
  border-radius: 0 0 0 6px;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--pt-shadow); }
.stat-ic {
  width: 46px; height: 46px;
  flex: 0 0 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 1.25rem;
}
.stat-info { min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.stat-val { font-size: 1.3rem; font-weight: 800; line-height: 1.15; font-family: var(--pt-font-display); }
.stat-lab { font-size: .76rem; color: var(--pt-text-2); font-weight: 600; }

.tone-brand .stat-ic { background: var(--pt-primary-100); color: var(--pt-primary-600); }
.tone-brand::after { background: var(--pt-primary-500); }
.tone-sky .stat-ic { background: var(--pt-info-100); color: var(--pt-info-700); }
.tone-sky::after { background: var(--pt-info-700); }
.tone-green .stat-ic { background: var(--pt-success-100); color: var(--pt-success-700); }
.tone-green::after { background: var(--pt-success-700); }
.tone-teal .stat-ic { background: #CCFBF1; color: #0D9488; }
.tone-teal::after { background: #0D9488; }
.tone-red .stat-ic { background: var(--pt-danger-100); color: var(--pt-danger-700); }
.tone-red::after { background: var(--pt-danger-700); }
.tone-amber .stat-ic { background: var(--pt-warning-100); color: var(--pt-warning-700); }
.tone-amber::after { background: var(--pt-warning-700); }
.tone-violet .stat-ic { background: var(--pt-points-100); color: var(--pt-points-700); }
.tone-violet::after { background: var(--pt-points-700); }

/* ---------- Quick actions ---------- */
.quick-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.25rem; }
.qa-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem;
  background: #fff;
  border: 1px solid var(--pt-border);
  border-radius: 50px;
  font-weight: 600; font-size: .84rem;
  color: var(--pt-text-2);
  box-shadow: var(--pt-shadow-sm);
  transition: all .16s ease;
}
.qa-btn i { color: var(--pt-primary-500); font-size: 1rem; }
.qa-btn:hover { color: var(--pt-primary-600); border-color: var(--pt-primary-500); transform: translateY(-2px); }
.qa-btn.qa-new { background: linear-gradient(135deg, var(--pt-primary-700), var(--pt-primary-600)); border: 0; color: #fff; box-shadow: 0 6px 16px rgba(18, 58, 92, .3); }
.qa-btn.qa-new i { color: #fff; }

/* ---------- Tables ---------- */
.table { --bs-table-hover-bg: #F8FAFC; margin-bottom: 0; }
.table thead th {
  background: #F8FAFC;
  color: var(--pt-text-2);
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 1px solid var(--pt-border);
  padding: .7rem .75rem;
}
.table td { vertical-align: middle; padding: .68rem .75rem; }
.table > :not(caption) > * > * { background: transparent; }
.table .btn-sm { padding: .22rem .55rem; }
.th-sortable { cursor: pointer; user-select: none; }
.th-sortable i { font-size: .75rem; opacity: .5; margin-inline-start: .2rem; }
.th-sortable:hover { color: var(--pt-primary-600); }
.th-sortable.sorted i { opacity: 1; color: var(--pt-primary-500); }
.tr-click { cursor: pointer; }

/* pager */
.pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem .25rem 0; flex-wrap: wrap; }
.pager-info { font-size: .8rem; color: var(--pt-text-2); }
.pager-btns { display: flex; gap: .3rem; }
.pager-btns button {
  min-width: 34px; height: 34px;
  border: 1px solid var(--pt-border);
  background: #fff;
  border-radius: 8px;
  color: var(--pt-text-2);
  font-weight: 600; font-size: .82rem;
  transition: all .14s ease;
}
.pager-btns button:hover:not(:disabled) { border-color: var(--pt-primary-500); color: var(--pt-primary-600); }
.pager-btns button.active { background: var(--pt-primary-600); border-color: var(--pt-primary-600); color: #fff; }
.pager-btns button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Product cards ---------- */
.product-card { overflow: hidden; border-radius: var(--pt-radius); transition: transform .16s ease, box-shadow .16s ease; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--pt-shadow); }
.product-img-wrap { height: 145px; background: #F8FAFC; overflow: hidden; }
.product-img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.product-card:hover .product-img { transform: scale(1.06); }
.product-cat {
  display: inline-block;
  font-size: .7rem; font-weight: 700;
  color: var(--pt-primary-600);
  background: var(--pt-primary-100);
  padding: .18rem .6rem;
  border-radius: 50px;
  align-self: flex-start;
  margin-bottom: .4rem;
}

/* ---------- Order steps ---------- */
.steps { display: flex; justify-content: space-between; align-items: flex-start; padding: .5rem 0; }
.step { flex: 1; text-align: center; position: relative; }
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 17px;
  inset-inline-start: 50%;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: var(--pt-border);
  z-index: 0;
}
.step.done:not(:last-child)::after, .step.active:not(:last-child)::after { background: linear-gradient(90deg, var(--pt-primary-500), var(--pt-primary-600)); }
.step-circle {
  position: relative; z-index: 1;
  width: 36px; height: 36px;
  margin: 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--pt-border);
  color: var(--pt-text-3);
  font-size: 1rem;
  transition: all .2s ease;
}
.step.done .step-circle { background: linear-gradient(135deg, var(--pt-primary-500), var(--pt-primary-600)); border-color: transparent; color: #fff; }
.step.active .step-circle { border-color: var(--pt-primary-500); color: var(--pt-primary-500); box-shadow: 0 0 0 5px rgba(37, 99, 235, .12); }
.step-label { font-size: .78rem; font-weight: 700; color: var(--pt-text-3); margin-top: .45rem; }
.step.active .step-label { color: var(--pt-primary-600); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 2.75rem 1rem; }
.empty-ic {
  width: 68px; height: 68px;
  margin: 0 auto .9rem;
  display: grid; place-items: center;
  border-radius: 20px;
  background: var(--pt-primary-100);
  color: var(--pt-primary-600);
  font-size: 1.7rem;
}
.empty-title { font-weight: 800; font-size: 1rem; }
.empty-sub { color: var(--pt-text-2); font-size: .85rem; margin-bottom: .75rem; }

/* ---------- Progress ---------- */
.progress { background: #EEF2F7; border-radius: 50px; height: 9px; }
.progress-bar { border-radius: 50px; }
.progress-bar.pts { background: linear-gradient(90deg, #7C3AED, #A855F7); }
.progress-bar.comm { background: linear-gradient(90deg, #D97706, #F59E0B); }

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed;
  bottom: 1.25rem;
  inset-inline-start: 1.25rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  max-width: min(360px, 92vw);
}
.toast-stack .toast {
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius);
  box-shadow: var(--pt-shadow-lg);
  background: #fff;
}
.toast-stack .toast .toast-body { padding: .8rem 1rem; font-weight: 600; font-size: .87rem; }
.toast-stack .toast .toast-body i { font-size: 1.05rem; }

/* ---------- Loading overlay ---------- */
#appLoading {
  position: fixed; inset: 0;
  z-index: 2000;
  background: var(--pt-bg);
  display: grid; place-items: center;
  transition: opacity .35s ease, visibility .35s ease;
}
#appLoading.hide { opacity: 0; visibility: hidden; }
.loader-box { text-align: center; }
.loader-spin {
  width: 52px; height: 52px;
  margin: 0 auto .8rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  display: grid; place-items: center;
  color: #fff; font-size: 1.5rem;
  animation: loaderPulse 1.2s ease-in-out infinite;
}
@keyframes loaderPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, .35); }
  50% { transform: scale(1.07); box-shadow: 0 0 0 14px rgba(37, 99, 235, 0); }
}
.loader-text { font-weight: 700; color: var(--pt-primary-700); font-size: .92rem; }

/* ---------- Bottom navigation (mobile) ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; inset-inline-start: 0; inset-inline-end: 0;
  z-index: 1060;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--pt-border);
  padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom));
}
.bottom-nav .bn-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  padding: .3rem .2rem;
  color: var(--pt-text-3);
  font-size: .64rem; font-weight: 700;
  border-radius: 10px;
  transition: color .15s ease;
}
.bottom-nav .bn-item i { font-size: 1.15rem; }
.bottom-nav .bn-item.active { color: var(--pt-primary-500); }
.bottom-nav .bn-fab {
  flex: 0 0 52px;
  width: 52px; height: 52px;
  margin-top: -22px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: linear-gradient(135deg, var(--pt-primary-700), var(--pt-primary-500));
  color: #fff;
  display: grid; place-items: center;
  font-size: 1.35rem;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .4);
}
@media (max-width: 991.98px) {
  .bottom-nav { display: flex; align-items: flex-end; justify-content: space-around; }
  body { padding-bottom: 66px; }
  .page-content { padding: 1rem; }
  .topbar-search { width: auto; flex: 1; min-width: 0; }
  .topbar-user b, .topbar-date { display: none; }
  .sidebar {
    position: fixed;
    inset-inline-start: 0;
    top: 0;
    height: 100vh;
    transform: translateX(100%);
    box-shadow: var(--pt-shadow-lg);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
}
@media (min-width: 992px) {
  .sidebar { transform: none; }
}

/* ---------- Medium screens (992–1199px): auto icon rail ---------- */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .sidebar { width: 80px; flex-basis: 80px; }
  body.sidebar-expanded .sidebar { width: var(--pt-sidebar-w); flex-basis: var(--pt-sidebar-w); }
  .sidebar .brand-text,
  .sidebar .nav-link span,
  .sidebar .nav-label,
  .sidebar .sidebar-user > div:last-child,
  .sidebar .logout-btn span { display: none; }
  body.sidebar-expanded .sidebar .brand-text,
  body.sidebar-expanded .sidebar .nav-link span,
  body.sidebar-expanded .sidebar .nav-label,
  body.sidebar-expanded .sidebar .sidebar-user > div:last-child,
  body.sidebar-expanded .sidebar .logout-btn span { display: block; }
  .sidebar .nav-link { justify-content: center; padding: .6rem; }
  body.sidebar-expanded .sidebar .nav-link { justify-content: flex-start; padding: .55rem .8rem; }
  .sidebar .sidebar-brand { justify-content: center; padding-inline: 0; }
  body.sidebar-expanded .sidebar .sidebar-brand { justify-content: flex-start; padding: 1.15rem 1.2rem; }
  .sidebar .brand-logo { height: 34px; max-width: 66px; }
  body.sidebar-expanded .sidebar .brand-logo { height: 40px; max-width: 150px; }
  .sidebar .logout-btn { justify-content: center; }
  body.sidebar-expanded .sidebar .logout-btn { justify-content: flex-start; }
  .sidebar .sidebar-user { justify-content: center; }
  body.sidebar-expanded .sidebar .sidebar-user { justify-content: flex-start; }
  .page-content { padding: 1.1rem; }
  .topbar { padding: .55rem 1.1rem; }
  .topbar-meta { margin-inline-start: 0; }
}

/* ---------- Small phones ---------- */
@media (max-width: 575.98px) {
  .stat-card { padding: .8rem; gap: .6rem; }
  .stat-ic { width: 40px; height: 40px; flex-basis: 40px; font-size: 1.05rem; }
  .stat-val { font-size: 1.15rem; }
  .topbar { padding: .5rem .75rem; gap: .6rem; }
  .topbar-title h1 { font-size: 1rem; }
  .crumb { display: none; }
  .topbar-meta { margin-inline-start: 0; }
}

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(900px 500px at 88% -5%, rgba(124, 58, 237, .28), transparent 60%),
    radial-gradient(800px 520px at 8% 108%, rgba(37, 99, 235, .3), transparent 60%),
    linear-gradient(135deg, var(--pt-primary-900) 0%, var(--pt-primary-800) 55%, var(--pt-primary-700) 100%);
}
.login-wrap { width: 100%; max-width: 430px; }
.login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--pt-shadow-lg);
  padding: 2rem 1.9rem;
}
.login-head { text-align: center; margin-bottom: 1.4rem; }
.login-logo {
  width: 100%;
  max-width: 220px;
  margin: 0 auto 1rem;
  display: block;
  background: none;
  border-radius: 0;
  box-shadow: none;
}
.login-logo img { width: 100%; height: auto; display: block; }
.login-head h1 { font-size: 1.35rem; font-weight: 800; color: var(--pt-primary-900); margin-bottom: .2rem; }
.login-head p { color: var(--pt-text-2); margin: 0; font-size: .88rem; }
.login-cred {
  margin-top: 1.3rem;
  padding: .9rem 1rem;
  background: var(--pt-primary-100);
  border: 1px dashed var(--pt-primary-500);
  border-radius: var(--pt-radius-sm);
  font-size: .78rem;
  color: var(--pt-text-2);
}
.login-cred code { color: var(--pt-primary-700); background: #fff; padding: .05rem .3rem; border-radius: 4px; border: 1px solid var(--pt-border); }
.login-brand { text-align: center; margin-top: 1.2rem; color: rgba(255, 255, 255, .65); font-size: .8rem; }

/* ---------- Misc helpers ---------- */
.avatar-sm { width: 30px; height: 30px; flex-basis: 30px; font-size: .72rem; }
.kpi-amount { font-family: var(--pt-font-display); font-weight: 800; }
.soft-box { background: #F8FAFC; border: 1px solid var(--pt-border); border-radius: var(--pt-radius-sm); }
.form-text { font-size: .75rem; }
.invalid-feedback, .valid-feedback { font-size: .76rem; }

/* WhatsApp deep-link button */
.btn-wa { white-space: nowrap; }
.btn-wa i { font-size: .95rem; }

/* touch-friendly horizontal table scroll */
.table-responsive { -webkit-overflow-scrolling: touch; }
.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 50px; }
.table-responsive::-webkit-scrollbar-track { background: transparent; }

/* keep table columns aligned on narrow screens: scroll instead of cramming */
.table-responsive .table th,
.table-responsive .table td { white-space: nowrap; }
.table-responsive .table { min-width: 640px; }
#customersTable { min-width: 940px; }
#ordersTable { min-width: 900px; }

/* print */
@page { size: A4 portrait; margin: 10mm; }
@media print {
  .sidebar, .topbar, .bottom-nav, .sidebar-backdrop, .no-print, .btn, .pager, .quick-actions { display: none !important; }
  body { background: #fff; }
  .app, .main, .page-content { display: block; padding: 0; }
  .card { border: 1px solid #CBD5E1 !important; box-shadow: none !important; }
  html, body { font-size: 12px; }

  /* --- one-page monthly finance statement --- */
  #financeReport { font-size: 10.5px; }
  #financeReport .card-body { padding: .5rem .7rem; }
  #financeReport .card, #financeReport .card-body { border: none !important; box-shadow: none !important; }
  #financeReport .mb-4 { margin-bottom: .5rem !important; }
  #financeReport .mb-3, #financeReport .mb-2 { margin-bottom: .4rem !important; }
  #financeReport .row.g-3 { --bs-gutter-x: .4rem; --bs-gutter-y: .4rem; }
  #financeReport .row.g-2 { --bs-gutter-x: .3rem; --bs-gutter-y: .3rem; }
  #financeReport .p-3 { padding: .4rem .5rem !important; }
  #financeReport .p-2 { padding: .22rem .35rem !important; }
  #financeReport .fs-5 { font-size: 12.5px !important; }
  #financeReport .fs-6 { font-size: 11px !important; }
  #financeReport .small { font-size: 9.5px !important; }
  #financeReport .h5 { font-size: 14px !important; }
  #financeReport h6 { font-size: 10.5px !important; }
  #financeReport table { font-size: 9.5px; }
  #financeReport .table-sm > :not(caption) > * > * { padding: .14rem .3rem; }
  #financeReport .table-bordered th, #financeReport .table-bordered td { border-color: #CBD5E1 !important; }
  #financeReport .border-bottom { border-bottom: 1px solid #CBD5E1 !important; }
  #financeReport .border-top { border-top: 1px solid #CBD5E1 !important; }
  #financeReport .border { border: 1px solid #E2E8F0 !important; }
  #financeReport .report-signatures { margin-top: .5rem !important; padding-top: .3rem !important; }
  #financeReport .table-responsive { overflow: visible !important; }
  #financeReport .card.mb-4 { break-inside: avoid; }
  #financeReport table { break-inside: auto; }
}

/* ============================================================
   Lookup Command Center — search workflow UI
   ============================================================ */

.lk-hud {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  background: linear-gradient(135deg, var(--pt-primary-800), var(--pt-primary-600));
  border-radius: var(--pt-radius); padding: 1.1rem 1.3rem; margin-bottom: 1.1rem;
  box-shadow: var(--pt-shadow); color: #fff;
}
.lk-hud-info { min-width: 230px; }
.lk-hud-title { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.lk-hud-sub { font-size: .78rem; color: #BFD4E8; margin-top: .15rem; }
.lk-hud-pills { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.lk-pill {
  display: inline-flex; align-items: center; gap: .45rem;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16);
  padding: .35rem .7rem; border-radius: 50px; font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.lk-pill .dot-live, .lk-pill .dot-off { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.lk-pill .dot-live { background: #4ADE80; box-shadow: 0 0 0 3px rgba(74,222,128,.25); }
.lk-pill .dot-off { background: #CBD5E1; }
.lk-countdown { font-variant-numeric: tabular-nums; font-weight: 800; font-size: .9rem; }
.lk-hud-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-inline-start: auto; }
.lk-hud .btn { border-radius: 10px; }

.lk-pipe { display: flex; overflow: hidden; border-radius: 9px; height: 10px; background: #EEF2F7; margin-bottom: .85rem; }
.lk-pipe > span { height: 100%; transition: width .4s ease; }
.lk-pipe .s-pend { background: #F59E0B; }
.lk-pipe .s-run  { background: #0284C7; }
.lk-pipe .s-done { background: #16A34A; }
.lk-pipe .s-fail { background: #EF4444; }
.lk-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; align-items: center; font-size: .8rem; color: var(--pt-text-2); }
.lk-legend b { color: var(--pt-text); }
.lk-legend a { color: inherit; text-decoration: none; }
.lk-legend a:hover { color: var(--pt-primary-600); }
.lk-leg-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-inline-end: .35rem; }

.lk-steps { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .25rem; }
.lk-step {
  display: flex; align-items: center; gap: .65rem; flex: 1 1 0; min-width: 158px;
  background: var(--pt-surface); border: 1px solid var(--pt-border); border-radius: var(--pt-radius-sm);
  padding: .6rem .8rem; color: var(--pt-text-2); text-decoration: none; transition: all .16s ease;
}
.lk-step:hover { border-color: var(--pt-primary-400); color: var(--pt-primary-600); transform: translateY(-1px); }
.lk-step.active { border-color: var(--pt-primary-500); background: var(--pt-primary-100); color: var(--pt-primary-800); box-shadow: inset 0 -3px 0 var(--pt-primary-500); }
.lk-step .lk-num {
  width: 27px; height: 27px; border-radius: 50%; background: #EEF2F7; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .78rem; color: var(--pt-text-2);
}
.lk-step.done .lk-num { background: var(--pt-success-600, #16A34A); color: #fff; }
.lk-step.active .lk-num { background: var(--pt-primary-600); color: #fff; }
.lk-step .lk-step-title { font-weight: 800; font-size: .85rem; line-height: 1.2; display: block; }
.lk-step .lk-step-sub { font-size: .7rem; color: var(--pt-text-3); display: block; margin-top: .1rem; }
.lk-step .lk-step-badge { margin-inline-start: auto; }

.lk-runbar {
  display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; justify-content: space-between;
  background: #FFFBEB; border: 1px dashed #D97706; border-radius: var(--pt-radius-sm);
  padding: .95rem 1.1rem; margin-bottom: 1.1rem;
}
.lk-runbar .btn-lg { font-size: .95rem; }
.lk-target-phone { font-family: var(--pt-font-display); font-variant-numeric: tabular-nums; }

/* ---------- lookup creative console ---------- */
.lk-prov-tile {
  position: relative;
  display: flex; flex-direction: column; justify-content: center; gap: .15rem;
  min-height: 84px;
  padding: .8rem 1rem;
  border: 1.5px solid var(--pt-border, #E2E8F0);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.lk-prov-tile:hover { border-color: #2563EB; box-shadow: 0 4px 14px rgba(37, 99, 235, .14); }
.lk-prov-tile.active { border-color: #2563EB; background: #EFF6FF; box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
.lk-prov-tile input { position: absolute; opacity: 0; pointer-events: none; }
.lk-prov-tile .lk-prov-name { font-weight: 800; font-size: .92rem; color: var(--pt-primary-900, #0F172A); padding-inline-end: 1.4rem; }
.lk-prov-tile .lk-prov-meta { font-size: .72rem; color: var(--pt-text-3, #64748B); }
.lk-prov-tile .lk-prov-check {
  position: absolute; top: .6rem; inset-inline-end: .6rem;
  width: 20px; height: 20px; border-radius: 50%;
  display: none; place-items: center;
  background: #2563EB; color: #fff; font-size: .72rem;
}
.lk-prov-tile.active .lk-prov-check { display: grid; }

.lk-mode { display: flex; gap: .6rem; flex-wrap: wrap; }
.lk-mode-btn {
  flex: 1; min-width: 200px;
  display: flex; align-items: center; gap: .65rem;
  padding: .9rem 1.1rem;
  border: 1.5px solid var(--pt-border, #E2E8F0);
  border-radius: 14px;
  background: #fff; color: var(--pt-text-2, #334155);
  font-weight: 800; text-align: start;
  cursor: pointer; transition: all .15s ease;
}
.lk-mode-btn small { display: block; font-weight: 500; font-size: .74rem; color: var(--pt-text-3, #64748B); margin-top: .12rem; }
.lk-mode-btn i { font-size: 1.35rem; color: #2563EB; }
.lk-mode-btn:hover { border-color: #2563EB; }
.lk-mode-btn.active { border-color: #2563EB; background: linear-gradient(135deg, #2563EB, #1D4E79); color: #fff; }
.lk-mode-btn.active small { color: #DBEAFE; }
.lk-mode-btn.active i { color: #fff; }

.lk-feed-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center; gap: .85rem;
  padding: .6rem .7rem;
  border-bottom: 1px solid var(--pt-border-soft, #EEF2F7);
  animation: lkFeedIn .3s ease;
}
.lk-feed-item:last-child { border-bottom: none; }
.lk-feed-phone { font-weight: 800; color: #1E3A8A; direction: ltr; }
.lk-feed-name { font-weight: 600; font-size: .9rem; }
.lk-feed-addr { font-size: .78rem; color: var(--pt-text-3, #64748B); }
.lk-feed-meta { font-size: .72rem; color: #94A3B8; text-align: end; white-space: nowrap; }
.lk-feed-badges { display: flex; gap: .3rem; }
@keyframes lkFeedIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Smart city search combobox ---------- */
.pt-city-wrap .pt-city-input {
  padding-left: 2.3rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2394A3B8'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 10px center;
  background-size: 16px;
}
.pt-city-dropdown {
  position: absolute;
  z-index: 1050;
  inset-inline: 0;
  top: 100%;
  margin-top: .3rem;
  max-height: 250px;
  overflow-y: auto;
  padding: .3rem;
  background: var(--pt-surface);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius-sm);
  box-shadow: 0 12px 32px rgba(11, 31, 51, .14);
}
.pt-city-item {
  cursor: pointer;
  border-radius: 8px;
  padding: .45rem .7rem;
  font-size: .9rem;
  color: var(--pt-text);
}
.pt-city-item:hover,
.pt-city-item.active {
  background: var(--pt-primary-100);
  color: var(--pt-primary-900);
}
.pt-city-empty {
  padding: .5rem .7rem;
  font-size: .82rem;
  color: var(--pt-text-3);
}

/* ============================================================
   Discovery Station — مركز استكشاف وتدقيق الأرقام
   ============================================================ */

/* ---- HUD: top status banner ---- */
.ds-hud {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 55%, #1E293B 100%);
  border-radius: 18px; padding: 1.4rem 1.6rem; color: #fff;
  margin-bottom: 1.4rem; position: relative; overflow: hidden;
}
.ds-hud::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(56,189,248,.25), transparent 45%);
  pointer-events: none;
}
.ds-hud-title { font-size: 1.35rem; font-weight: 800; display: flex; align-items: center; gap: .55rem; }
.ds-hud-title i { color: #38BDF8; }
.ds-hud-sub { font-size: .85rem; color: #CBD5E1; margin-top: .2rem; }
.ds-hud-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .4rem; }
.ds-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px; padding: .28rem .7rem; font-size: .78rem; color: #E2E8F0;
}
.ds-pill .dot-live { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 8px #4ADE80; }
.ds-pill .dot-off  { width: 7px; height: 7px; border-radius: 50%; background: #94A3B8; }
.ds-hud-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---- Metrics cards row ---- */
.ds-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.ds-metric {
  position: relative; overflow: hidden;
  background: var(--pt-surface, #fff);
  border: 1px solid var(--pt-border, #E2E8F0);
  border-radius: 16px; padding: 1.1rem 1.2rem;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ds-metric:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15,23,42,.08); }
.ds-metric::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px;
  background: var(--ds-accent, #2563EB);
}
.ds-metric-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.25rem;
  background: var(--ds-accent-soft, #DBEAFE); color: var(--ds-accent, #2563EB);
  margin-bottom: .6rem;
}
.ds-metric-value { font-size: 1.85rem; font-weight: 800; line-height: 1; color: var(--pt-text, #0F172A); }
.ds-metric-label { font-size: .82rem; color: var(--pt-text-3, #64748B); margin-top: .3rem; }
.ds-metric-foot { font-size: .72rem; color: var(--pt-text-3, #94A3B8); margin-top: .35rem; }

/* ---- Station tri-panel layout ---- */
.ds-station { display: grid; grid-template-columns: 1fr; gap: 1.4rem; }
@media (min-width: 992px) {
  .ds-station-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.4rem; align-items: start; }
}

/* ---- Discovery panel ---- */
.ds-panel {
  background: var(--pt-surface, #fff);
  border: 1px solid var(--pt-border, #E2E8F0);
  border-radius: 16px; padding: 1.3rem;
}
.ds-panel-head { display: flex; align-items: center; gap: .55rem; margin-bottom: 1rem; font-weight: 800; font-size: 1.05rem; }
.ds-panel-head i { color: var(--pt-primary, #2563EB); }
.ds-panel-head .ds-tag { margin-inline-start: auto; }

/* mode tabs */
.ds-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.ds-tab {
  flex: 1; padding: .7rem .9rem; border: 1.5px solid var(--pt-border, #E2E8F0);
  border-radius: 12px; background: #fff; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: .5rem; justify-content: center;
  transition: all .15s ease; color: var(--pt-text-2, #334155);
}
.ds-tab i { font-size: 1.1rem; color: var(--pt-primary, #2563EB); }
.ds-tab.active { border-color: var(--pt-primary, #2563EB); background: linear-gradient(135deg,#2563EB,#1D4E79); color: #fff; }
.ds-tab.active i { color: #fff; }

/* ---- Progress bar (bulk processing) ---- */
.ds-progress-wrap { margin: 1rem 0; }
.ds-progress-head { display: flex; justify-content: space-between; font-size: .82rem; color: var(--pt-text-3, #64748B); margin-bottom: .35rem; }
.ds-progress {
  height: 10px; background: #E2E8F0; border-radius: 6px; overflow: hidden; position: relative;
}
.ds-progress-bar {
  height: 100%; width: 0%; border-radius: 6px;
  background: linear-gradient(90deg, #2563EB, #16A34A);
  transition: width .5s ease; position: relative;
}
.ds-progress-bar::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: dsShimmer 1.4s infinite;
}
@keyframes dsShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.ds-progress-stats { display: flex; gap: 1.1rem; margin-top: .6rem; flex-wrap: wrap; }
.ds-progress-stat { font-size: .82rem; color: var(--pt-text-2, #334155); }
.ds-progress-stat b { font-size: 1rem; color: var(--pt-text, #0F172A); }
.ds-progress-stat .ds-stat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: .3rem; }

/* ---- Live feed ---- */
.ds-feed { max-height: 320px; overflow-y: auto; border-radius: 12px; border: 1px solid var(--pt-border-soft, #EEF2F7); }
.ds-feed-item {
  display: grid; grid-template-columns: auto 1fr auto auto;
  align-items: center; gap: .85rem; padding: .6rem .8rem;
  border-bottom: 1px solid var(--pt-border-soft, #EEF2F7);
  animation: dsFeedIn .35s ease;
}
.ds-feed-item:last-child { border-bottom: none; }
.ds-feed-item.new { background: linear-gradient(90deg, rgba(22,163,74,.07), transparent); }
.ds-feed-item.updated { background: linear-gradient(90deg, rgba(37,99,235,.07), transparent); }
.ds-feed-item.failed { background: linear-gradient(90deg, rgba(239,68,68,.07), transparent); }
.ds-feed-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1rem; }
.ds-feed-ico.new { background: #DCFCE7; color: #16A34A; }
.ds-feed-ico.updated { background: #DBEAFE; color: #2563EB; }
.ds-feed-ico.failed { background: #FEE2E2; color: #EF4444; }
.ds-feed-phone { font-weight: 800; color: #1E3A8A; direction: ltr; }
.ds-feed-name { font-weight: 600; font-size: .88rem; }
.ds-feed-addr { font-size: .76rem; color: var(--pt-text-3, #64748B); }
.ds-feed-meta { font-size: .72rem; color: #94A3B8; text-align: end; white-space: nowrap; }
@keyframes dsFeedIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.ds-feed-empty { padding: 2rem 1rem; text-align: center; color: var(--pt-text-3, #94A3B8); font-size: .9rem; }

/* ---- Allocation pad ---- */
.ds-alloc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1rem; }
.ds-alloc-preview {
  background: #F0F9FF; border: 1px dashed #93C5FD; border-radius: 12px;
  padding: .8rem 1rem; font-size: .85rem; color: #1E40AF; margin-bottom: 1rem;
}
.ds-alloc-preview b { font-size: 1.05rem; }
.ds-alloc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: .6rem; margin-top: .8rem; }
.ds-alloc-emp {
  border: 2px solid var(--pt-border, #E2E8F0); border-radius: 12px; padding: .7rem;
  text-align: center; cursor: pointer; transition: all .15s ease; background: #fff;
}
.ds-alloc-emp:hover { border-color: #93C5FD; }
.ds-alloc-emp.active { border-color: #2563EB; background: #EFF6FF; box-shadow: 0 6px 16px rgba(37,99,235,.15); }
.ds-alloc-emp-avatar { width: 38px; height: 38px; border-radius: 50%; margin: 0 auto .4rem; }
.ds-alloc-emp-name { font-weight: 700; font-size: .85rem; }
.ds-alloc-emp-meta { font-size: .72rem; color: var(--pt-text-3, #64748B); margin-top: .15rem; }

/* ---- Pool table badges ---- */
.ds-pool-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700;
}
.ds-pool-badge.unassigned  { background: #FEF3C7; color: #B45309; }
.ds-pool-badge.assigned    { background: #DBEAFE; color: #1D4ED8; }
.ds-pool-badge.in_progress { background: #E0E7FF; color: #4338CA; }
.ds-pool-badge.converted   { background: #DCFCE7; color: #15803D; }
.ds-pool-badge.exhausted   { background: #F1F5F9; color: #64748B; }

/* ---- Workflow steps ---- */
.ds-steps { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.ds-step {
  display: flex; align-items: center; gap: .55rem; padding: .6rem .9rem;
  border-radius: 12px; border: 1.5px solid var(--pt-border, #E2E8F0);
  background: #fff; text-decoration: none; color: var(--pt-text-2, #334155);
  transition: all .15s ease; flex: 1; min-width: 160px;
}
.ds-step:hover { border-color: #93C5FD; }
.ds-step.active { border-color: #2563EB; background: #EFF6FF; }
.ds-step.done { border-color: #16A34A; background: #F0FDF4; }
.ds-step-num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pt-border, #E2E8F0); color: #fff; font-weight: 800; font-size: .82rem; flex-shrink: 0;
}
.ds-step.active .ds-step-num { background: #2563EB; }
.ds-step.done .ds-step-num { background: #16A34A; }
.ds-step-title { font-weight: 700; font-size: .88rem; display: block; }
.ds-step-sub { font-size: .72rem; color: var(--pt-text-3, #64748B); }
.ds-step-badge { margin-inline-start: auto; }

/* ---- Order-form address alert (real-time verification) ---- */
.ds-addr-alert {
  display: none; align-items: flex-start; gap: .7rem;
  background: linear-gradient(135deg, #FFF7ED, #FFFBEB);
  border: 1px solid #FDBA74; border-radius: 12px; padding: .8rem 1rem;
  margin: .6rem 0; font-size: .86rem; color: #9A3412;
}
.ds-addr-alert.show { display: flex; animation: dsFeedIn .3s ease; }
.ds-addr-alert i { font-size: 1.1rem; color: #F97316; flex-shrink: 0; margin-top: .1rem; }
.ds-addr-alert .ds-addr-new { font-weight: 700; color: #1E40AF; }
.ds-addr-alert .ds-addr-actions { margin-inline-start: auto; display: flex; gap: .4rem; flex-shrink: 0; }

/* ---- Status filter pills (customers page) ---- */
.status-pills {
  display: flex; flex-wrap: wrap; gap: .4rem;
  padding: .6rem 0; margin-bottom: .5rem;
}
.status-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .85rem; border-radius: 20px;
  font-size: .82rem; font-weight: 600;
  border: 2px solid transparent;
  text-decoration: none; transition: all .2s ease;
  cursor: pointer; white-space: nowrap;
  background: var(--pt-card, #fff); color: var(--pt-text-2, #475569);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.status-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,.1);
}
.status-pill .pill-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; border-radius: 10px;
  font-size: .7rem; font-weight: 700; padding: 0 5px;
  background: rgba(0,0,0,.08);
}
.status-pill.active {
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.status-pill.active .pill-count {
  background: rgba(255,255,255,.3);
}
/* per-color pills */
.status-pill[data-color="primary"] { border-color: #c7d2fe; }
.status-pill[data-color="primary"].active { background: #4F46E5; }
.status-pill[data-color="success"] { border-color: #bbf7d0; }
.status-pill[data-color="success"].active { background: #16A34A; }
.status-pill[data-color="warning"] { border-color: #fde68a; }
.status-pill[data-color="warning"].active { background: #D97706; color: #fff; }
.status-pill[data-color="danger"] { border-color: #fecaca; }
.status-pill[data-color="danger"].active { background: #DC2626; }
.status-pill[data-color="secondary"] { border-color: #cbd5e1; }
.status-pill[data-color="secondary"].active { background: #64748B; }
.status-pill[data-color="dark"] { border-color: #94a3b8; }
.status-pill[data-color="dark"].active { background: #1E293B; }
.status-pill[data-color="info"] { border-color: #a5f3fc; }
.status-pill[data-color="info"].active { background: #0891B2; }
.status-pill.pill-all { border-color: #e2e8f0; }
.status-pill.pill-all.active { background: #1E293B; }

/* ---- Customer phone section (view) ---- */
.phone-block {
  border: 1px solid var(--pt-border, #e2e8f0); border-radius: 10px;
  padding: .6rem .8rem; margin-top: .3rem;
  background: var(--pt-card, #fff);
}
.phone-main {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  font-size: .95rem;
}
.phone-main .phone-num { font-weight: 700; font-family: monospace; direction: ltr; }
.phone-extras { margin-top: .4rem; border-top: 1px dashed #e2e8f0; padding-top: .4rem; }
.phone-extra-row {
  display: flex; align-items: center; gap: .4rem;
  font-size: .85rem; padding: .2rem 0;
}
.phone-extra-row .pe-num { direction: ltr; font-family: monospace; }
.phone-extra-row .pe-label { color: var(--pt-text-3, #94a3b8); font-size: .78rem; }
.phone-add-row {
  display: flex; align-items: center; gap: .3rem; margin-top: .35rem;
}
.phone-add-row input { font-size: .82rem; }


/* ===== Customers: simplified focused list ===== */
.customer-table { --ct-line: #eef2f7; }
.customer-table thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--pt-text-3, #94a3b8); font-weight: 600; border-bottom: 1px solid var(--ct-line);
  padding-top: .7rem; padding-bottom: .7rem; white-space: nowrap;
}
.customer-table tbody td { border-color: var(--ct-line); padding-top: .8rem; padding-bottom: .8rem; vertical-align: middle; }
.customer-table tbody tr:hover { background: #f8fafc; }
.customer-main { padding-right: 0; }
.customer-name {
  color: var(--pt-text-1, #0f172a); text-decoration: none; font-size: .98rem;
  display: inline-block; line-height: 1.3;
}
.customer-name:hover { color: #4F46E5; text-decoration: underline; }
.customer-status {
  display: inline-block; margin-inline-start: .5rem; font-size: .68rem;
  font-weight: 600; padding: .14rem .55rem; border-radius: 999px; vertical-align: middle;
}
.status-pill-sm.status-primary    { background: #EEF2FF; color: #4F46E5; }
.status-pill-sm.status-success   { background: #ECFDF5; color: #059669; }
.status-pill-sm.status-warning   { background: #FFFBEB; color: #D97706; }
.status-pill-sm.status-danger    { background: #FEF2F2; color: #DC2626; }
.status-pill-sm.status-secondary { background: #F1F5F9; color: #64748B; }
.status-pill-sm.status-dark      { background: #E2E8F0; color: #334155; }
.status-pill-sm.status-info      { background: #ECFEFF; color: #0891B2; }
.customer-meta { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: .25rem; }
.meta-item { display: inline-flex; align-items: center; gap: .28rem; font-size: .74rem; color: var(--pt-text-3, #94a3b8); }
.meta-item i { font-size: .8rem; }
.customer-phone { font-family: monospace; direction: ltr; font-size: .9rem; color: var(--pt-text-1, #0f172a); white-space: nowrap; }
.customer-loc { font-size: .9rem; }
.customer-loc .small { font-size: .74rem; }
.employee-tag .badge { font-size: .74rem; }
.btn-icon-sm { width: 26px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; }
.dropdown-toggle-no-caret::after { display: none; }

/* delivery-status badge may hold a long city + address + timestamp: let it wrap */
.sabeq-badge {
  display: inline-block;
  white-space: normal;
  text-align: start;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

/* ============ Impersonate (admin previewing as employee) ============ */
.impersonate-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; padding: .55rem 1rem;
  background: linear-gradient(90deg, #7C3AED, #4F46E5); color: #fff;
  font-size: .85rem;
}
.impersonate-bar .impersonate-info { display: inline-flex; align-items: center; gap: .5rem; }
.impersonate-bar .impersonate-info i { font-size: 1rem; }
.impersonate-bar .impersonate-exit {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.2); color: #fff; text-decoration: none;
  padding: .3rem .8rem; border-radius: 8px; font-weight: 600;
  transition: background .15s;
}
.impersonate-bar .impersonate-exit:hover { background: rgba(255,255,255,.32); color: #fff; }

/* ============ Customer list (dense table on desktop, cards on mobile) ============ */
.customer-list { width: 100%; }

.customer-table { border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; }
.customer-table thead th {
  background: #f8fafc; color: #64748b; font-size: .78rem; font-weight: 700;
  padding: .7rem .85rem; white-space: nowrap; border-bottom: 1px solid #e2e8f0;
}
.customer-table tbody td { padding: .7rem .85rem; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.customer-table tbody tr:last-child td { border-bottom: 0; }
.customer-table tbody tr:hover { background: #f8fafc; }
.customer-table .col-cb { width: 38px; }
.customer-table .col-cb .form-check-input { margin: 0; display: block; }
.customer-table .col-actions { width: 150px; text-align: end; }

/* customer identity cell */
.cell-customer { min-width: 235px; }
.cust-cell { display: flex; align-items: center; gap: .6rem; }
.cc-avatar {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .98rem; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.cc-avatar-sm { flex-basis: 38px; width: 38px; height: 38px; font-size: .95rem; }
.cc-avatar[data-color="success"], .cc-avatar[data-color="primary"] { background: linear-gradient(135deg, #059669, #10b981); }
.cc-avatar[data-color="warning"], .cc-avatar[data-color="info"] { background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff; }
.cc-avatar[data-color="danger"] { background: linear-gradient(135deg, #dc2626, #ef4444); }
.cc-avatar[data-color="secondary"], .cc-avatar[data-color="dark"] { background: linear-gradient(135deg, #64748b, #94a3b8); }

.cust-cell-main { min-width: 0; display: flex; flex-direction: column; gap: .12rem; }
.cust-name-row { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.cc-name { font-weight: 700; color: var(--pt-text-1, #0f172a); text-decoration: none; line-height: 1.25; }
.cc-name:hover { color: #4F46E5; text-decoration: underline; }
.cc-phone { display: inline-flex; align-items: center; gap: .35rem; font-family: monospace;
  font-size: .82rem; font-weight: 600; color: #334155; letter-spacing: .2px; text-decoration: none; }
.cc-phone i { font-size: .78rem; color: #94a3b8; }
.cc-phone:hover { color: #2563EB; text-decoration: underline; }

/* compact location line inside the customer cell */
.cust-loc { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem;
  color: #94a3b8; margin-top: .03rem; white-space: nowrap; }
.cust-loc i { font-size: .8rem; }

/* employee sub-line inside the customer cell */
.cust-emp {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .72rem; color: #94a3b8; margin-top: .05rem;
}
.cust-emp i { font-size: .78rem; }

/* status color dot next to the name */
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.status-dot[data-color="primary"]   { background: #4F46E5; }
.status-dot[data-color="success"]   { background: #059669; }
.status-dot[data-color="warning"]   { background: #D97706; }
.status-dot[data-color="info"]      { background: #0891B2; }
.status-dot[data-color="danger"]    { background: #DC2626; }
.status-dot[data-color="secondary"] { background: #94A3B8; }
.status-dot[data-color="dark"]      { background: #475569; }

/* unified activity column: dense stacked lines */
.cell-activity { min-width: 170px; }
.act-line {
  display: flex; align-items: center; gap: .45rem; line-height: 1.5;
  font-size: .8rem; color: var(--pt-text-2, #475569); font-variant-numeric: tabular-nums;
}
.act-line + .act-line, .act-line + .act-chips { margin-top: .15rem; }
.act-line i { color: #94a3b8; font-size: .82rem; }
.act-line span { white-space: nowrap; }
.act-line.act-due { color: #DC2626; font-weight: 600; }
.act-line.act-due i { color: #DC2626; }
.act-due-badge { font-size: .65rem; font-weight: 700; margin-inline-start: .15rem; }
.act-chips { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .1rem; }

/* performance badges */
.cc-perf {
  display: inline-flex; align-items: center; gap: .26rem; font-size: .7rem; font-weight: 600;
  padding: .14rem .5rem; border-radius: 999px; white-space: nowrap;
}
.perf-value    { background: #F0FDF4; color: #15803D; }
.perf-purchases{ background: #EFF6FF; color: #1D4ED8; }
.perf-contacts { background: #FFF7ED; color: #C2410C; }

/* action cell: visible icon buttons + overflow */
.cell-actions { display: inline-flex; align-items: center; gap: .35rem; }
.btn-icon {
  width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 8px; font-size: .95rem; text-decoration: none;
  border: 1px solid transparent; transition: transform .12s;
}
.btn-icon:hover { transform: translateY(-1px); text-decoration: none; }
.btn-wa-icon { background: #25D366; color: #fff; }
.btn-wa-icon:hover { background: #1ebe57; color: #fff; }
.btn-call-icon { background: #2563EB; color: #fff; }
.btn-call-icon:hover { background: #1d4ed8; color: #fff; }
.btn-dots { background: transparent; color: #64748b; border-color: #e2e8f0; }
.btn-dots:hover { background: #f1f5f9; color: #0f172a; }

/* WhatsApp prefix toggle button (972/970) next to the wa icon */
.wa-wrap { display: inline-flex; align-items: center; gap: .25rem; }
.wa-prefix-btn {
  width: auto; min-width: 42px; height: 32px; padding: 0 .45rem; font-size: .78rem;
  font-weight: 700; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff;
  color: #0f172a; cursor: pointer; transition: transform .12s;
}
.wa-prefix-btn:hover { background: #f1f5f9; transform: translateY(-1px); }
.btn-sm.wa-prefix-btn { height: auto; min-width: 40px; }

/* pager for the customer list */
#ccPager.pager { margin-top: 1rem; }

/* ============ Mobile: each row becomes a compact card ============ */
@media (max-width: 900px) {
  .customer-list, .customer-table, .customer-table thead, .customer-table tbody,
  .customer-table tr, .customer-table th, .customer-table td { display: block; width: 100%; min-width: 0; }
  #customersTable { min-width: 0; }
  .customer-table thead { display: none; }
  .customer-table { border: 0; border-radius: 0; overflow: visible; }
  .customer-table tbody { display: block; }
  .customer-table tr {
    border: 1px solid #e2e8f0; border-radius: 16px; background: #fff;
    padding: .7rem .85rem .55rem; margin-bottom: .7rem;
    box-shadow: 0 1px 2px rgba(15,23,42,.04); position: relative;
    overflow: hidden;
  }
  .customer-table td { border: 0; padding: 0; min-width: 0; max-width: 100%; }
  /* force desktop column widths back to fluid on phones */
  .customer-table .col-cb, .customer-table .col-actions,
  .cell-customer, .cell-activity { width: 100%; min-width: 0; max-width: 100%; }

  /* admin checkbox pinned to the top corner */
  .customer-table .col-cb { position: absolute; top: .85rem; inset-inline-start: .95rem; width: auto; }
  .customer-table .col-cb .form-check-input { width: 1.15rem; height: 1.15rem; margin: 0; }
  .customer-table tr:has(.col-cb) { padding-inline-start: 2.4rem; }

  /* identity: avatar + name + status dot + phone */
  .cust-cell { display: flex; align-items: center; gap: .65rem; }
  .cc-avatar { flex: 0 0 44px; width: 44px; height: 44px; font-size: 1.02rem; border-radius: 12px; }
  .cust-cell-main { min-width: 0; gap: .15rem; }
  .cc-name { font-size: .98rem; overflow-wrap: anywhere; }
  .status-dot { width: 10px; height: 10px; }
  .cc-phone { font-size: .93rem; color: #0f172a; font-weight: 700; gap: .4rem; white-space: nowrap; }
  .cc-phone i { font-size: .85rem; color: #2563EB; }
  .cust-loc { font-size: .82rem; color: #64748b; overflow-wrap: anywhere; }
  .cust-emp { font-size: .76rem; }

  /* activity row separated under the identity */
  .cell-activity { margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed #e2e8f0; }
  .cell-activity.is-empty { border-top: 0; padding-top: 0; margin-top: .15rem; }
  .act-line { font-size: .82rem; }
  .act-line span { white-space: normal; overflow-wrap: anywhere; }
  .act-chips { gap: .35rem; }

  /* actions: one row, right aligned, touch friendly */
  .col-actions { margin-top: .55rem; padding-top: .55rem; border-top: 1px dashed #e2e8f0;
    display: flex; justify-content: flex-end; }
  .cell-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
    width: 100%; justify-content: flex-end; }
  .btn-icon { width: 40px; height: 40px; border-radius: 11px; font-size: 1.05rem; flex: 0 0 auto; }
  .wa-prefix-btn { width: auto; min-width: 48px; height: 40px; font-size: .85rem; }
  .wa-wrap { gap: .35rem; }

  /* never let any card push the page into horizontal scroll */
  .customer-list { overflow-x: clip; }
  .pager { flex-wrap: wrap; }
}

/* ================================================================
   Pool view — smart city chips + assignment bar polish
   ================================================================ */
.pt-chipbox {
  min-height: 38px;
  cursor: text;
  padding: 4px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
  background: #fff;
}
.pt-chipbox:focus-within {
  border-color: #86b7fe;
  box-shadow: 0 0 0 .25rem rgba(13,110,253,.15);
}
.pt-chipbox input {
  border: 0;
  outline: 0;
  flex: 1 1 150px;
  min-width: 150px;
  background: transparent;
}
.pt-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #eef2f7;
  border: 1px solid #d6dee9;
  color: #1e293b;
  border-radius: 50rem;
  padding: .15rem .55rem;
  font-size: .8rem;
  font-weight: 600;
}
.pt-chip .pt-chip-x {
  border: 0;
  background: transparent;
  color: #64748b;
  line-height: 1;
  padding: 0 .15rem;
  font-size: .85rem;
  cursor: pointer;
}
.pt-chip .pt-chip-x:hover { color: #dc3545; }
.pt-city-dd {
  z-index: 2000;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d6dee9;
  border-radius: .5rem;
  box-shadow: 0 .5rem 1rem rgba(15, 23, 42, .15);
  padding: .25rem;
  direction: rtl;
}
.pt-city-dd-item {
  padding: .4rem .6rem;
  border-radius: .35rem;
  cursor: pointer;
  font-size: .9rem;
}
.pt-city-dd-item:hover,
.pt-city-dd-item.active {
  background: #0d6efd;
  color: #fff;
}
.bar-card > .card-header {
  font-weight: 700;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}
.bar-card .form-label { font-weight: 600; }

/* ============================================================
   Orders page — stats range widget + live delivery tracking
   ============================================================ */
.order-range-widget {
  display: flex;
  align-items: flex-end;
  gap: .75rem;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #f8fafc, #f2f6fb);
  border: 1px solid #e2e8f0;
  border-radius: .9rem;
  padding: .65rem .8rem;
}
.range-chips { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1 1 auto; }
.range-chip {
  border: 1px solid #d6dee9;
  background: #fff;
  color: var(--pt-text-2);
  font-size: .78rem;
  font-weight: 700;
  padding: .32rem .75rem;
  border-radius: 999px;
  transition: all .15s;
}
.range-chip:hover { border-color: var(--pt-primary-500); color: var(--pt-primary-600); }
.range-chip.active {
  background: var(--pt-primary-500);
  border-color: var(--pt-primary-500);
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, .25);
}
.range-dates { display: flex; align-items: flex-end; gap: .5rem; }
.range-dates label { display: block; font-size: .7rem; font-weight: 700; margin-bottom: .15rem; }
.range-dates input { min-width: 132px; }

.del-tracking { color: var(--pt-primary-600); letter-spacing: .2px; }
.del-chip {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  font-size: .72rem;
  font-weight: 700;
  padding: .18rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.del-chip i { font-size: .66rem; }
.del-chip-new  { background: #E8F1F8; color: var(--pt-primary-600); }
.del-chip-info { background: #E0F2FE; color: var(--pt-info-700); }
.del-chip-warn { background: #FFF7ED; color: #C2410C; }
.del-chip-good { background: var(--pt-success-100); color: var(--pt-success-700); }
.del-chip-bad  { background: var(--pt-danger-100); color: var(--pt-danger-700); }
.del-chip-dim  { background: #F1F5F9; color: var(--pt-text-3); }

.track-sync-btn {
  width: 26px;
  height: 26px;
  border-radius: .4rem;
  border: 1px solid #d6dee9;
  background: #fff;
  color: var(--pt-text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: all .15s;
}
.track-sync-btn:hover:not(:disabled) { border-color: var(--pt-primary-500); color: var(--pt-primary-600); background: var(--pt-primary-100); }
.del-sync-spin i, .del-sync-spin svg {
  display: inline-block;
  animation: pt-spin .7s linear infinite;
}
#trackingSyncAllBtn.del-sync-spin i {
  display: inline-block;
  animation: pt-spin .7s linear infinite;
}
@keyframes pt-spin { to { transform: rotate(360deg); } }
.del-synced { font-size: .68rem; color: var(--pt-text-3); }

/* Private (internal) order notes */
.ord-priv {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .72rem;
  color: var(--pt-text-2);
  direction: rtl;
}
.ord-priv i { color: var(--pt-warning-700); }

