/* ═══════════════════════════════════════════════════════════
   Theme v2 — Aqua Mist
   watery white · soft cyan · light dashboard
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #f7fcfd;
  --bg-soft: #eef8fa;
  --ink: #1a2b33;
  --ink-soft: #3d5560;
  --muted: #6b858f;
  --line: #d7e8ec;
  --line-strong: #c5dbe0;
  --panel: #ffffff;
  --brand: #0891b2;
  --brand-dark: #0e7490;
  --brand-mid: #06b6d4;
  --brand-soft: #ecfeff;
  --accent: #22d3ee;
  --accent-soft: #cffafe;
  --gold: #06b6d4;
  --gold-soft: #ecfeff;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(14, 116, 144, 0.04), 0 10px 28px rgba(8, 145, 178, 0.07);
  --shadow-sm: 0 1px 2px rgba(26, 43, 51, 0.05);
  --font: "IBM Plex Sans Arabic", "Tajawal", sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 78px;
  --fw: 700;
  --fw-strong: 800;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* —— Canvas —— */
body {
  color: var(--ink);
  font-weight: var(--fw);
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(6, 182, 212, 0.10), transparent 50%),
    radial-gradient(ellipse 60% 40% at -5% 100%, rgba(8, 145, 178, 0.06), transparent 45%),
    linear-gradient(180deg, #f7fcfd 0%, #eef8fa 100%);
}

.app-backdrop {
  opacity: 0.9;
}

.app-orb {
  opacity: 0.22;
  filter: blur(40px);
}

.app-orb-a {
  background: radial-gradient(circle at 35% 35%, #a5f3fc, transparent 68%);
}

.app-orb-b {
  background: radial-gradient(circle at 60% 40%, #bae6fd, transparent 70%);
}

.app-grid {
  background-image:
    linear-gradient(rgba(8, 145, 178, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 145, 178, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 10%, transparent 75%);
}

.page {
  padding-top: 1.1rem;
}

/* —— Sidebar · Executive Command Rail —— */
.sidebar {
  padding: 0.85rem 0.65rem 0.75rem;
  border-inline-end: 1px solid #d7e8ec;
  background:
    linear-gradient(180deg, #ffffff 0%, #f0fafb 55%, #e8f6f8 100%);
  box-shadow: 4px 0 24px rgba(8, 145, 178, 0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #1a2b33;
}

.sidebar-brand {
  display: block;
  padding: 0.35rem 0.35rem 0.9rem;
  margin-bottom: 0.45rem;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid #d7e8ec;
  background: transparent;
}

.sidebar-brand-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
}

.sidebar-brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
  text-decoration: none;
}

.sidebar-brand-tools {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.sidebar-brand .brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  justify-content: center;
}

.sidebar-brand .brand-sub {
  margin: 0;
  order: 0;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  color: #0891b2;
  letter-spacing: 0.08em;
}

.sidebar-brand .brand {
  margin: 0;
  order: 1;
  font-family: "Tajawal", var(--font);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #1a2b33;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.22), transparent 45%),
    linear-gradient(145deg, #06b6d4 0%, #0891b2 100%);
  border: 1px solid rgba(8, 145, 178, 0.25);
  box-shadow: 0 6px 16px rgba(8, 145, 178, 0.18);
}

.sidebar-brand .brand-mark svg {
  width: 1.3rem;
  height: 1.3rem;
}

.sidebar-brand .brand-mark .brand-bar {
  fill: #fff;
}

.sidebar-brand-tools .sidebar-collapse,
.sidebar-brand-tools .sidebar-close,
.sidebar-brand-tools .app-hard-refresh--brand {
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #c5dae8;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-brand-tools .app-hard-refresh--brand {
  border-color: rgba(126, 196, 181, 0.35);
  background: rgba(6, 182, 212, 0.85);
  color: #fff;
}

.sidebar-brand-tools .sidebar-collapse:hover,
.sidebar-brand-tools .sidebar-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-brand-tools .app-hard-refresh--brand:hover {
  filter: brightness(1.08);
  color: #fff;
}

html.sidebar-collapsed .sidebar-brand-top {
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

html.sidebar-collapsed .sidebar-brand-lockup {
  justify-content: center;
  width: 100%;
}

html.sidebar-collapsed .sidebar-brand .brand-copy {
  display: none;
}

html.sidebar-collapsed .sidebar-brand-tools {
  width: 100%;
  justify-content: center;
  padding-top: 0;
}

.sidebar-nav {
  gap: 0.85rem;
  padding: 0.35rem 0.15rem 0.5rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.sidebar-zone {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.sidebar-zone + .sidebar-zone {
  padding-top: 0.55rem;
  border-top: 1px solid #d7e8ec;
}

.sidebar-section-label {
  color: #6b858f;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: none;
  margin: 0.15rem 0.55rem 0.4rem;
}

.sidebar-nav .sidebar-link {
  position: relative;
  gap: 0.65rem;
  border-radius: 10px;
  color: #3d5560 !important;
  font-weight: 700 !important;
  font-size: 0.92rem;
  line-height: 1.25;
  padding: 0.62rem 0.72rem;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none !important;
}

.sidebar-nav .sidebar-link > span {
  color: inherit !important;
  font-weight: 700 !important;
}

.sidebar-nav .sidebar-ico {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0.22rem;
  border-radius: 8px;
  background: #ecfeff;
  color: #0891b2;
  box-sizing: border-box;
}

.sidebar-nav .sidebar-link:hover {
  background: #ecfeff;
  border-color: #d7e8ec;
  color: #0e7490 !important;
  box-shadow: none !important;
}

.sidebar-nav .sidebar-link:hover .sidebar-ico {
  background: rgba(6, 182, 212, 0.18);
  color: #0e7490;
}

/* رابط صفحة نشط داخل المجموعة — أقوى تمييز */
.sidebar-nav .sidebar-link.is-active:not(.sidebar-group-toggle) {
  background: #0891b2 !important;
  border-color: #0e7490 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.sidebar-nav .sidebar-link.is-active:not(.sidebar-group-toggle) > span,
.sidebar-nav .sidebar-link.is-active:not(.sidebar-group-toggle) .sidebar-group-chevron {
  color: #ffffff !important;
}

.sidebar-nav .sidebar-link.is-active:not(.sidebar-group-toggle) .sidebar-ico {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.sidebar-group {
  gap: 0.18rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.sidebar-group.is-current {
  padding: 0;
  border: 0;
  background: transparent;
}

/* مجموعة مفتوحة/حالية — هادئة، لا تنافس الصفحة النشطة */
.sidebar-group.is-current > .sidebar-group-toggle {
  background: #f0fafb !important;
  border-color: #d7e8ec !important;
  color: #0e7490 !important;
  box-shadow: none !important;
}

.sidebar-group.is-current > .sidebar-group-toggle .sidebar-ico {
  background: #ecfeff;
  color: #0891b2;
}

.sidebar-group.is-current > .sidebar-group-toggle .sidebar-group-chevron {
  color: #0e7490 !important;
}

.sidebar-group-items {
  margin: 0.1rem 0 0.15rem;
  margin-inline-start: 0.65rem;
  padding-inline-start: 0.45rem;
  border-inline-start: 1px solid #d7e8ec;
}

.sidebar-sublink {
  color: #6b858f !important;
  font-weight: 600 !important;
  font-size: 0.84rem !important;
  padding: 0.48rem 0.65rem !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.sidebar-nav .sidebar-sublink:hover {
  background: #ecfeff !important;
  border-color: #d7e8ec !important;
  color: #0e7490 !important;
}

.sidebar-nav .sidebar-sublink.is-active {
  background: #0891b2 !important;
  border-color: #0e7490 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.sidebar-nav .sidebar-sublink.is-active:hover {
  background: #0e7490 !important;
  border-color: #155e75 !important;
  color: #ffffff !important;
}

.sidebar-nav .sidebar-sublink.is-active .sidebar-ico {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.sidebar-group-chevron {
  color: #6b858f;
}

.sidebar-foot {
  margin-top: 0.55rem;
  padding: 0.65rem 0.45rem 0.35rem;
  border: 0;
  border-radius: 0;
  border-top: 1px solid #d7e8ec;
  background: transparent;
  gap: 0.45rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.4rem 0.55rem;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #ecfeff;
  border: 1px solid #cffafe;
  color: #0e7490;
  font-family: "Tajawal", var(--font);
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1;
}

.sidebar-user-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.sidebar-user-name {
  margin: 0;
  color: #1a2b33;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: #6b858f;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sidebar-collapse,
.sidebar-close {
  border: 1px solid #d7e8ec;
  border-radius: var(--radius-sm);
  color: #3d5560;
  background: #ffffff;
}

.sidebar-collapse:hover,
.sidebar-close:hover {
  background: #ecfeff;
  border-color: #cffafe;
  color: #0e7490;
}

html.sidebar-collapsed .sidebar-nav,
html.sidebar-collapsed .sidebar-brand,
html.sidebar-collapsed .sidebar-foot,
html.sidebar-collapsed .sidebar-group {
  padding-inline: 0.28rem;
}

html.sidebar-collapsed .sidebar-section-label,
html.sidebar-collapsed .sidebar-user-meta {
  display: none;
}

html.sidebar-collapsed .sidebar-user {
  justify-content: center;
  padding-inline: 0;
}

html.sidebar-collapsed .sidebar-zone + .sidebar-zone {
  padding-top: 0.35rem;
}

html.sidebar-collapsed .sidebar-group.is-current > .sidebar-group-toggle {
  background: #f0fafb !important;
  border-color: #d7e8ec !important;
  box-shadow: inset 0 -3px 0 #0891b2 !important;
}

html.sidebar-collapsed .sidebar-nav .sidebar-link.is-active {
  background: #0891b2 !important;
  border-color: #0e7490 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

/* —— Actions / buttons —— */
.sidebar-action.btn-refresh {
  background: #0891b2 !important;
  border: 1px solid #0c6559 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.28);
  border-radius: var(--radius-sm);
  font-weight: 800 !important;
}

.sidebar-action.btn-refresh > span,
.sidebar-action.btn-refresh .btn-refresh-text,
.sidebar-action.btn-refresh .sidebar-ico {
  color: #ffffff !important;
}

.sidebar-action.btn-refresh .sidebar-ico {
  stroke: #ffffff;
}

.sidebar-action.btn-refresh:hover {
  background: #0c6559 !important;
  border-color: #0a544b !important;
  color: #ffffff !important;
  filter: none;
}

.sidebar-action.btn-logout {
  background: #ffffff;
  border: 1px solid #d7e8ec;
  color: #dc2626 !important;
  border-radius: var(--radius-sm);
}

.sidebar-action.btn-logout:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c !important;
}

.sidebar-action.btn-logout .sidebar-ico {
  background: transparent !important;
  color: inherit !important;
}

.btn-primary,
button.btn-primary,
.dash-filter .btn-primary {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff !important;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.62rem 1.15rem;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s var(--ease), transform 0.12s ease, border-color 0.15s ease;
}

.btn-primary:hover,
.dash-filter .btn-primary:hover {
  background: var(--brand-dark);
  filter: none;
}

.btn-primary:active {
  transform: translateY(1px);
}

.sales-view-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  padding: 0.28rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff !important;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s var(--ease);
}

.sales-view-btn:hover {
  background: var(--brand-dark);
  filter: none;
  color: #fff !important;
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--brand-dark);
  font-weight: 700;
}

.btn-ghost:hover {
  background: var(--brand-soft);
  border-color: #9fc0d4;
}

.btn-scan {
  background: var(--brand);
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.btn-scan:hover {
  background: var(--brand-dark);
  filter: none;
}

.btn-new-search {
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: none;
}

/* —— Forms —— */
.dash-filter,
.dash-branch-filter,
.field input,
.field select,
.dash-branch-filter select,
input[type="date"],
input[type="text"],
input[type="search"],
select {
  border-radius: var(--radius-sm) !important;
}

.field input,
.field select,
.dash-branch-filter select,
input[type="date"],
select {
  border: 1px solid var(--line-strong) !important;
  background: #fff !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

.field input:focus,
.field select:focus,
.dash-branch-filter select:focus,
input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: var(--brand-mid) !important;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.14) !important;
}

/* —— Dashboard head —— */
.dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.dash-head-copy h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-dark);
}

.dash-head-copy p {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.dash-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-inline-start: auto;
}

.dash-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.85rem !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid #a5f3fc !important;
  background: #ecfeff !important;
  color: #0e7490 !important;
  font-weight: 800 !important;
  font-size: 0.78rem !important;
  cursor: pointer;
}

.dash-pdf-btn:hover {
  background: #cffafe !important;
  border-color: #67e8f9 !important;
}

.dash-pdf-btn svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-pdf-btn-sm {
  padding: 0.2rem 0.48rem !important;
  font-size: 0.66rem !important;
  gap: 0.2rem;
  line-height: 1.2;
}

.dash-pdf-btn-sm svg {
  width: 0.78rem;
  height: 0.78rem;
}

/* ترتيب المخازن/المجموعات: مسار رمادي + تعبئة ملونة بنسبة الصف */
.inv-dash .inv-rank-track {
  background: #e2eef2 !important;
  overflow: hidden !important;
  height: 0.55rem !important;
  border-radius: 999px !important;
}

.inv-dash .inv-rank-fill {
  display: block !important;
  height: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  border-radius: inherit !important;
  animation: none !important;
}

.inv-dash .inv-rank-fill-wh {
  background: linear-gradient(90deg, #34d399, #059669) !important;
}

.inv-dash .inv-rank-fill-group {
  background: linear-gradient(90deg, #22d3ee, #0891b2) !important;
}

.inv-dash .inv-rank-fill-stagnant {
  background: linear-gradient(90deg, #fbbf24, #d97706) !important;
}

.purchase-dash .inv-rank-track {
  background: #e2eef2 !important;
  overflow: hidden !important;
  height: 0.55rem !important;
  border-radius: 999px !important;
}

.purchase-dash .inv-rank-fill {
  display: block !important;
  height: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  border-radius: inherit !important;
  animation: none !important;
}

.purchase-dash .inv-rank-fill-purchase {
  background: linear-gradient(90deg, #22d3ee, #0891b2) !important;
}

.purchase-dash .purchase-items-board .inv-rank-track {
  direction: ltr !important;
}

.purchase-dash .purchase-items-board .inv-rank-fill-purchase {
  background: linear-gradient(90deg, #34d399 0%, #047857 100%) !important;
}

.purchase-dash .purchase-items-panel .inv-rank-pct.inv-share {
  color: #047857 !important;
}

.inv-dash .inv-stagnant-panel .inv-rank-pct.inv-share {
  color: #b45309 !important;
}

.inv-dash .inv-stagnant-panel .inv-rank-chart {
  max-height: calc(1.85rem + (15 * 1.95rem));
}

.inv-dash .inv-rank-pct.inv-share {
  color: #0891b2 !important;
  font-weight: 800 !important;
}

/* ترتيب المجموعات — أعمدة عمودية */
.inv-dash .inv-rank-vchart {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem 0.75rem;
  min-height: 16.5rem;
  overflow-x: auto;
}

.inv-dash .inv-rank-vcol {
  flex: 1 1 0;
  min-width: 3.4rem;
  max-width: 5.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
}

.inv-dash .inv-rank-vpct {
  font-size: 0.68rem;
  font-weight: 800;
  color: #0891b2;
  line-height: 1;
}

.inv-dash .inv-rank-vtrack {
  width: 1.15rem;
  height: 9.5rem;
  border-radius: 999px;
  background: #e2eef2;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.inv-dash .inv-rank-vfill {
  width: 100%;
  height: 0;
  min-height: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #67e8f9 0%, #0891b2 100%);
}

.inv-dash .inv-rank-vnum {
  width: 1.2rem;
  height: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-radius: 999px;
  background: #ecfeff;
  color: #0e7490;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  direction: ltr;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.inv-dash .inv-rank-vcol:nth-child(1) .inv-rank-vnum {
  background: linear-gradient(145deg, #23b268, #148f52);
  color: #fff;
}

.inv-dash .inv-rank-vcol:nth-child(2) .inv-rank-vnum {
  background: linear-gradient(145deg, #22d3ee, #0891b2);
  color: #fff;
}

.inv-dash .inv-rank-vcol:nth-child(3) .inv-rank-vnum {
  background: linear-gradient(145deg, #f59e0b, #d97706);
  color: #fff;
}

.inv-dash .inv-rank-vname {
  font-size: 0.62rem;
  font-weight: 800;
  color: #1a3358;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inv-dash .inv-rank-vmeta {
  font-size: 0.58rem;
  font-weight: 700;
  color: #5a7394;
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-dash .inv-group-sales-panel .inv-rank-chart {
  max-height: none;
}

.dash-panel-head .dash-panel-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-inline-start: auto;
}

.dash-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

.dash-filter .field label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

/* —— KPI dashboard —— */
.dash-kpi {
  gap: 0.85rem !important;
  margin-bottom: 1.15rem;
}

.dash-kpi-card,
.dash-kpi-glass {
  position: relative;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: #fff !important;
  box-shadow: var(--shadow-sm) !important;
  padding: 1rem 1.05rem 0.95rem !important;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s var(--ease);
}

.dash-kpi-glass::after {
  display: none !important;
}

.dash-kpi-card::before,
.dash-kpi-glass::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  height: auto;
  top: auto;
  background: var(--brand-mid);
  opacity: 1;
  display: block !important;
}

.dash-kpi-glass-pos::before { background: var(--brand-mid); }
.dash-kpi-glass-returns::before { background: #dc2626; }
.dash-kpi-glass-wholesale::before { background: #6b858f; }
.dash-kpi-glass-total::before,
.dash-kpi-accent::before { background: var(--accent); }
.dash-kpi-glass-sellers::before { background: #06b6d4; }
.dash-kpi-glass-devices::before { background: var(--accent); }
.dash-kpi-glass-branches::before { background: #d97706; }
.dash-kpi-glass-visit::before { background: #be123c; }
.dash-kpi-glass-item-amt::before { background: #15803d; }
.dash-kpi-glass-item-qty::before { background: #0891b2; }
.dash-kpi-glass-item-ret::before { background: #dc2626; }

.dash-kpi-card:hover,
.dash-kpi-glass:hover {
  border-color: #b6cfe0 !important;
  box-shadow: var(--shadow) !important;
  transform: translateY(-2px);
}

.dash-kpi-label {
  color: var(--muted) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
}

.dash-kpi-value {
  color: var(--ink) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

.dash-kpi-hint {
  display: block !important;
  color: #6b858f !important;
  font-weight: 600 !important;
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
  margin-top: 0.15rem;
}

.dash-kpi-ico {
  border-radius: 9px !important;
  color: #fff !important;
}

.dash-kpi-ico-pos {
  background: linear-gradient(145deg, #22d3ee, #0891b2) !important;
  box-shadow: 0 3px 10px rgba(8, 145, 178, 0.28) !important;
}
.dash-kpi-ico-returns {
  background: linear-gradient(145deg, #fb7185, #dc2626) !important;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.25) !important;
}
.dash-kpi-ico-wholesale {
  background: linear-gradient(145deg, #94a3b8, #475569) !important;
  box-shadow: 0 3px 10px rgba(71, 85, 105, 0.22) !important;
}
.dash-kpi-ico-total {
  background: linear-gradient(145deg, #2dd4bf, #0e7490) !important;
  box-shadow: 0 3px 10px rgba(14, 116, 144, 0.26) !important;
}
.dash-kpi-ico-sellers {
  background: linear-gradient(145deg, #22d3ee, #0891b2) !important;
  box-shadow: 0 3px 10px rgba(8, 145, 178, 0.26) !important;
}
.dash-kpi-ico-devices {
  background: linear-gradient(145deg, #34d399, #059669) !important;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.24) !important;
}
.dash-kpi-ico-branches {
  background: linear-gradient(145deg, #fbbf24, #b45309) !important;
  box-shadow: 0 3px 10px rgba(180, 83, 9, 0.24) !important;
}
.dash-kpi-ico-visit {
  background: linear-gradient(145deg, #fb7185, #be123c) !important;
  box-shadow: 0 3px 10px rgba(190, 18, 60, 0.24) !important;
}
.dash-kpi-ico-item-amt {
  background: linear-gradient(145deg, #4ade80, #15803d) !important;
  box-shadow: 0 3px 10px rgba(21, 128, 61, 0.24) !important;
}
.dash-kpi-ico-item-qty {
  background: linear-gradient(145deg, #22d3ee, #0891b2) !important;
  box-shadow: 0 3px 10px rgba(8, 145, 178, 0.26) !important;
}
.dash-kpi-ico-item-ret {
  background: linear-gradient(145deg, #f87171, #b91c1c) !important;
  box-shadow: 0 3px 10px rgba(185, 28, 28, 0.24) !important;
}

.dash-kpi-ico-pur-total {
  background: linear-gradient(145deg, #34d399, #059669) !important;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.24) !important;
  color: #fff !important;
}
.dash-kpi-ico-pur-net {
  background: linear-gradient(145deg, #22d3ee, #0e5a87) !important;
  box-shadow: 0 3px 10px rgba(14, 90, 135, 0.26) !important;
  color: #fff !important;
}
.dash-kpi-ico-pur-vat {
  background: linear-gradient(145deg, #f87171, #b91c1c) !important;
  box-shadow: 0 3px 10px rgba(185, 28, 28, 0.24) !important;
  color: #fff !important;
}
.dash-kpi-ico-pur-inv {
  background: linear-gradient(145deg, #94a3b8, #475569) !important;
  box-shadow: 0 3px 10px rgba(71, 85, 105, 0.22) !important;
  color: #fff !important;
}
.dash-kpi-ico-pur-vendors {
  background: linear-gradient(145deg, #fbbf24, #b45309) !important;
  box-shadow: 0 3px 10px rgba(180, 83, 9, 0.24) !important;
  color: #fff !important;
}
.dash-kpi-ico-pur-qty {
  background: linear-gradient(145deg, #22d3ee, #0891b2) !important;
  box-shadow: 0 3px 10px rgba(8, 145, 178, 0.26) !important;
  color: #fff !important;
}

/* —— Sales KPI: بطاقات ملونة —— */
.page.sales-dash .dash-kpi > .dash-kpi-card.dash-kpi-glass {
  box-shadow: var(--shadow-sm) !important;
}

.page.sales-dash .dash-kpi > .dash-kpi-card::before,
.page.sales-dash .dash-kpi-card::before,
.page.sales-dash .dash-kpi-glass::before {
  display: block !important;
}

.page.sales-dash .dash-kpi > .dash-kpi-card .dash-kpi-ico,
.page.sales-dash .sales-ov-kpis .dash-kpi-ico {
  color: #fff !important;
  box-shadow: 0 3px 8px rgba(8, 145, 178, 0.18) !important;
}

.page.sales-dash .sales-ov-kpis .dash-kpi-ico {
  width: 1.55rem !important;
  height: 1.55rem !important;
  border-radius: 9px !important;
  flex-shrink: 0;
}

.page.sales-dash .sales-ov-kpis .dash-kpi-ico svg {
  width: 0.88rem !important;
  height: 0.88rem !important;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page.sales-dash .sales-ov-kpis .dash-kpi-ico-pos {
  background: linear-gradient(145deg, #22d3ee, #0891b2) !important;
  box-shadow: 0 3px 10px rgba(8, 145, 178, 0.28) !important;
}
.page.sales-dash .sales-ov-kpis .dash-kpi-ico-returns {
  background: linear-gradient(145deg, #fb7185, #dc2626) !important;
  box-shadow: 0 3px 10px rgba(220, 38, 38, 0.25) !important;
}
.page.sales-dash .sales-ov-kpis .dash-kpi-ico-wholesale {
  background: linear-gradient(145deg, #94a3b8, #475569) !important;
  box-shadow: 0 3px 10px rgba(71, 85, 105, 0.22) !important;
}
.page.sales-dash .sales-ov-kpis .dash-kpi-ico-total {
  background: linear-gradient(145deg, #2dd4bf, #0e7490) !important;
  box-shadow: 0 3px 10px rgba(14, 116, 144, 0.26) !important;
}
.page.sales-dash .sales-ov-kpis .dash-kpi-ico-visit {
  background: linear-gradient(145deg, #fb7185, #be123c) !important;
  box-shadow: 0 3px 10px rgba(190, 18, 60, 0.24) !important;
}
.page.sales-dash .sales-ov-kpis .dash-kpi-ico-branches {
  background: linear-gradient(145deg, #fbbf24, #b45309) !important;
  box-shadow: 0 3px 10px rgba(180, 83, 9, 0.24) !important;
}
.page.sales-dash .sales-ov-kpis .dash-kpi-ico-item-ret {
  background: linear-gradient(145deg, #f87171, #b91c1c) !important;
  box-shadow: 0 3px 10px rgba(185, 28, 28, 0.24) !important;
}

.page.sales-dash .dash-kpi-glass-pos {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.page.sales-dash .dash-kpi-glass-pos .dash-kpi-label { color: #06b6d4 !important; }
.page.sales-dash .dash-kpi-glass-pos .dash-kpi-value { color: #0891b2 !important; }
.page.sales-dash .dash-kpi-glass-pos .dash-kpi-hint { color: #1a6fa0 !important; }
.page.sales-dash .dash-kpi-glass-pos .dash-kpi-ico { color: #fff !important; }

.page.sales-dash .dash-kpi-glass-returns {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.page.sales-dash .dash-kpi-glass-returns .dash-kpi-label { color: #b91c1c !important; }
.page.sales-dash .dash-kpi-glass-returns .dash-kpi-value { color: #991b1b !important; }
.page.sales-dash .dash-kpi-glass-returns .dash-kpi-hint { color: #c0392b !important; }
.page.sales-dash .dash-kpi-glass-returns .dash-kpi-ico { color: #fff !important; }

.page.sales-dash .dash-kpi-glass-wholesale {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.page.sales-dash .dash-kpi-glass-wholesale .dash-kpi-label { color: #475569 !important; }
.page.sales-dash .dash-kpi-glass-wholesale .dash-kpi-value { color: #1a2b33 !important; }
.page.sales-dash .dash-kpi-glass-wholesale .dash-kpi-hint { color: #6b858f !important; }
.page.sales-dash .dash-kpi-glass-wholesale .dash-kpi-ico { color: #fff !important; }

.page.sales-dash .dash-kpi-glass-total,
.page.sales-dash .dash-kpi-accent {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.page.sales-dash .dash-kpi-glass-total .dash-kpi-label,
.page.sales-dash .dash-kpi-accent .dash-kpi-label { color: #0891b2 !important; }
.page.sales-dash .dash-kpi-glass-total .dash-kpi-value,
.page.sales-dash .dash-kpi-accent .dash-kpi-value { color: #115e59 !important; }
.page.sales-dash .dash-kpi-glass-total .dash-kpi-hint,
.page.sales-dash .dash-kpi-accent .dash-kpi-hint { color: #06b6d4 !important; }
.page.sales-dash .dash-kpi-glass-total .dash-kpi-ico,
.page.sales-dash .dash-kpi-accent .dash-kpi-ico { color: #fff !important; }

/* نظرة المبيعات: بطاقات KPI بأسلوب Power BI — أيقونة ملوّنة + رقم واضح */
.page.sales-dash.sales-overview-dash .sales-ov-kpis > .dash-kpi-card {
  padding: 0.62rem 0.72rem 0.58rem !important;
  min-height: 6.35rem !important;
  max-height: 6.35rem !important;
  height: 6.35rem !important;
  gap: 0.22rem !important;
}

.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis > .dash-kpi-card {
  min-height: 6.6rem !important;
  max-height: none !important;
  height: auto !important;
}

.page.sales-dash.sales-overview-dash .sales-ov-kpis .dash-kpi-label {
  gap: 0.42rem !important;
}

.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-value {
  white-space: normal !important;
  font-size: clamp(0.85rem, 1.35vw, 1.12rem) !important;
  font-weight: 900 !important;
  line-height: 1.25 !important;
  text-align: start !important;
}

/* ألوان النص تطابق لون كل بطاقة ترتيب */
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-visit .dash-kpi-label,
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-visit .dash-kpi-value,
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-visit .dash-kpi-hint,
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-visit .money,
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-visit .money-value {
  color: #9f1239 !important;
}
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-visit .dash-kpi-label {
  color: #be123c !important;
}
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-visit .dash-kpi-hint {
  color: #c2185b !important;
}

.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-branches .dash-kpi-label {
  color: #b45309 !important;
}
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-branches .dash-kpi-value,
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-branches .money,
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-branches .money-value {
  color: #92400e !important;
}
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-branches .dash-kpi-hint {
  color: #c27803 !important;
}

.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-returns .dash-kpi-label {
  color: #b91c1c !important;
}
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-returns .dash-kpi-value,
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-returns .money,
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-returns .money-value {
  color: #991b1b !important;
}
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-returns .dash-kpi-hint {
  color: #c0392b !important;
}

.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-item-ret .dash-kpi-label {
  color: #b91c1c !important;
}
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-item-ret .dash-kpi-value,
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-item-ret .money,
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-item-ret .money-value {
  color: #7f1d1d !important;
}
.page.sales-dash.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-glass-item-ret .dash-kpi-hint {
  color: #c0392b !important;
}

.page.sales-dash .dash-kpi-glass-sellers {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.page.sales-dash .dash-kpi-glass-sellers .dash-kpi-label { color: #0891b2 !important; }
.page.sales-dash .dash-kpi-glass-sellers .dash-kpi-value { color: #0e7490 !important; }
.page.sales-dash .dash-kpi-glass-sellers .dash-kpi-hint { color: #06b6d4 !important; }
.page.sales-dash .dash-kpi-glass-sellers .dash-kpi-ico { color: #fff !important; }

.page.sales-dash .dash-kpi-glass-devices {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.page.sales-dash .dash-kpi-glass-devices .dash-kpi-label { color: #147a4d !important; }
.page.sales-dash .dash-kpi-glass-devices .dash-kpi-value { color: #065f3a !important; }
.page.sales-dash .dash-kpi-glass-devices .dash-kpi-hint { color: #1a8a58 !important; }
.page.sales-dash .dash-kpi-glass-devices .dash-kpi-ico { color: #fff !important; }

.page.sales-dash .dash-kpi-glass-branches {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.page.sales-dash .dash-kpi-glass-branches .dash-kpi-label { color: #b45309 !important; }
.page.sales-dash .dash-kpi-glass-branches .dash-kpi-value { color: #92400e !important; }
.page.sales-dash .dash-kpi-glass-branches .dash-kpi-hint { color: #c27803 !important; }
.page.sales-dash .dash-kpi-glass-branches .dash-kpi-ico { color: #fff !important; }

.page.sales-dash .dash-kpi-glass-visit {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.page.sales-dash .dash-kpi-glass-visit .dash-kpi-label { color: #be123c !important; }
.page.sales-dash .dash-kpi-glass-visit .dash-kpi-value { color: #9f1239 !important; }
.page.sales-dash .dash-kpi-glass-visit .dash-kpi-hint { color: #e11d48 !important; }
.page.sales-dash .dash-kpi-glass-visit .dash-kpi-ico { color: #fff !important; }

.page.sales-dash .dash-kpi-glass-item-amt {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.page.sales-dash .dash-kpi-glass-item-amt .dash-kpi-label { color: #15803d !important; }
.page.sales-dash .dash-kpi-glass-item-amt .dash-kpi-value { color: #166534 !important; }
.page.sales-dash .dash-kpi-glass-item-amt .dash-kpi-hint { color: #16a34a !important; }
.page.sales-dash .dash-kpi-glass-item-amt .dash-kpi-ico { color: #fff !important; }

.page.sales-dash .dash-kpi-glass-item-qty {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.page.sales-dash .dash-kpi-glass-item-qty .dash-kpi-label { color: #0891b2 !important; }
.page.sales-dash .dash-kpi-glass-item-qty .dash-kpi-value { color: #115e59 !important; }
.page.sales-dash .dash-kpi-glass-item-qty .dash-kpi-hint { color: #22d3ee !important; }
.page.sales-dash .dash-kpi-glass-item-qty .dash-kpi-ico { color: #fff !important; }

.page.sales-dash .dash-kpi-glass-item-ret {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.page.sales-dash .dash-kpi-glass-item-ret .dash-kpi-label { color: #b91c1c !important; }
.page.sales-dash .dash-kpi-glass-item-ret .dash-kpi-value { color: #991b1b !important; }
.page.sales-dash .dash-kpi-glass-item-ret .dash-kpi-hint { color: #c0392b !important; }
.page.sales-dash .dash-kpi-glass-item-ret .dash-kpi-ico { color: #fff !important; }

/* بطاقات الترتيب: النص كامل داخل البطاقة + شارة المرتبة */
.page.sales-dash .dash-kpi > .dash-kpi-card.dash-kpi-ranked {
  overflow: visible !important;
  height: auto !important;
}

.page.sales-dash .dash-kpi-ranked .dash-kpi-value,
.page.sales-dash .dash-kpi-ranked .dash-kpi-hint,
.page.sales-dash .dash-kpi-ranked .dash-kpi-label-text {
  overflow: visible !important;
  text-overflow: unset !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.page.sales-dash .dash-kpi-ranked .dash-kpi-rank {
  color: #fff !important;
}

.page.sales-dash .dash-kpi > .dash-kpi-card:hover {
  filter: saturate(1.06);
}

/* —— Performance KPI: ملونة + نص واضح —— */
.page.perf-dash .perf-kpi > .dash-kpi-card.dash-kpi-glass,
.perf-dash .perf-kpi > .dash-kpi-card.dash-kpi-glass {
  box-shadow: var(--shadow-sm) !important;
}

.page.perf-dash .perf-kpi > .dash-kpi-card::before,
.perf-dash .perf-kpi > .dash-kpi-card::before {
  display: block !important;
}

.perf-dash .perf-kpi-sales {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.perf-dash .perf-kpi-sales .dash-kpi-label { color: #147a4d !important; }
.perf-dash .perf-kpi-sales .dash-kpi-value { color: #065f3a !important; }
.perf-dash .perf-kpi-sales .dash-kpi-hint { color: #1a8a58 !important; }
.perf-dash .perf-kpi-sales .dash-kpi-hint.is-up { color: #047857 !important; font-weight: 800 !important; }
.perf-dash .perf-kpi-sales .dash-kpi-hint.is-down { color: #b91c1c !important; font-weight: 800 !important; }

.perf-dash .perf-kpi-invoices {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.perf-dash .perf-kpi-invoices .dash-kpi-label { color: #06b6d4 !important; }
.perf-dash .perf-kpi-invoices .dash-kpi-value { color: #0891b2 !important; }
.perf-dash .perf-kpi-invoices .dash-kpi-hint { color: #1a6fa0 !important; }

.perf-dash .perf-kpi-returns {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.perf-dash .perf-kpi-returns .dash-kpi-label { color: #be123c !important; }
.perf-dash .perf-kpi-returns .dash-kpi-value { color: #9f1239 !important; }
.perf-dash .perf-kpi-returns .dash-kpi-hint { color: #e11d48 !important; }

.perf-dash .perf-kpi-rate {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.perf-dash .perf-kpi-rate .dash-kpi-label { color: #b45309 !important; }
.perf-dash .perf-kpi-rate .dash-kpi-value { color: #92400e !important; }
.perf-dash .perf-kpi-rate .dash-kpi-hint { color: #c27803 !important; }

.perf-dash .perf-kpi-basket {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.perf-dash .perf-kpi-basket .dash-kpi-label { color: #0891b2 !important; }
.perf-dash .perf-kpi-basket .dash-kpi-value { color: #0e7490 !important; }
.perf-dash .perf-kpi-basket .dash-kpi-hint { color: #06b6d4 !important; }

.perf-dash .perf-kpi-rows {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.perf-dash .perf-kpi-rows .dash-kpi-label { color: #475569 !important; }
.perf-dash .perf-kpi-rows .dash-kpi-value { color: #1a2b33 !important; }
.perf-dash .perf-kpi-rows .dash-kpi-hint { color: #6b858f !important; }

.perf-dash .perf-kpi > .dash-kpi-card:hover {
  filter: saturate(1.06);
  transform: translateY(-2px);
}

/* —— Purchase KPI: ملونة مع نص متوافق —— */
.purchase-dash .purchase-kpi.dash-kpi-card,
.purchase-dash .purchase-kpi.dash-kpi-glass {
  border-width: 1px !important;
  box-shadow: var(--shadow-sm) !important;
}

.purchase-dash .purchase-kpi::before {
  display: none !important;
}

.purchase-dash .purchase-kpi .dash-kpi-ico {
  color: #fff !important;
  width: 1.55rem !important;
  height: 1.55rem !important;
  border-radius: 9px !important;
}

.purchase-dash .purchase-kpi .dash-kpi-ico svg {
  stroke: currentColor;
  fill: none;
  width: 0.88rem;
  height: 0.88rem;
}

.purchase-dash .purchase-kpi-total {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
  color: #0b5c3a;
}

.purchase-dash .purchase-kpi-total .dash-kpi-label { color: #147a4d !important; }
.purchase-dash .purchase-kpi-total .dash-kpi-value { color: #065f3a !important; }
.purchase-dash .purchase-kpi-total .dash-kpi-hint { color: #1a8a58 !important; }
.purchase-dash .purchase-kpi-total .dash-kpi-ico { color: #fff !important; }

.purchase-dash .purchase-kpi-net {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
  color: #0891b2;
}

.purchase-dash .purchase-kpi-net .dash-kpi-label { color: #06b6d4 !important; }
.purchase-dash .purchase-kpi-net .dash-kpi-value { color: #0891b2 !important; }
.purchase-dash .purchase-kpi-net .dash-kpi-hint { color: #1a6fa0 !important; }
.purchase-dash .purchase-kpi-net .dash-kpi-ico { color: #fff !important; }

.purchase-dash .purchase-kpi-vat {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
  color: #7f1d1d;
}

.purchase-dash .purchase-kpi-vat .dash-kpi-label { color: #b91c1c !important; }
.purchase-dash .purchase-kpi-vat .dash-kpi-value { color: #991b1b !important; }
.purchase-dash .purchase-kpi-vat .dash-kpi-hint { color: #c0392b !important; }
.purchase-dash .purchase-kpi-vat .dash-kpi-ico { color: #fff !important; }

.purchase-dash .purchase-kpi-invoices {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
  color: #1a2b33;
}

.purchase-dash .purchase-kpi-invoices .dash-kpi-label { color: #475569 !important; }
.purchase-dash .purchase-kpi-invoices .dash-kpi-value { color: #1a2b33 !important; }
.purchase-dash .purchase-kpi-invoices .dash-kpi-hint { color: #6b858f !important; }
.purchase-dash .purchase-kpi-invoices .dash-kpi-ico { color: #fff !important; }

.purchase-dash .purchase-kpi-vendors {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
  color: #7c4a0e;
}

.purchase-dash .purchase-kpi-vendors .dash-kpi-label { color: #b45309 !important; }
.purchase-dash .purchase-kpi-vendors .dash-kpi-value { color: #92400e !important; }
.purchase-dash .purchase-kpi-vendors .dash-kpi-hint { color: #c27803 !important; }
.purchase-dash .purchase-kpi-vendors .dash-kpi-ico { color: #fff !important; }

.purchase-dash .purchase-kpi-qty {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
  color: #0f4f48;
}

.purchase-dash .purchase-kpi-qty .dash-kpi-label { color: #0891b2 !important; }
.purchase-dash .purchase-kpi-qty .dash-kpi-value { color: #115e59 !important; }
.purchase-dash .purchase-kpi-qty .dash-kpi-hint { color: #06b6d4 !important; }
.purchase-dash .purchase-kpi-qty .dash-kpi-ico { color: #fff !important; }

.purchase-dash .purchase-kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow) !important;
  filter: saturate(1.05);
}

.purchase-dash .purchase-amount,
.purchase-dash td.purchase-amount,
.purchase-dash .purchase-amount .money,
.purchase-dash .purchase-amount .sar-symbol {
  color: #047857 !important;
  font-weight: 800 !important;
}

.purchase-dash .purchase-amount-red,
.purchase-dash td.purchase-amount-red,
.purchase-dash .purchase-groups-panel .purchase-amount,
.purchase-dash .purchase-amount-red .money,
.purchase-dash .purchase-amount-red .sar-symbol,
.purchase-dash .purchase-groups-panel .purchase-amount .money,
.purchase-dash .purchase-groups-panel .purchase-amount .sar-symbol {
  color: #b91c1c !important;
  font-weight: 800 !important;
}

/* —— Panels / charts · Aqua Mist shell —— */
.dash-panel,
.dash-panel-glass,
.dash-groups,
.dash-top-items,
.dash-sellers,
.dash-charts > .dash-panel,
.dash-margins .dash-panel {
  border-radius: var(--radius) !important;
  border: 1px solid var(--line) !important;
  background: #ffffff !important;
  box-shadow: var(--shadow-sm) !important;
  backdrop-filter: none !important;
}

.dash-panel-glass::before,
.dash-panel-glass::after {
  display: none !important;
}

.dash-panel-head {
  border-bottom: 1px solid var(--line) !important;
  padding: 0.55rem 0.85rem !important;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfd 100%) !important;
}

.dash-panel-head h3,
.dash-branches-title h3,
.dash-sellers-title h3 {
  margin: 0;
  font-family: var(--font) !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em;
  color: #0e7490 !important;
}

/* بطاقات التفاصيل — خلفية ملونة ونص واضح */
.page.sales-dash .dash-panel.dash-panel-glass {
  overflow: hidden;
}

.page.sales-dash .dash-branches {
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
}
.page.sales-dash .dash-branches .dash-panel-head {
  background: #f7fcfd !important;
  border-bottom-color: var(--line) !important;
}
.page.sales-dash .dash-branches .dash-panel-head h3 { color: #0891b2 !important; }
.page.sales-dash .dash-branches .result-pill {
  background: #0891b2 !important;
  border-color: #0e7490 !important;
  color: #e8f4fb !important;
}

.page.sales-dash .dash-groups {
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
}
.page.sales-dash .dash-groups .dash-panel-head {
  background: #f7fcfd !important;
  border-bottom-color: var(--line) !important;
}
.page.sales-dash .dash-groups .dash-panel-head h3 { color: #065f46 !important; }
.page.sales-dash .dash-groups .result-pill {
  background: #0f7a6b !important;
  border-color: #0c5f54 !important;
  color: #e8faf6 !important;
}
.page.sales-dash .dash-groups .dash-branches-sub {
  color: #147a4d !important;
}

.page.sales-dash .dash-top-items {
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
}
.page.sales-dash .dash-top-items .dash-panel-head {
  background: #f7fcfd !important;
  border-bottom-color: var(--line) !important;
}
.page.sales-dash .dash-top-items .dash-panel-head h3 { color: #166534 !important; }
.page.sales-dash .dash-top-items .result-pill {
  background: #15803d !important;
  border-color: #166534 !important;
  color: #ecfdf5 !important;
}

/* نفس أبعاد لوحة البائعين */
.page.sales-dash .dash-top-items .seller-board,
.page.sales-dash .dash-sellers .seller-board {
  width: 100% !important;
  min-height: 32rem !important;
  max-height: 32rem !important;
  padding: 0.7rem 0.75rem 0.85rem !important;
  gap: 0.5rem !important;
  box-sizing: border-box !important;
}

.page.sales-dash .dash-top-items .seller-card {
  padding: 0.75rem 0.85rem !important;
  border-radius: 14px !important;
}

.page.sales-dash .dash-sellers {
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
}
.page.sales-dash .dash-sellers .dash-panel-head {
  background: #f7fcfd !important;
  border-bottom-color: var(--line) !important;
}
.page.sales-dash .dash-sellers .dash-panel-head h3 { color: #0e7490 !important; }
.page.sales-dash .dash-sellers .result-pill {
  background: #0891b2 !important;
  border-color: #0e7490 !important;
  color: #f7fcfd !important;
}

.page.sales-dash .dash-branch-chart {
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
}
.page.sales-dash .dash-branch-chart .dash-panel-head {
  background: #f7fcfd !important;
  border-bottom-color: var(--line) !important;
}
.page.sales-dash .dash-branch-chart .dash-panel-head h3 { color: #92400e !important; }
.page.sales-dash .dash-branch-chart .result-pill {
  background: #b45309 !important;
  border-color: #92400e !important;
  color: #fffbeb !important;
}

.page.sales-dash .dash-chart-items {
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
}
.page.sales-dash .dash-chart-items .dash-panel-head {
  background: #f7fcfd !important;
  border-bottom-color: var(--line) !important;
}
.page.sales-dash .dash-chart-items .dash-panel-head h3 { color: #991b1b !important; }
.page.sales-dash .dash-chart-items .result-pill {
  background: #b91c1c !important;
  border-color: #991b1b !important;
  color: #fef2f2 !important;
}

.page.sales-dash .dash-returns-pair .dash-group-returns {
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
}

.page.sales-dash .dash-returns-pair #chart-items-board {
  min-height: 32rem !important;
  max-height: 32rem !important;
  width: 100% !important;
  padding: 0.7rem 0.75rem 0.85rem !important;
  gap: 0.5rem !important;
}

.page.sales-dash .dash-margins > .dash-panel:first-child {
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
}
.page.sales-dash .dash-margins > .dash-panel:first-child .dash-panel-head {
  background: #f7fcfd !important;
  border-bottom-color: var(--line) !important;
}
.page.sales-dash .dash-margins > .dash-panel:first-child .dash-panel-head h3 { color: #0e7490 !important; }
.page.sales-dash .dash-margins > .dash-panel:first-child .result-pill {
  background: #0891b2 !important;
  border-color: #0e7490 !important;
  color: #ecfeff !important;
}

.page.sales-dash .dash-margins-branches {
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
}
.page.sales-dash .dash-margins-branches .dash-panel-head {
  background: #f7fcfd !important;
  border-bottom-color: var(--line) !important;
}
.page.sales-dash .dash-margins-branches .dash-panel-head h3 { color: #0e7490 !important; }
.page.sales-dash .dash-margins-branches .result-pill {
  background: #0891b2 !important;
  border-color: #0e7490 !important;
  color: #ecfeff !important;
}

.page.sales-dash .dash-margins > .dash-panel:last-child {
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
}
.page.sales-dash .dash-margins > .dash-panel:last-child .dash-panel-head {
  background: #f7fcfd !important;
  border-bottom-color: var(--line) !important;
}
.page.sales-dash .dash-margins > .dash-panel:last-child .dash-panel-head h3 { color: #5b21b6 !important; }
.page.sales-dash .dash-margins > .dash-panel:last-child .result-pill {
  background: #6d28d9 !important;
  border-color: #5b21b6 !important;
  color: #f5f3ff !important;
}

/* جداول داخل البطاقات الملونة — واضحة القراءة */
.page.sales-dash .dash-panel-glass .table-wrap,
.page.sales-dash .dash-panel-glass .seller-board,
.page.sales-dash .dash-panel-glass .branch-chart,
.page.sales-dash .dash-panel-glass .top20-chart,
.page.sales-dash .dash-panel-glass .margin-table-block,
.page.sales-dash .dash-panel-glass .margin-totals {
  background: #ffffff !important;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  width: 100%;
  min-width: 0;
}

.page.sales-dash .dash-panel-glass .data-table th {
  background: #eef8fa !important;
  color: #6b858f !important;
  border-bottom: 1px solid #d7e8ec !important;
}

/* مخزون: رأس أعمدة ثابت — Aqua Mist */
.page.sales-dash.inv-dash .inv-table-scroll {
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
}

.page.sales-dash.inv-dash .inv-table-scroll thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
  background: #eef8fa !important;
  color: #0e7490 !important;
  font-family: var(--font) !important;
  font-weight: 800 !important;
  font-size: 0.76rem !important;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 0 #d7e8ec;
}

.page.sales-dash.inv-dash .inv-table-scroll thead th.inv-col-qty {
  background: #ecfdf5 !important;
  color: #047857 !important;
}

.page.sales-dash.inv-dash .inv-table-scroll thead th.inv-col-cost {
  background: #fffbeb !important;
  color: #b45309 !important;
}

/* ميزان المراجعة: رأس أعمدة ثابت — خلفية معتمة بالكامل (ليست شفافة الزجاج) */
.page.sales-dash.trial-balance-dash .tb-main-scroll thead th,
.page.sales-dash.trial-balance-dash .dash-panel-glass .tb-income-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 8 !important;
  background: #eef8fa !important;
  background-color: #eef8fa !important;
  background-image: none !important;
  color: #0e7490 !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 1px 0 #d7e8ec;
}

.page.sales-dash.inv-dash .inv-table-scroll thead th.inv-col-share {
  background: #ecfeff !important;
  color: #0891b2 !important;
}

.page.sales-dash.inv-dash .inv-table-scroll thead th.inv-col-sticky {
  z-index: 7 !important;
  background: #eef8fa !important;
}

/* نظرة عامة للمبيعات: رؤوس أعمدة ثابتة عند التمرير داخل الجدول */
.page.sales-dash.sales-overview-dash .sales-ov-scroll {
  max-height: 22rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.page.sales-dash.sales-overview-dash .sales-ov-groups .sales-ov-scroll,
.page.sales-dash.sales-overview-dash .sales-ov-items .sales-ov-scroll,
.page.sales-dash.sales-overview-dash .sales-ov-users .sales-ov-scroll,
.page.sales-dash.sales-overview-dash .sales-ov-activity .sales-ov-scroll {
  max-height: none;
  height: 22rem;
}

/* رأس ملون يبقى ثابتاً عند التمرير */
.page.sales-dash.sales-overview-dash .sales-ov-scroll thead th.sales-col-amt {
  background: #ecfdf5 !important;
  color: #047857 !important;
}
.page.sales-dash.sales-overview-dash .sales-ov-scroll thead th.sales-col-cost {
  background: #fffbeb !important;
  color: #b45309 !important;
}
.page.sales-dash.sales-overview-dash .sales-ov-scroll thead th.sales-col-share {
  background: #ecfeff !important;
  color: #0891b2 !important;
}

.page.sales-dash.sales-overview-dash .sales-ov-scroll::after {
  display: none;
}

.page.sales-dash.sales-overview-dash .sales-ov-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef8fa !important;
  color: #0e7490 !important;
  font-family: var(--font) !important;
  font-weight: 800 !important;
  white-space: nowrap;
  box-shadow: 0 1px 0 #d7e8ec;
}

.page.sales-dash.sales-overview-dash .sales-ov-scroll tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 4;
  background: #0e7490 !important;
  color: #fff !important;
  box-shadow: 0 -1px 0 #155e75;
}

.page.sales-dash.sales-overview-dash .sales-ov-scroll tfoot .sales-amt {
  background: #155e75 !important;
  color: #fff !important;
}

.page.sales-dash .dash-panel-glass .data-table td {
  color: var(--ink) !important;
}

.page.sales-dash .dash-panel-glass .data-table tbody tr:nth-child(even) td {
  background: #f7fcfd !important;
}

.page.sales-dash .dash-panel-glass .data-table tbody tr:hover td {
  background: #ecfeff !important;
}

/* مخزون: عمود الاسم الثابت معتم بالكامل — لا شفافية */
.page.sales-dash.inv-dash .inv-table-scroll tbody td.inv-col-sticky,
.page.sales-dash.inv-dash .inv-table-scroll tbody td.inv-col-sticky.inv-cell-clip {
  background: #ffffff !important;
  opacity: 1 !important;
}

.page.sales-dash.inv-dash .inv-table-scroll tbody tr:nth-child(even) td.inv-col-sticky,
.page.sales-dash.inv-dash .inv-table-scroll tbody tr:nth-child(even) td.inv-col-sticky.inv-cell-clip {
  background: #f7fcfd !important;
}

.page.sales-dash.inv-dash .inv-table-scroll tbody tr:hover td.inv-col-sticky,
.page.sales-dash.inv-dash .inv-table-scroll tbody tr:hover td.inv-col-sticky.inv-cell-clip {
  background: #ecfeff !important;
}

.page.sales-dash .dash-panel-glass .sales-grand-row td {
  background: #0e7490 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 0.88rem !important;
  padding: 0.48rem 0.45rem !important;
  border-top: 2px solid #155e75 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  width: 1% !important;
  box-shadow: 0 -4px 12px rgba(8, 145, 178, 0.18);
}

.page.sales-dash .dash-panel-glass .sales-grand-row td:first-child {
  width: auto !important;
  max-width: none;
}

.page.sales-dash .dash-panel-glass .sales-grand-row .sales-amt,
.page.sales-dash .dash-panel-glass .sales-grand-row .sales-amt-net,
.page.sales-dash .dash-panel-glass .sales-grand-row .sales-amt-gross,
.page.sales-dash .dash-panel-glass .sales-grand-row .sales-amt-avg,
.page.sales-dash .dash-panel-glass .sales-grand-row .mono,
.page.sales-dash .dash-panel-glass .sales-grand-row .money,
.page.sales-dash .dash-panel-glass .sales-grand-row .sar-symbol {
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: inherit !important;
  white-space: nowrap !important;
  letter-spacing: 0;
  width: max-content !important;
  max-width: none;
}

.page.sales-dash .dash-panel-glass .sales-grand-row .sales-amt-net {
  color: #a7f3d0 !important;
}

.page.sales-dash .dash-panel-glass .sales-grand-row .sales-amt-gross,
.page.sales-dash .dash-panel-glass .sales-grand-row .sales-amt-avg {
  color: #fecaca !important;
}

.page.sales-dash .dash-panel-glass .seller-card {
  background: rgba(255, 255, 255, 0.88) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

.page.sales-dash .dash-panel-glass .sales-empty,
.page.sales-dash .dash-panel-glass .dash-loading {
  color: var(--ink-soft) !important;
}

.page.sales-dash .dash-panel-glass .dash-sellers-mark,
.page.sales-dash .dash-panel-glass .dash-items-mark {
  box-shadow: none !important;
}

.dash-tabs {
  gap: 0.5rem;
}

.dash-tab {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  background: #fff !important;
  color: var(--ink-soft) !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.dash-tab span,
.dash-tab .mono,
.dash-tab .money {
  color: var(--brand) !important;
  font-weight: 700 !important;
}

.dash-tab:hover {
  background: var(--brand-soft) !important;
  border-color: #9fc0d4 !important;
  color: var(--brand-dark) !important;
}

.dash-tab:hover span,
.dash-tab:hover .mono,
.dash-tab:hover .money {
  color: var(--brand-dark) !important;
}

.dash-tab.is-active {
  background: var(--brand) !important;
  border-color: var(--brand-dark) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.22) !important;
}

.dash-tab.is-active span,
.dash-tab.is-active .mono,
.dash-tab.is-active .money,
.dash-tab.is-active .sar-symbol {
  color: #e8f4fb !important;
}

.page.sales-dash .dash-analysis-tabs {
  border-color: var(--line) !important;
  background: linear-gradient(180deg, #fff 0%, var(--bg-soft) 100%) !important;
  border-radius: var(--radius-sm) !important;
}

.page.sales-dash .dash-analysis-tab {
  color: var(--ink-soft) !important;
  font-weight: 700 !important;
}

.page.sales-dash .dash-analysis-tab:hover {
  background: var(--brand-soft) !important;
  color: var(--brand-dark) !important;
}

.page.sales-dash .dash-analysis-tab.is-active {
  background: #fff !important;
  border-color: var(--line) !important;
  color: var(--brand) !important;
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.1) !important;
}

.page.sales-dash .dash-overview-stack,
.page.sales-dash .dash-returns-stack {
  gap: 0.95rem;
}

.result-pill {
  border-radius: var(--radius-sm) !important;
  background: #ecfeff !important;
  border: 1px solid #a5f3fc !important;
  color: #0e7490 !important;
  font-family: var(--mono) !important;
  font-variant-numeric: tabular-nums;
  font-weight: 800 !important;
  font-size: 0.72rem !important;
  box-shadow: none !important;
}

/* —— Tables · Aqua Mist unified —— */
.data-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.data-table th {
  background: #eef8fa !important;
  color: #0e7490 !important;
  font-family: var(--font) !important;
  font-weight: 800 !important;
  font-size: 0.76rem !important;
  line-height: 1.25 !important;
  padding: 0.5rem 0.48rem !important;
  border-bottom: 1px solid #d7e8ec !important;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.data-table td {
  border-bottom: 1px solid #eef8fa !important;
  color: var(--ink);
  font-family: var(--font) !important;
  padding: 0.45rem 0.48rem !important;
  font-size: 0.84rem !important;
  line-height: 1.35;
  font-weight: 600;
}

.data-table tbody tr:nth-child(even) td {
  background: #f7fcfd !important;
}

.data-table tbody tr:hover td {
  background: #ecfeff !important;
}

.data-table .mono,
.data-table .money,
.data-table .sales-amt,
.data-table .inv-value,
.data-table .inv-share {
  font-family: var(--mono) !important;
  font-variant-numeric: tabular-nums;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
  text-align: end;
}

.sales-grand-row td {
  background: #0e7490 !important;
  font-weight: 800 !important;
  color: #fff !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  font-size: 0.88rem !important;
  width: 1%;
  padding-inline: 0.45rem !important;
}

.sales-grand-row td:first-child {
  width: auto !important;
}

.sales-grand-row .sales-amt,
.sales-grand-row .mono,
.sales-grand-row .money,
.sales-grand-row .sar-symbol {
  color: #fff !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  width: max-content;
}

.sales-grand-row .sales-amt-net {
  color: #a7f3d0 !important;
  font-weight: 800 !important;
}

.sales-grand-row .sales-amt-gross,
.sales-grand-row .sales-amt-avg {
  color: #fecaca !important;
  font-weight: 800 !important;
}

/* أعمدة الأرقام مرنة: تتقلص/تتسع حسب طول الرقم */
.page.sales-dash .sales-table,
.page.sales-dash .cashier-bills-table,
.inv-dash .sales-table:not(.inv-table-compact),
.purchase-dash .sales-table,
.page.sales-dash .dash-margins .margin-scroll .sales-table {
  table-layout: auto !important;
  width: max-content !important;
  min-width: 100% !important;
  max-width: none !important;
}

.page.sales-dash .sales-table th,
.page.sales-dash .sales-table td,
.page.sales-dash .cashier-bills-table th,
.page.sales-dash .cashier-bills-table td,
.inv-dash .sales-table:not(.inv-table-compact) th,
.inv-dash .sales-table:not(.inv-table-compact) td,
.purchase-dash .sales-table th,
.purchase-dash .sales-table td,
.page.sales-dash .dash-margins .sales-table th,
.page.sales-dash .dash-margins .sales-table td {
  max-width: none !important;
  box-sizing: border-box;
}

/* خلايا الأرقام: عرض = المحتوى فقط */
.page.sales-dash .sales-table .sales-amt,
.page.sales-dash .sales-table td.mono,
.page.sales-dash .sales-table th.mono,
.page.sales-dash .cashier-bills-table .sales-amt,
.page.sales-dash .cashier-bills-table td.mono,
.inv-dash .sales-table:not(.inv-table-compact) .sales-amt,
.inv-dash .sales-table:not(.inv-table-compact) td.mono,
.inv-dash .sales-table:not(.inv-table-compact) .inv-value,
.inv-dash .sales-table:not(.inv-table-compact) .inv-share,
.purchase-dash .sales-table .sales-amt,
.purchase-dash .sales-table td.mono,
.page.sales-dash .dash-margins .sales-table .sales-amt,
.page.sales-dash .dash-margins .sales-table td.mono,
.page.sales-dash .dash-margins .sales-table th:nth-child(n + 3) {
  width: 1% !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  padding-inline: 0.35rem !important;
}

.page.sales-dash .sales-table .sales-amt .money,
.page.sales-dash .sales-table td.mono .money,
.page.sales-dash .dash-margins .sales-table .money,
.page.sales-dash .sales-grand-row .money {
  display: inline-flex !important;
  align-items: center;
  gap: 0.15rem;
  width: max-content !important;
  white-space: nowrap !important;
}

/* عمود الاسم يتمدد؛ الأرقام تبقى ضيقة حسب المحتوى */
.page.sales-dash .sales-table th:nth-child(2),
.page.sales-dash .sales-table td:nth-child(2),
.inv-dash .sales-table:not(.inv-table-compact) th:nth-child(2),
.inv-dash .sales-table:not(.inv-table-compact) td:nth-child(2),
.page.sales-dash .dash-margins .sales-table th:nth-child(2),
.page.sales-dash .dash-margins .sales-table td:nth-child(2) {
  width: auto !important;
  min-width: 5.5rem;
  white-space: normal;
}

.page.sales-dash .sales-table th:first-child,
.page.sales-dash .sales-table td:first-child,
.page.sales-dash .dash-margins .sales-table th:first-child,
.page.sales-dash .dash-margins .sales-table td:first-child {
  width: 1% !important;
  white-space: nowrap !important;
}

/* ألغي نسب الأعمدة الثابتة في الهامش */
.page.sales-dash .dash-margins .m-col-idx,
.page.sales-dash .dash-margins .m-col-name,
.page.sales-dash .dash-margins .m-col-num,
.page.sales-dash .dash-margins colgroup .m-col-num:nth-child(6) {
  width: auto !important;
}

.page.sales-dash .dash-main-col .table-wrap,
.page.sales-dash .dash-groups .table-wrap {
  max-height: calc(2.15rem + (19 * 1.9rem) + 2.65rem) !important;
}

.page.sales-dash .dash-main-col .table-wrap thead th,
.page.sales-dash .dash-groups .table-wrap thead th,
.page.sales-dash .dash-margins .margin-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef8fa !important;
  color: var(--ink-soft) !important;
  font-weight: 800 !important;
  white-space: nowrap;
}

.page.sales-dash .dash-main-col .table-wrap tfoot td,
.page.sales-dash .dash-groups .table-wrap tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 4;
}

.page.sales-dash .dash-margins .margin-scroll {
  max-height: calc(2.2rem + (19 * 2.05rem) + 2.55rem) !important;
}

.page.sales-dash .dash-margins .margin-scroll tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 4;
}

/* إجمالي الهامش داخل tfoot — نفس صف إجمالي المجموعات */
.page.sales-dash .dash-margins .margin-scroll .sales-grand-row td {
  background: #0891b2 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 0.88rem !important;
  padding: 0.4rem 0.35rem !important;
  border-top: 2px solid #0e7490 !important;
  border-bottom: 0 !important;
  border-inline-start: none !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  width: 1% !important;
  box-shadow: 0 -4px 12px rgba(8, 145, 178, 0.18);
}

.page.sales-dash .dash-margins .margin-scroll .sales-grand-row td:first-child {
  width: auto !important;
}

.page.sales-dash .dash-margins .margin-scroll .sales-grand-row .sales-amt,
.page.sales-dash .dash-margins .margin-scroll .sales-grand-row .mono,
.page.sales-dash .dash-margins .margin-scroll .sales-grand-row .money,
.page.sales-dash .dash-margins .margin-scroll .sales-grand-row .sar-symbol {
  color: #ffffff !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  width: max-content !important;
}

.page.sales-dash .dash-margins .margin-scroll .sales-grand-row .sales-amt-net {
  color: #a7f3d0 !important;
}

.page.sales-dash .dash-margins .margin-scroll .sales-grand-row .margin-cost,
.page.sales-dash .dash-margins .margin-scroll .sales-grand-row .sales-amt-gross {
  color: #fecaca !important;
}

.page.sales-dash .dash-margins .margin-scroll .sales-grand-row .is-up {
  color: #a7f3d0 !important;
}

.page.sales-dash .dash-margins .margin-scroll .sales-grand-row .is-down {
  color: #fecaca !important;
}

.page.sales-dash .sales-grand-row td {
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  padding-block: 0.4rem !important;
  padding-inline: 0.35rem !important;
  width: 1% !important;
  white-space: nowrap !important;
}

.page.sales-dash .sales-grand-row td:first-child,
.page.sales-dash .dash-panel-glass .sales-grand-row td:first-child {
  width: auto !important;
}

/* مخزون: صف الإجمالي خارج التمرير — كل الخلايا ثابتة */
.inv-dash .inv-table-scroll {
  max-height: calc(1.95rem + (19 * 1.85rem) + 2.5rem) !important;
}

.page.sales-dash.inv-dash .inv-table-foot,
.page.sales-dash.inv-dash .inv-table-foot .sales-grand-row td {
  background: #0e7490 !important;
}

.page.sales-dash.inv-dash .inv-table-foot .sales-grand-row td {
  position: static !important;
  bottom: auto !important;
  z-index: auto !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 0.78rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-shadow: none !important;
  opacity: 1 !important;
  background: #0e7490 !important;
}

.page.sales-dash.inv-dash .inv-table-foot .sales-grand-row td.mono:not(.inv-col-qty):not(.inv-col-cost):not(.inv-col-share) {
  color: #fff !important;
  background: #0e7490 !important;
}

.page.sales-dash.inv-dash .inv-table-foot .sales-grand-row td.inv-col-qty {
  color: #047857 !important;
  background: #ecfdf5 !important;
}

.page.sales-dash.inv-dash .inv-table-foot .sales-grand-row td.inv-col-cost {
  color: #b45309 !important;
  background: #fffbeb !important;
}

.page.sales-dash.inv-dash .inv-table-foot .sales-grand-row td.inv-col-share {
  color: #0891b2 !important;
  background: #ecfeff !important;
}

/* مخزون: رأس اللوحة + أرقام الجداول المدمجة — تناسب Aqua Mist */
.inv-dash .inv-panel-compact .dash-panel-head {
  padding: 0.55rem 0.75rem !important;
  border-bottom: 1px solid var(--line) !important;
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfd 100%) !important;
}

.inv-dash .inv-panel-compact .dash-panel-head h3 {
  font-family: var(--font) !important;
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  color: #0e7490 !important;
  letter-spacing: -0.01em;
}

.inv-dash .inv-panel-compact .result-pill {
  background: #ecfeff !important;
  color: #0e7490 !important;
  border: 1px solid #a5f3fc !important;
  font-family: var(--mono) !important;
  font-variant-numeric: tabular-nums;
  font-weight: 800 !important;
  font-size: 0.72rem !important;
}

.inv-dash .inv-table-compact th,
.inv-dash .inv-table-compact td {
  font-family: var(--font) !important;
  font-size: 0.78rem !important;
  line-height: 1.3 !important;
  padding: 0.34rem 0.45rem !important;
}

.inv-dash .inv-table-compact td.mono,
.inv-dash .inv-table-compact .inv-col-qty,
.inv-dash .inv-table-compact .inv-col-cost,
.inv-dash .inv-table-compact .inv-col-share {
  font-family: var(--mono) !important;
  font-variant-numeric: tabular-nums;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

.inv-dash .inv-table-compact td.inv-col-qty {
  color: #047857 !important;
}
.inv-dash .inv-table-compact td.inv-col-cost {
  color: #92400e !important;
}
.inv-dash .inv-table-compact td.inv-col-share {
  color: #0891b2 !important;
}

.inv-dash .inv-table-compact tbody tr:nth-child(even) td {
  background: #f7fcfd !important;
}
.inv-dash .inv-table-compact tbody tr:hover td {
  background: #ecfeff !important;
}

.sales-num-btn {
  border-radius: 6px !important;
  border-color: var(--line) !important;
  background: #fff !important;
  color: var(--brand) !important;
  font-weight: 700 !important;
}

.sales-amt-net {
  color: var(--accent) !important;
  font-weight: 700 !important;
}

/* —— Seller / item cards —— */
.seller-card {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: #fff !important;
  box-shadow: none !important;
}

.seller-card:hover {
  border-color: #b6cfe0 !important;
  box-shadow: var(--shadow-sm) !important;
}

.seller-fill {
  background: linear-gradient(90deg, var(--brand-mid), var(--accent)) !important;
}

.seller-rank {
  background: var(--brand-soft) !important;
  color: var(--brand-dark) !important;
}

/* —— Charts —— */
.branch-chart .bar-fill,
.top20-chart .bar-fill {
  background: linear-gradient(90deg, var(--brand-mid), var(--accent)) !important;
}

/* —— Progress —— */
.dash-loading {
  color: var(--brand) !important;
}

.dash-load-track {
  background: #e8eef3 !important;
}

.dash-load-fill {
  background: linear-gradient(90deg, var(--brand), var(--accent)) !important;
}

.dash-load-pct {
  color: var(--brand-dark) !important;
}

/* —— Alerts —— */
.alert {
  border-radius: var(--radius) !important;
  border-width: 1px !important;
  box-shadow: none !important;
}

.alert-error {
  background: var(--danger-bg) !important;
  border-color: #fecaca !important;
  color: var(--danger) !important;
}

/* —— Login —— */
body.login-body {
  background:
    radial-gradient(ellipse 70% 55% at 100% -5%, rgba(15, 122, 107, 0.1), transparent 52%),
    radial-gradient(ellipse 55% 45% at -8% 105%, rgba(8, 145, 178, 0.1), transparent 50%),
    linear-gradient(165deg, #ffffff 0%, #f4f7fa 48%, #eef4f8 100%) !important;
}

.login-page {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100dvh;
}

.login-welcome {
  background: #ffffff !important;
  color: var(--brand-dark) !important;
}

.login-brand {
  color: var(--brand-dark) !important;
  font-weight: 800 !important;
}

.login-hello {
  color: var(--brand) !important;
}

.login-lead {
  color: var(--muted) !important;
}

.login-panel {
  border: 0 !important;
  border-radius: 0 !important;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(232, 242, 247, 0.9), transparent 60%),
    #f7fafc !important;
  color: var(--ink) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.login-card {
  background: #ffffff !important;
  border-color: rgba(8, 145, 178, 0.1) !important;
}

.login-panel-title {
  color: var(--brand-dark) !important;
}

.login-tagline {
  color: var(--muted) !important;
  font-weight: 600 !important;
}

.login-panel label {
  color: var(--brand-dark) !important;
}

.login-form input {
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

.login-form input:focus {
  border-color: var(--brand-mid) !important;
  box-shadow: 0 0 0 4px rgba(21, 96, 137, 0.16) !important;
}

.login-submit {
  background: linear-gradient(135deg, var(--brand-mid) 0%, var(--brand) 55%, var(--brand-dark) 100%) !important;
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 26px rgba(8, 145, 178, 0.22) !important;
  font-weight: 800 !important;
}

.login-submit:hover {
  filter: brightness(1.06) !important;
}

.login-orb,
.login-grid {
  display: none;
}

@media (max-width: 900px) {
  .login-panel {
    background: #ffffff !important;
  }

  .login-card {
    border-radius: 1.35rem 1.35rem 0 0 !important;
    border: 0 !important;
  }
}

@media (max-width: 900px) and (max-height: 560px) and (orientation: landscape) {
  .login-panel {
    background: #f7fafc !important;
  }

  .login-card {
    border-radius: 14px !important;
    border: 1px solid rgba(8, 145, 178, 0.1) !important;
  }
}

/* —— Sales / inventory canvas —— */
body.sales-dash-body,
body.inv-dash-body {
  background:
    radial-gradient(ellipse 70% 40% at 100% 0%, rgba(15, 122, 107, 0.05), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}

body.sales-dash-body.welcome-body {
  background:
    radial-gradient(ellipse 70% 40% at 100% 0%, rgba(15, 122, 107, 0.05), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}

.welcome-dash .welcome-hero {
  border-color: var(--line) !important;
  background:
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(15, 122, 107, 0.07), transparent 52%),
    radial-gradient(ellipse 55% 40% at 0% 0%, rgba(8, 145, 178, 0.06), transparent 48%),
    #fff !important;
  color: var(--ink) !important;
  box-shadow: var(--shadow-sm) !important;
}

.welcome-title {
  color: var(--brand-dark) !important;
}

.welcome-kicker,
.welcome-name {
  color: var(--brand) !important;
}

.welcome-greeting,
.welcome-sub {
  color: var(--ink-soft) !important;
}

.welcome-role {
  color: var(--brand-dark) !important;
  background: var(--brand-soft) !important;
  border-color: #c5dde8 !important;
}

.welcome-card {
  border-color: var(--line) !important;
  background: #fff !important;
  box-shadow: var(--shadow-sm) !important;
}

.welcome-card::before {
  background: var(--brand-mid) !important;
}

.welcome-card strong {
  color: var(--brand-dark) !important;
}

.welcome-card > span:last-child {
  color: var(--muted) !important;
}

.welcome-card-ico {
  color: #fff !important;
  background: var(--brand) !important;
}

.welcome-card--sales {
  background: #ecfeff !important;
  border-color: #d7e8ec !important;
}
.welcome-card--sales::before { background: #06b6d4 !important; }
.welcome-card--sales .welcome-card-ico { background: #06b6d4 !important; }
.welcome-card--sales strong { color: #0e7490 !important; }

.welcome-card--perf {
  background: #ecfeff !important;
  border-color: #cffafe !important;
}
.welcome-card--perf::before { background: #06b6d4 !important; }
.welcome-card--perf .welcome-card-ico { background: #06b6d4 !important; }
.welcome-card--perf strong { color: #0e7490 !important; }

.welcome-card--inv {
  background: #ffedd5 !important;
  border-color: #fdba74 !important;
}
.welcome-card--inv::before { background: #d97706 !important; }
.welcome-card--inv .welcome-card-ico { background: #d97706 !important; }
.welcome-card--inv strong { color: #9a3412 !important; }

.welcome-card--purch {
  background: #e0f7fa !important;
  border-color: #d7e8ec !important;
}
.welcome-card--purch::before { background: #0891b2 !important; }
.welcome-card--purch .welcome-card-ico { background: #0891b2 !important; }
.welcome-card--purch strong { color: #115e59 !important; }

.welcome-card--income {
  background: #d1fae5 !important;
  border-color: #6ee7b7 !important;
}
.welcome-card--income::before { background: #15803d !important; }
.welcome-card--income .welcome-card-ico { background: #15803d !important; }
.welcome-card--income strong { color: #14532d !important; }

.welcome-card--search {
  background: #e0e7ff !important;
  border-color: #a5b4fc !important;
}
.welcome-card--search::before { background: #4f46e5 !important; }
.welcome-card--search .welcome-card-ico { background: #4f46e5 !important; }
.welcome-card--search strong { color: #312e81 !important; }

body.sales-dash-body .app-backdrop,
body.inv-dash-body .app-backdrop {
  opacity: 0.55;
}

.mono,
.dash-kpi-value.mono,
.dash-kpi-hint.mono {
  font-family: var(--mono) !important;
  font-variant-numeric: tabular-nums;
}

/* —— Inventory KPI: ملونة + نص واضح —— */
.inv-dash .dash-kpi-card.dash-kpi-glass::before,
.inv-dash .inv-kpi-card::before,
.inv-dash .inv-summary-scope::before {
  display: none !important;
}

.inv-dash .inv-top > .dash-kpi-card,
.inv-dash .inv-kpi-grid > .dash-kpi-card {
  box-shadow: var(--shadow-sm) !important;
}

.inv-dash .inv-summary-scope {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.inv-dash .inv-summary-scope-label { color: #06b6d4 !important; font-weight: 700 !important; }
.inv-dash .inv-summary-scope-title { color: #0891b2 !important; font-weight: 800 !important; }
.inv-dash .inv-summary-scope .dash-kpi-ico {
  background: linear-gradient(145deg, #22d3ee, #0891b2) !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(8, 145, 178, 0.26) !important;
  width: 1.55rem !important;
  height: 1.55rem !important;
  border-radius: 9px !important;
}

.inv-dash .inv-hl-wh {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.inv-dash .inv-hl-wh .dash-kpi-label { color: #147a4d !important; }
.inv-dash .inv-hl-wh .inv-hl-name { color: #065f3a !important; }
.inv-dash .inv-hl-wh .dash-kpi-value { color: #065f3a !important; }
.inv-dash .inv-hl-wh .dash-kpi-hint { color: #1a8a58 !important; }

.inv-dash .inv-hl-group {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.inv-dash .inv-hl-group .dash-kpi-label { color: #0891b2 !important; }
.inv-dash .inv-hl-group .inv-hl-name { color: #115e59 !important; }
.inv-dash .inv-hl-group .dash-kpi-value { color: #115e59 !important; }
.inv-dash .inv-hl-group .dash-kpi-hint { color: #06b6d4 !important; }

.inv-dash .inv-hl-branch {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.inv-dash .inv-hl-branch .dash-kpi-label { color: #b45309 !important; }
.inv-dash .inv-hl-branch .inv-hl-name { color: #92400e !important; }
.inv-dash .inv-hl-branch .dash-kpi-value { color: #92400e !important; }
.inv-dash .inv-hl-branch .dash-kpi-hint { color: #c27803 !important; }

.inv-dash .inv-kpi-value {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.inv-dash .inv-kpi-value .dash-kpi-label { color: #0891b2 !important; }
.inv-dash .inv-kpi-value .dash-kpi-value { color: #115e59 !important; }
.inv-dash .inv-kpi-value .dash-kpi-hint { color: #06b6d4 !important; }

.inv-dash .inv-kpi-qty {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.inv-dash .inv-kpi-qty .dash-kpi-label { color: #06b6d4 !important; }
.inv-dash .inv-kpi-qty .dash-kpi-value { color: #0891b2 !important; }
.inv-dash .inv-kpi-qty .dash-kpi-hint { color: #1a6fa0 !important; }

.inv-dash .inv-kpi-rows {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.inv-dash .inv-kpi-rows .dash-kpi-label { color: #0891b2 !important; }
.inv-dash .inv-kpi-rows .dash-kpi-value { color: #0e7490 !important; }
.inv-dash .inv-kpi-rows .dash-kpi-hint { color: #06b6d4 !important; }

.inv-dash .inv-kpi-scope {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.inv-dash .inv-kpi-scope .dash-kpi-label { color: #b45309 !important; }
.inv-dash .inv-kpi-scope .dash-kpi-value { color: #92400e !important; }
.inv-dash .inv-kpi-scope .dash-kpi-hint { color: #c27803 !important; }

.inv-dash .inv-kpi-card .dash-kpi-ico,
.inv-dash .inv-hl-wh .dash-kpi-ico,
.inv-dash .inv-hl-group .dash-kpi-ico,
.inv-dash .inv-hl-branch .dash-kpi-ico {
  color: #fff !important;
  width: 1.55rem !important;
  height: 1.55rem !important;
  border-radius: 9px !important;
  box-shadow: 0 3px 10px rgba(8, 145, 178, 0.2) !important;
}

.inv-dash .inv-hl-wh .dash-kpi-ico,
.inv-dash .inv-kpi-ico-qty {
  background: linear-gradient(145deg, #34d399, #059669) !important;
  color: #fff !important;
}
.inv-dash .inv-hl-group .dash-kpi-ico,
.inv-dash .inv-kpi-ico-rows {
  background: linear-gradient(145deg, #22d3ee, #0891b2) !important;
  color: #fff !important;
}
.inv-dash .inv-hl-branch .dash-kpi-ico,
.inv-dash .inv-kpi-ico-scope {
  background: linear-gradient(145deg, #fbbf24, #b45309) !important;
  color: #fff !important;
}
.inv-dash .inv-kpi-ico-value {
  background: linear-gradient(145deg, #2dd4bf, #0e7490) !important;
  color: #fff !important;
}

.inv-dash .inv-top > .dash-kpi-card:hover,
.inv-dash .inv-kpi-grid > .dash-kpi-card:hover {
  filter: saturate(1.06);
  transform: translateY(-2px);
}

.inv-kpi-grid {
  gap: 0.85rem;
}

.inv-select-trigger {
  border-radius: var(--radius-sm) !important;
  border-color: var(--line-strong) !important;
  background: #fff !important;
}

.inv-select-option.is-selected {
  background: var(--brand-soft) !important;
  color: var(--brand-dark) !important;
}

/* —— Income KPI: ملونة + نص واضح —— */
.income-dash .income-kpi.dash-kpi-card::before,
.income-dash .income-kpi.dash-kpi-glass::before {
  display: none !important;
}

.income-dash .income-kpi {
  box-shadow: var(--shadow-sm) !important;
}

.income-dash .income-kpi-rev {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
  box-shadow: var(--shadow-sm) !important;
}
.income-dash .income-kpi-rev .dash-kpi-label { color: #147a4d !important; }
.income-dash .income-kpi-rev .dash-kpi-value { color: #065f3a !important; }
.income-dash .income-kpi-rev .dash-kpi-hint { color: #1a8a58 !important; }

.income-dash .income-kpi-cogs {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
  box-shadow: var(--shadow-sm) !important;
}
.income-dash .income-kpi-cogs .dash-kpi-label { color: #b45309 !important; }
.income-dash .income-kpi-cogs .dash-kpi-value { color: #92400e !important; }
.income-dash .income-kpi-cogs .dash-kpi-hint { color: #c27803 !important; }

.income-dash .income-kpi-exp {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
  box-shadow: var(--shadow-sm) !important;
}
.income-dash .income-kpi-exp .dash-kpi-label { color: #b91c1c !important; }
.income-dash .income-kpi-exp .dash-kpi-value { color: #991b1b !important; }
.income-dash .income-kpi-exp .dash-kpi-hint { color: #c0392b !important; }

.income-dash .income-kpi-net {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
  box-shadow: var(--shadow-sm) !important;
}
.income-dash .income-kpi-net .dash-kpi-label { color: #06b6d4 !important; }
.income-dash .income-kpi-net .dash-kpi-value { color: #0891b2 !important; }
.income-dash .income-kpi-net .dash-kpi-hint,
.income-dash .income-kpi-net .income-kpi-formula { color: #1a6fa0 !important; }

.income-dash .income-kpi-net.is-up {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.income-dash .income-kpi-net.is-up .dash-kpi-label { color: #147a4d !important; }
.income-dash .income-kpi-net.is-up .dash-kpi-value { color: #065f3a !important; }
.income-dash .income-kpi-net.is-up .dash-kpi-hint,
.income-dash .income-kpi-net.is-up .income-kpi-formula { color: #1a8a58 !important; }
.income-dash .income-kpi-net.is-up .income-kpi-pct { color: #047857 !important; font-weight: 800 !important; }

.income-dash .income-kpi-net.is-down {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.income-dash .income-kpi-net.is-down .dash-kpi-label { color: #b91c1c !important; }
.income-dash .income-kpi-net.is-down .dash-kpi-value { color: #991b1b !important; }
.income-dash .income-kpi-net.is-down .dash-kpi-hint,
.income-dash .income-kpi-net.is-down .income-kpi-formula { color: #c0392b !important; }
.income-dash .income-kpi-net.is-down .income-kpi-pct { color: #b91c1c !important; font-weight: 800 !important; }

.income-dash .income-kpi .dash-kpi-ico {
  color: #fff !important;
  width: 1.55rem !important;
  height: 1.55rem !important;
  border-radius: 9px !important;
  box-shadow: 0 3px 10px rgba(8, 145, 178, 0.2) !important;
}
.income-dash .income-kpi-ico-rev {
  background: linear-gradient(145deg, #34d399, #059669) !important;
  color: #fff !important;
}
.income-dash .income-kpi-ico-cogs {
  background: linear-gradient(145deg, #fbbf24, #b45309) !important;
  color: #fff !important;
}
.income-dash .income-kpi-ico-exp {
  background: linear-gradient(145deg, #f87171, #b91c1c) !important;
  color: #fff !important;
}
.income-dash .income-kpi-ico-net {
  background: linear-gradient(145deg, #22d3ee, #0e5a87) !important;
  color: #fff !important;
}
.income-dash .income-kpi-net.is-up .income-kpi-ico-net {
  background: linear-gradient(145deg, #34d399, #059669) !important;
  color: #fff !important;
}
.income-dash .income-kpi-net.is-down .income-kpi-ico-net {
  background: linear-gradient(145deg, #f87171, #b91c1c) !important;
  color: #fff !important;
}

.income-dash .income-kpi:hover {
  filter: saturate(1.06);
  transform: translateY(-2px);
}

/* —— Search / results —— */
.search-box,
.results-card,
.card,
.panel {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: #fff !important;
  box-shadow: var(--shadow-sm) !important;
}

.toolbar .btn-ghost,
.chip,
.tag {
  border-radius: var(--radius-sm) !important;
}

/* إجمالي أعلى المصروفات — متصل أسفل الجدول بدون فراغ */
.income-top-shell {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: #fff !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

.income-dash .income-top-panel .table-wrap,
.income-dash .income-top-scroll,
.income-dash .income-analyst-scroll.income-top-scroll {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
}

.income-dash .income-top-panel .table-wrap::after,
.income-dash .income-top-scroll::after,
.income-dash .income-top-shell .table-wrap::after {
  display: none !important;
  content: none !important;
  padding: 0 !important;
  border: 0 !important;
}

.income-top-table,
.income-top-table.data-table,
.income-top-foot-table,
.income-top-foot-table.data-table {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border-spacing: 0 !important;
}

.income-top-foot {
  margin: 0 !important;
  padding: 0 !important;
  border-top: 2px solid #d7e8ec !important;
  line-height: 1 !important;
}

.income-dash .income-top-foot-table tr.income-top-total td,
.income-dash .income-top-table tr.income-top-total td {
  position: static !important;
  background: #ecfeff !important;
  color: #0e7490 !important;
  border: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.income-dash .income-top-foot-table tr.income-top-total td + td {
  border-inline-start: 1px solid #d7e8ec !important;
}

.income-dash .income-top-table tr.income-top-total .mono,
.income-dash .income-top-table tr.income-top-total .income-top-net,
.income-dash .income-top-table tr.income-top-total .money {
  color: #991b1b !important;
  white-space: nowrap !important;
  width: auto !important;
}

/* ═══════════════════════════════════════════════════════════
   ملاءمة المحتوى — جداول وبطاقات في كل الموقع
   الخلايا/البطاقات تظهر النص كاملاً وتتسع حسب طوله
   ═══════════════════════════════════════════════════════════ */

.data-table,
.sales-table,
.cashier-bills-table,
.users-table,
.browse-price-table,
.income-account-table,
.perf-compare-table,
.pr-compare-table {
  table-layout: auto !important;
  width: max-content !important;
  min-width: 100% !important;
  max-width: none !important;
}

/* أعلى المصروفات: عرض كامل متصل مع صف الإجمالي */
.income-top-table,
.income-top-foot-table {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: none !important;
}

.data-table th,
.data-table td,
.sales-table th,
.sales-table td {
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  box-sizing: border-box;
}

.data-table td.mono,
.data-table th.mono,
.data-table .sales-amt,
.data-table .money,
.data-table .inv-value,
.data-table .inv-share,
.data-table .margin-cost,
.sales-table td.mono,
.sales-table .sales-amt {
  width: 1% !important;
  white-space: nowrap !important;
  padding-inline: 0.35rem !important;
}

.data-table .money,
.sales-table .money,
.sales-grand-row .money {
  display: inline-flex !important;
  align-items: center;
  gap: 0.12rem;
  width: max-content !important;
  max-width: none !important;
  white-space: nowrap !important;
}

.table-wrap,
.inv-table-scroll,
.users-table-wrap,
.pr-compare-table-wrap,
.margin-scroll {
  overflow-x: auto;
}

/* بطاقات KPI / ملخصات: بدون قص للنص */
.dash-kpi-card,
.dash-kpi-glass,
.purchase-kpi,
.income-kpi,
.inv-kpi-card,
.inv-summary-scope,
.perf-kpi .dash-kpi-card,
.seller-card,
.sales-stat-card,
.perf-meta-card,
.result-pill {
  overflow: visible !important;
  min-width: 0;
}

.dash-kpi,
.purchase-kpis,
.income-kpi-grid,
.inv-kpi-grid,
.inv-top,
.perf-kpi,
.perf-kpi-top {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr)) !important;
  align-items: stretch;
}

.dash-kpi > .dash-kpi-card,
.purchase-kpis > .purchase-kpi,
.income-kpi-grid > .income-kpi,
.inv-kpi-grid > .inv-kpi-card,
.inv-top > .dash-kpi-card,
.perf-kpi > .dash-kpi-card {
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
}

.dash-kpi-value,
.dash-kpi-hint,
.dash-kpi-label,
.inv-hl-name,
.inv-summary-scope-title,
.inv-summary-scope-label,
.seller-name,
.seller-amt,
.seller-meta,
.branch-chart-name,
.branch-chart-amt,
.income-kpi-pct,
.income-kpi-formula,
.perf-meta-value,
.result-pill {
  overflow: visible !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  display: block !important;
  -webkit-box-orient: unset !important;
  max-width: none !important;
}

.dash-kpi-value.mono,
.dash-kpi-hint.mono,
.inv-summary-scope-title,
.seller-amt,
.branch-chart-amt {
  white-space: nowrap !important;
  width: max-content !important;
  max-width: 100% !important;
}

.dash-kpi-value:not(.mono),
.inv-hl-name,
.seller-name,
.inv-summary-scope-title {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  width: auto !important;
  max-width: 100% !important;
}

.dash-kpi-label {
  display: flex !important;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  white-space: normal !important;
}

.page.sales-dash .dash-kpi-glass-item-amt .dash-kpi-value,
.page.sales-dash .dash-kpi-glass-item-qty .dash-kpi-value,
.page.sales-dash .dash-kpi-glass-item-ret .dash-kpi-value,
.inv-dash .inv-summary-scope-title,
.inv-dash .inv-hl-name {
  display: block !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  overflow: visible !important;
  white-space: normal !important;
}

/* —— Motion —— */
@media (prefers-reduced-motion: no-preference) {
  .dash-kpi-card {
    animation: dash-kpi-in 0.45s var(--ease) both;
  }
  .dash-kpi-card:nth-child(1) { animation-delay: 0.02s; }
  .dash-kpi-card:nth-child(2) { animation-delay: 0.05s; }
  .dash-kpi-card:nth-child(3) { animation-delay: 0.08s; }
  .dash-kpi-card:nth-child(4) { animation-delay: 0.11s; }
  .dash-kpi-card:nth-child(5) { animation-delay: 0.14s; }
  .dash-kpi-card:nth-child(6) { animation-delay: 0.17s; }
  .dash-kpi-card:nth-child(7) { animation-delay: 0.2s; }
  .dash-kpi-card:nth-child(8) { animation-delay: 0.23s; }
  .dash-kpi-card:nth-child(9) { animation-delay: 0.26s; }
  .dash-kpi-card:nth-child(10) { animation-delay: 0.29s; }

  .dash-panel,
  .dash-panel-glass {
    animation: dash-panel-in 0.5s var(--ease) both;
  }
}

@keyframes dash-kpi-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dash-panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .dash-head {
    padding: 1rem;
  }
  .dash-head-copy h2 {
    font-size: 1.28rem;
  }

  .page,
  .page.has-sidebar,
  .page.sales-dash,
  .page.sales-dash.has-sidebar,
  .income-duo,
  .assets-duo,
  .sns-duo,
  .dash-grid,
  .dash-panel,
  .dash-panel-glass,
  .perf-panel,
  .income-branch-panel,
  .income-accounts-panel,
  .income-account-shell {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .table-wrap,
  .inv-table-scroll,
  .users-table-wrap,
  .pr-compare-table-wrap,
  .pr-compare-sheet-wrap,
  .margin-scroll,
  .suppliers-scroll,
  .assets-list-wrap,
  .tb-main-scroll,
  .income-account-scroll,
  .income-analyst-scroll,
  .income-cash-scroll,
  .income-top-scroll,
  .pr-returns-scroll,
  .pr-vendors-wrap,
  .purchase-table-scroll,
  .sales-ov-scroll,
  .vt-sheet-wrap,
  .vt-table-wrap {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-gutter: auto;
  }

  .data-table,
  .sales-table,
  .cashier-bills-table,
  .users-table,
  .browse-price-table,
  .income-account-table,
  .perf-compare-table,
  .pr-compare-table,
  .tb-income-table,
  .tb-analytic-table,
  .tb-detail-table,
  .assets-table,
  .suppliers-table,
  .pr-returns-table,
  .pr-vendors-table {
    min-width: 100% !important;
    width: max-content !important;
    max-width: none !important;
  }

  .data-table th,
  .data-table td,
  .sales-table th,
  .sales-table td,
  .cashier-bills-table th,
  .cashier-bills-table td,
  .income-account-table th,
  .income-account-table td,
  .tb-income-table th,
  .tb-income-table td,
  .assets-table th,
  .assets-table td,
  .suppliers-table th,
  .suppliers-table td {
    padding: 0.38rem 0.42rem !important;
    font-size: 0.74rem !important;
  }

  .page.sales-dash .sales-table td:nth-child(2),
  .page.sales-dash .sales-table th:nth-child(2),
  .data-table td:nth-child(2),
  .data-table th:nth-child(2),
  .pr-item,
  .suppliers-name,
  .income-name-cell,
  .assets-table .pr-item {
    max-width: 11.5rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .data-table td.mono,
  .data-table .sales-amt,
  .data-table .money,
  .sales-table td.mono,
  .sales-table .sales-amt,
  .sales-table .money {
    white-space: nowrap !important;
    overflow: visible !important;
    max-width: none !important;
  }
}

@media (max-width: 640px) {
  .data-table th,
  .data-table td,
  .sales-table th,
  .sales-table td {
    padding: 0.32rem 0.34rem !important;
    font-size: 0.7rem !important;
  }

  .page.sales-dash .sales-table td:nth-child(2),
  .page.sales-dash .sales-table th:nth-child(2),
  .data-table td:nth-child(2),
  .pr-item,
  .suppliers-name,
  .income-name-cell {
    max-width: 8.5rem !important;
  }
}

/* ── نص بولد واضح في كل الموقع ── */
body,
body :where(
  p, span, label, a, li, td, th, small, strong, b, em, div,
  button, input, select, textarea, option,
  h1, h2, h3, h4, h5, h6,
  .mono, code, pre, .money, .sar-symbol,
  .dash-kpi-label, .dash-kpi-value, .dash-kpi-hint,
  .result-pill, .chip, .tag, .sales-empty
) {
  font-weight: 700 !important;
  color: inherit;
}

body {
  color: #0a0a0a;
  font-weight: 700 !important;
  -webkit-font-smoothing: antialiased;
}

body :where(
  h1, h2, h3,
  strong, b,
  .dash-kpi-value,
  .brand,
  .sidebar-brand .brand,
  .mono, td.mono, th.mono,
  .money, .sales-amt, .purchase-amount
) {
  font-weight: 800 !important;
}

body :where(.muted, .tagline, .dash-kpi-hint, .sidebar-section-label) {
  font-weight: 700 !important;
}

.ss-page .ss-suppliers .ss-sheet {
  table-layout: auto !important;
  min-width: 0 !important;
}

.ss-page .ss-suppliers .ss-sheet th:last-child,
.ss-page .ss-suppliers .ss-sheet td:last-child,
.ss-page .ss-sheet th.ss-col-date,
.ss-page .ss-sheet td.ss-col-date {
  direction: ltr !important;
  unicode-bidi: isolate !important;
  width: 11rem !important;
  min-width: 11rem !important;
  max-width: none !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  text-align: center !important;
}

/* دوران الموردين — شبكة خلايا Excel */
.page.vendor-turnover-dash .vt-table-panel .vt-table,
.page.vendor-turnover-dash .vt-table-panel .vt-sheet {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  width: max-content !important;
  min-width: 100% !important;
  background: #fff !important;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
  font-size: 0.75rem !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table th,
.page.vendor-turnover-dash .vt-table-panel .vt-table td {
  border: 1px solid #b4c0cc !important;
  padding: 0.22rem 0.42rem !important;
  line-height: 1.25 !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table thead th {
  background: #1f4e79 !important;
  color: #fff !important;
  font-weight: 700 !important;
  text-align: center !important;
  border-color: #163d5f !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table thead tr.vt-subhead th {
  background: #2e75b6 !important;
  border-color: #1f4e79 !important;
  top: 1.7rem !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table thead .vt-g-qty {
  background: #0d7377 !important;
  border-color: #095c5f !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table thead .vt-g-pay {
  background: #548235 !important;
  border-color: #3f6428 !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table .vt-sep {
  border-inline-start-width: 1px !important;
  border-inline-start-color: #b4c0cc !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table thead .vt-sep {
  border-inline-start-color: rgba(255, 255, 255, 0.35) !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table tbody td {
  background: #ffffff !important;
  color: #1f2a37 !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table tbody tr:nth-child(even) td {
  background: #f3f3f3 !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table tbody tr:hover td {
  background: #bdd7ee !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table tbody tr.vt-row-settle td {
  background: #e2efda !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table tbody tr.vt-row-settle:nth-child(even) td {
  background: #d4e8c8 !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table tbody tr.vt-row-partial td {
  background: #fff2cc !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table tbody tr.vt-row-partial:nth-child(even) td {
  background: #ffe699 !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table tbody tr.vt-row-hold td {
  background: #fce4d6 !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table tbody tr.vt-row-hold:nth-child(even) td {
  background: #f8cbad !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table tbody tr.vt-row-settle:hover td,
.page.vendor-turnover-dash .vt-table-panel .vt-table tbody tr.vt-row-partial:hover td,
.page.vendor-turnover-dash .vt-table-panel .vt-table tbody tr.vt-row-hold:hover td {
  background: #bdd7ee !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table tfoot td,
.page.vendor-turnover-dash .vt-table-panel .vt-table tfoot .sales-grand-row td {
  background: #d6dce4 !important;
  color: #1f2a37 !important;
  border-color: #b4c0cc !important;
  font-weight: 800 !important;
  box-shadow: none !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-table tfoot .mono,
.page.vendor-turnover-dash .vt-table-panel .vt-table tfoot .vt-due-cell,
.page.vendor-turnover-dash .vt-table-panel .vt-table tfoot .vt-due-pos,
.page.vendor-turnover-dash .vt-table-panel .vt-table tfoot .vt-due-neg,
.page.vendor-turnover-dash .vt-table-panel .vt-table tfoot .vt-turn-cell {
  color: #1f2a37 !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-name-cell,
.page.vendor-turnover-dash .vt-table-panel td.vt-name-cell {
  max-width: 22rem !important;
  min-width: 12rem !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-name-cell,
.page.vendor-turnover-dash .vt-table-panel .vt-name-cell strong {
  display: inline !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  max-width: none !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-vendor-code {
  display: inline !important;
  margin: 0 0.35rem 0 0 !important;
  font-size: 0.68rem !important;
  color: #5b6b7c !important;
}
.page.vendor-turnover-dash .vt-table-panel .vt-badge {
  display: inline-block;
  padding: 0.05rem 0.35rem;
  border: 1px solid currentColor;
  border-radius: 0;
  font-size: 0.68rem;
  line-height: 1.2;
}
.page.vendor-turnover-dash .vt-table-wrap {
  border: 1px solid #8fa3b8 !important;
  border-radius: 0 !important;
  background: #fff !important;
}


/* —— Tables density · mobile —— */
@media (max-width: 900px) {
  .data-table th {
    font-size: 0.72rem !important;
    padding: 0.45rem 0.4rem !important;
  }

  .data-table td {
    font-size: 0.82rem !important;
    padding: 0.42rem 0.4rem !important;
  }

  .dash-panel-head {
    padding: 0.65rem 0.85rem;
  }

  .dash-head {
    padding: 0.9rem 1rem;
    gap: 0.75rem;
  }
}

@media (max-width: 640px) {
  .data-table th,
  .data-table td {
    font-size: 0.75rem !important;
    padding: 0.38rem 0.35rem !important;
  }

  .sales-grand-row td {
    font-size: 0.78rem !important;
    padding: 0.4rem 0.3rem !important;
  }
}

/* —— Unpriced / below-cost KPI cards · Aqua Mist —— */
.unpriced-dash .up-kpi-grid {
  gap: 0.75rem !important;
  margin-bottom: 1rem !important;
}

.unpriced-dash .up-kpi {
  position: relative;
  gap: 0.28rem !important;
  padding: 0.9rem 1rem 0.85rem !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  background: #ffffff !important;
  box-shadow: var(--shadow-sm) !important;
  overflow: hidden;
}

.unpriced-dash .up-kpi::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  height: auto;
  background: var(--brand-mid);
}

.unpriced-dash .up-kpi-label {
  display: inline-flex !important;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: var(--muted) !important;
}

.unpriced-dash .up-kpi-value {
  font-size: 1.35rem !important;
  font-weight: 800 !important;
  color: var(--ink) !important;
  letter-spacing: -0.02em;
}

.unpriced-dash .up-kpi-hint {
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  color: var(--muted) !important;
  line-height: 1.35;
}

.unpriced-dash .up-kpi-ico {
  background: linear-gradient(145deg, #22d3ee, #0891b2) !important;
  color: #fff !important;
  border: none !important;
  width: 1.55rem !important;
  height: 1.55rem !important;
  border-radius: 9px !important;
  box-shadow: 0 3px 10px rgba(8, 145, 178, 0.26) !important;
  display: inline-grid !important;
  place-items: center;
}
.unpriced-dash .up-kpi-ico svg {
  width: 0.88rem;
  height: 0.88rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* مطابقة النتائج — تمييز سيان هادئ */
.unpriced-dash .up-kpi.is-match {
  background: linear-gradient(155deg, #ecfeff 0%, #cffafe 55%, #ffffff 100%) !important;
  border-color: #a5f3fc !important;
}
.unpriced-dash .up-kpi.is-match::before {
  background: #0891b2;
}
.unpriced-dash .up-kpi.is-match .up-kpi-label,
.unpriced-dash .up-kpi.is-match .up-kpi-hint {
  color: #0e7490 !important;
}
.unpriced-dash .up-kpi.is-match .up-kpi-value {
  color: #0e7490 !important;
}
.unpriced-dash .up-kpi.is-match .up-kpi-ico {
  background: linear-gradient(145deg, #22d3ee, #0891b2) !important;
  color: #fff !important;
  border: none !important;
}

/* أقل من التكلفة — تنبيه كهرماني هادئ */
.below-cost-dash .up-kpi.is-match {
  background: linear-gradient(155deg, #fffbeb 0%, #fef3c7 45%, #ffffff 100%) !important;
  border-color: #fde68a !important;
}
.below-cost-dash .up-kpi.is-match::before {
  background: #d97706;
}
.below-cost-dash .up-kpi.is-match .up-kpi-label,
.below-cost-dash .up-kpi.is-match .up-kpi-hint {
  color: #92400e !important;
}
.below-cost-dash .up-kpi.is-match .up-kpi-value {
  color: #9a3412 !important;
}
.below-cost-dash .up-kpi.is-match .up-kpi-ico {
  background: linear-gradient(145deg, #fbbf24, #c2410c) !important;
  color: #fff !important;
  border: none !important;
}

/* المعروض */
.unpriced-dash .up-kpi.is-shown {
  background: #ffffff !important;
  border-color: var(--line) !important;
}
.unpriced-dash .up-kpi.is-shown::before {
  background: #06b6d4;
}
.unpriced-dash .up-kpi.is-shown .up-kpi-label,
.unpriced-dash .up-kpi.is-shown .up-kpi-hint {
  color: #6b858f !important;
}
.unpriced-dash .up-kpi.is-shown .up-kpi-value {
  color: #0891b2 !important;
}
.unpriced-dash .up-kpi.is-shown .up-kpi-ico {
  background: linear-gradient(145deg, #67e8f9, #06b6d4) !important;
  color: #fff !important;
  border: none !important;
}

/* المخزن */
.unpriced-dash .up-kpi.is-wh {
  background: #ffffff !important;
  border-color: var(--line) !important;
}
.unpriced-dash .up-kpi.is-wh::before {
  background: #6b858f;
}
.unpriced-dash .up-kpi.is-wh .up-kpi-label,
.unpriced-dash .up-kpi.is-wh .up-kpi-hint {
  color: #6b858f !important;
}
.unpriced-dash .up-kpi.is-wh .up-kpi-value {
  color: #1a2b33 !important;
}
.unpriced-dash .up-kpi.is-wh .up-kpi-ico {
  background: linear-gradient(145deg, #94a3b8, #475569) !important;
  color: #fff !important;
  border: none !important;
}

/* تغيّر الأسعار — صعود / هبوط هادئ */
.price-changes-dash .pc-kpi-up {
  background: linear-gradient(155deg, #ecfdf5 0%, #ffffff 100%) !important;
  border-color: #a7f3d0 !important;
}
.price-changes-dash .pc-kpi-up::before {
  background: #059669;
}
.price-changes-dash .pc-kpi-up .up-kpi-label,
.price-changes-dash .pc-kpi-up .up-kpi-hint {
  color: #047857 !important;
}
.price-changes-dash .pc-kpi-up .up-kpi-value {
  color: #047857 !important;
}

.price-changes-dash .pc-kpi-down {
  background: linear-gradient(155deg, #fef2f2 0%, #ffffff 100%) !important;
  border-color: #fecaca !important;
}
.price-changes-dash .pc-kpi-down::before {
  background: #dc2626;
}
.price-changes-dash .pc-kpi-down .up-kpi-label,
.price-changes-dash .pc-kpi-down .up-kpi-hint {
  color: #b91c1c !important;
}
.price-changes-dash .pc-kpi-down .up-kpi-value {
  color: #b91c1c !important;
}

.unpriced-dash .up-sheet {
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm) !important;
}

.unpriced-dash .up-table thead th {
  background: #eef8fa !important;
  color: #6b858f !important;
  border-bottom: 1px solid #d7e8ec !important;
}

.unpriced-dash .up-table tbody tr:nth-child(even) td {
  background: #f7fcfd !important;
}

.unpriced-dash .up-table tbody tr:hover td {
  background: #ecfeff !important;
}

@media (max-width: 900px) {
  .unpriced-dash .up-kpi-grid {
    grid-template-columns: 1fr !important;
  }
}



/* —— Site-wide KPI shell · Aqua Mist —— */
.low-margin-dash .lm-kpi,
.vpc-dash .vpc-kpi {
  position: relative !important;
  overflow: hidden !important;
  border: 1px solid #d7e8ec !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(8, 145, 178, 0.06), 0 4px 14px rgba(26, 43, 51, 0.04) !important;
  color: #1a2b33 !important;
}
.low-margin-dash .lm-kpi::before {
  content: "" !important;
  position: absolute !important;
  inset-block: 0 !important;
  inset-inline-start: 0 !important;
  width: 3px !important;
  height: auto !important;
  border-radius: 0 !important;
  background: #0891b2 !important;
  pointer-events: none !important;
  opacity: 1 !important;
}
.low-margin-dash .lm-kpi-label { color: #6b858f !important; }
.low-margin-dash .lm-kpi-value { color: #1a2b33 !important; }
.low-margin-dash .lm-kpi-hint { color: #6b858f !important; }
.low-margin-dash .lm-kpi-ico {
  background: linear-gradient(145deg, #22d3ee, #0891b2) !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(8, 145, 178, 0.26) !important;
  width: 1.55rem !important;
  height: 1.55rem !important;
  border-radius: 9px !important;
  display: inline-grid !important;
  place-items: center;
}
.low-margin-dash .lm-kpi-ico svg {
  width: 0.88rem;
  height: 0.88rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.low-margin-dash .lm-kpi.is-match .lm-kpi-ico {
  background: linear-gradient(145deg, #22d3ee, #0891b2) !important;
  color: #fff !important;
}
.low-margin-dash .lm-kpi.is-shown .lm-kpi-ico {
  background: linear-gradient(145deg, #67e8f9, #06b6d4) !important;
  color: #fff !important;
}
.low-margin-dash .lm-kpi.is-limit .lm-kpi-ico {
  background: linear-gradient(145deg, #fbbf24, #b45309) !important;
  color: #fff !important;
}
.low-margin-dash .lm-kpi.is-match {
  background: linear-gradient(155deg, #ecfeff 0%, #cffafe 50%, #ffffff 100%) !important;
  border-color: #a5f3fc !important;
}
.low-margin-dash .lm-kpi.is-match::before { background: #0891b2 !important; }
.low-margin-dash .lm-kpi.is-match .lm-kpi-label,
.low-margin-dash .lm-kpi.is-match .lm-kpi-hint { color: #0e7490 !important; }
.low-margin-dash .lm-kpi.is-match .lm-kpi-value { color: #0e7490 !important; }
.low-margin-dash .lm-kpi.is-shown,
.low-margin-dash .lm-kpi.is-wh,
.low-margin-dash .lm-kpi.is-group {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}
.low-margin-dash .lm-kpi.is-shown .lm-kpi-value { color: #0891b2 !important; }
.vpc-dash .vpc-kpi { padding: 0.85rem 1rem !important; }
.vpc-dash .vpc-kpi::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: #0891b2;
}
.vpc-dash .vpc-kpi span { color: #6b858f !important; }
.vpc-dash .vpc-kpi strong { color: #1a2b33 !important; }
.vpc-dash .vpc-kpi small { color: #6b858f !important; }
.vpc-dash .vpc-kpi.is-flag {
  background: linear-gradient(155deg, #fff7ed 0%, #ffffff 100%) !important;
  border-color: #fed7aa !important;
}
.vpc-dash .vpc-kpi.is-flag::before { background: #ea580c; }
.vpc-dash .vpc-kpi.is-max::before { background: #06b6d4; }
.vpc-dash .vpc-kpi.is-loc::before { background: #6b858f; }
.vpc-dash .vpc-kpi.is-items::before { background: #0891b2; }
.inv-dash .inv-kpi-card,
.inv-dash .inv-summary-scope,
.perf-dash .dash-kpi-card,
.purchase-dash .dash-kpi-card,
.purchase-dash .purchase-kpi,
.income-dash .dash-kpi-card {
  background: #ffffff !important;
  border-color: #d7e8ec !important;
}

/* —— Site-wide Power BI KPI icon tiles —— */
.price-changes-dash .pc-kpi-up .up-kpi-ico {
  background: linear-gradient(145deg, #34d399, #059669) !important;
  color: #fff !important;
}
.price-changes-dash .pc-kpi-down .up-kpi-ico {
  background: linear-gradient(145deg, #f87171, #dc2626) !important;
  color: #fff !important;
}

.vpc-dash .vpc-kpi-label {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #6b858f !important;
}
.vpc-dash .vpc-kpi-ico {
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 9px;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(8, 145, 178, 0.22);
  flex-shrink: 0;
}
.vpc-dash .vpc-kpi-ico svg {
  width: 0.88rem;
  height: 0.88rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vpc-dash .vpc-kpi.is-items .vpc-kpi-ico {
  background: linear-gradient(145deg, #22d3ee, #0891b2);
}
.vpc-dash .vpc-kpi.is-flag .vpc-kpi-ico {
  background: linear-gradient(145deg, #fb923c, #ea580c);
}
.vpc-dash .vpc-kpi.is-loc .vpc-kpi-ico {
  background: linear-gradient(145deg, #94a3b8, #475569);
}
.vpc-dash .vpc-kpi.is-max .vpc-kpi-ico {
  background: linear-gradient(145deg, #67e8f9, #06b6d4);
}

.perf-dash .perf-kpi .dash-kpi-ico {
  width: 1.55rem !important;
  height: 1.55rem !important;
  border-radius: 9px !important;
  color: #fff !important;
}
.perf-dash .perf-kpi .dash-kpi-ico svg {
  width: 0.88rem;
  height: 0.88rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
}

.suppliers-dash .suppliers-kpis .dash-kpi-ico {
  width: 1.55rem !important;
  height: 1.55rem !important;
  border-radius: 9px !important;
  color: #fff !important;
}
.suppliers-dash .suppliers-kpis .dash-kpi-label {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.vendor-turnover-dash .vt-kpi .dash-kpi-ico {
  width: 1.55rem !important;
  height: 1.55rem !important;
  border-radius: 9px !important;
  color: #fff !important;
}
.vendor-turnover-dash .vt-ico-costadj {
  background: linear-gradient(145deg, #a78bfa, #7c3aed) !important;
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.24) !important;
  color: #fff !important;
}

/* ═══════════════════════════════════════════════════════════
   Site-wide tables · numbers · type — Aqua Mist
   ═══════════════════════════════════════════════════════════ */

.page.sales-dash .dash-panel-glass .dash-panel-head,
.purchase-dash .dash-panel-glass .dash-panel-head,
.income-dash .dash-panel-glass .dash-panel-head,
.perf-dash .dash-panel-glass .dash-panel-head,
.vpc-dash .dash-panel-glass .dash-panel-head,
.unpriced-dash .dash-panel-glass .dash-panel-head,
.vendor-turnover-dash .dash-panel-glass .dash-panel-head {
  background: linear-gradient(180deg, #ffffff 0%, #f7fcfd 100%) !important;
  border-bottom: 1px solid var(--line) !important;
}

.page.sales-dash .dash-panel-glass .dash-panel-head h3,
.purchase-dash .dash-panel-glass .dash-panel-head h3,
.income-dash .dash-panel-glass .dash-panel-head h3,
.perf-dash .dash-panel-glass .dash-panel-head h3,
.vpc-dash .dash-panel-glass .dash-panel-head h3,
.unpriced-dash .dash-panel-glass .dash-panel-head h3,
.vendor-turnover-dash .dash-panel-glass .dash-panel-head h3,
.suppliers-dash .dash-panel-glass .dash-panel-head h3 {
  font-family: var(--font) !important;
  font-weight: 800 !important;
  color: #0e7490 !important;
}

/* Soft aqua pills (override solid colored pills) */
.page.sales-dash .result-pill,
.purchase-dash .result-pill,
.income-dash .result-pill,
.perf-dash .result-pill,
.inv-dash .result-pill,
.vpc-dash .result-pill,
.unpriced-dash .result-pill,
.vendor-turnover-dash .result-pill,
.suppliers-dash .result-pill {
  background: #ecfeff !important;
  border: 1px solid #a5f3fc !important;
  color: #0e7490 !important;
  font-family: var(--mono) !important;
  font-variant-numeric: tabular-nums;
  font-weight: 800 !important;
}

/* Sticky headers — every scrollable table */
.page.sales-dash .table-wrap thead th,
.page.sales-dash .inv-table-scroll thead th,
.page.sales-dash .sales-ov-scroll thead th,
.page.sales-dash .margin-scroll thead th,
.purchase-dash .table-wrap thead th,
.income-dash .table-wrap thead th,
.perf-dash .table-wrap thead th,
.vpc-dash .table-wrap thead th,
.unpriced-dash .table-wrap thead th,
.vendor-turnover-dash .table-wrap thead th,
.vendor-turnover-dash .vt-sheet thead th,
.page.vendor-turnover-dash .vt-table-panel .vt-table thead th {
  background: #eef8fa !important;
  color: #0e7490 !important;
  font-family: var(--font) !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 0 #d7e8ec;
}

/* Mono numbers site-wide in tables */
.page.sales-dash .data-table td.mono,
.page.sales-dash .data-table th.mono,
.page.sales-dash .sales-table td.mono,
.page.sales-dash .sales-table .sales-amt,
.page.sales-dash .sales-table .money,
.purchase-dash .data-table td.mono,
.purchase-dash .sales-table td.mono,
.income-dash .data-table td.mono,
.income-dash .income-account-table td.mono,
.perf-dash .data-table td.mono,
.vpc-dash .data-table td.mono,
.unpriced-dash .data-table td.mono,
.unpriced-dash .up-table td.mono,
.vendor-turnover-dash .data-table td.mono,
.vendor-turnover-dash .vt-sheet td.mono,
.vendor-turnover-dash .vt-table td.mono,
.suppliers-dash .data-table td.mono {
  font-family: var(--mono) !important;
  font-variant-numeric: tabular-nums;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

/* Semantic amount / share colors */
.page.sales-dash .data-table td.sales-amt,
.page.sales-dash .sales-table td.sales-amt,
.page.sales-dash .data-table td.sales-col-amt,
.page.sales-dash .sales-table td.sales-col-amt {
  color: #047857 !important;
}
.page.sales-dash .data-table td.sales-col-cost,
.page.sales-dash .sales-table td.sales-col-cost {
  color: #92400e !important;
}
.page.sales-dash .data-table td.sales-col-share,
.page.sales-dash .sales-table td.sales-col-share,
.page.sales-dash .data-table td.inv-col-share,
.inv-dash .data-table td.inv-col-share {
  color: #0891b2 !important;
}
.inv-dash .data-table td.inv-col-qty {
  color: #047857 !important;
}
.inv-dash .data-table td.inv-col-cost {
  color: #92400e !important;
}

/* Even / hover rows — all dash tables */
.page.sales-dash .data-table tbody tr:nth-child(even) td,
.purchase-dash .data-table tbody tr:nth-child(even) td,
.income-dash .data-table tbody tr:nth-child(even) td,
.perf-dash .data-table tbody tr:nth-child(even) td,
.vpc-dash .data-table tbody tr:nth-child(even) td,
.unpriced-dash .data-table tbody tr:nth-child(even) td,
.vendor-turnover-dash .data-table tbody tr:nth-child(even) td,
.vendor-turnover-dash .vt-sheet tbody tr:nth-child(even) td {
  background: #f7fcfd !important;
}

.page.sales-dash .data-table tbody tr:hover td,
.purchase-dash .data-table tbody tr:hover td,
.income-dash .data-table tbody tr:hover td,
.perf-dash .data-table tbody tr:hover td,
.vpc-dash .data-table tbody tr:hover td,
.unpriced-dash .data-table tbody tr:hover td,
.vendor-turnover-dash .data-table tbody tr:hover td,
.vendor-turnover-dash .vt-sheet tbody tr:hover td {
  background: #ecfeff !important;
}

/* Keep grand-row white text on teal */
.page.sales-dash .sales-grand-row td,
.page.sales-dash .sales-grand-row td.sales-amt,
.page.sales-dash .sales-grand-row td.mono,
.page.sales-dash .sales-grand-row td.sales-col-amt,
.page.sales-dash .sales-grand-row td.sales-col-cost,
.page.sales-dash .sales-grand-row td.sales-col-share {
  color: #fff !important;
}

.page.sales-dash .dash-panel-glass .data-table th {
  background: #eef8fa !important;
  color: #0e7490 !important;
}

/* Unpriced / low-margin / below-cost sheets */
.unpriced-dash .up-table thead th,
.low-margin-dash .lm-table thead th,
.below-cost-dash .up-table thead th,
.price-changes-dash .up-table thead th,
.cost-adj-dash .up-table thead th {
  background: #eef8fa !important;
  color: #0e7490 !important;
  font-family: var(--font) !important;
  font-weight: 800 !important;
}

.unpriced-dash .up-table td.mono,
.low-margin-dash .lm-table td.mono,
.below-cost-dash .up-table td.mono,
.price-changes-dash .up-table td.mono,
.cost-adj-dash .up-table td.mono {
  font-family: var(--mono) !important;
  font-variant-numeric: tabular-nums;
  font-weight: 700 !important;
}

/* فواصل خلايا خفيفة — بين الأعمدة والصفوف */
.data-table th,
.data-table td,
.sales-table th,
.sales-table td,
.perf-compare-table th,
.perf-compare-table td,
.vt-sheet th,
.vt-sheet td,
.vt-table th,
.vt-table td,
.up-table th,
.up-table td,
.lm-table th,
.lm-table td,
.income-account-table th,
.income-account-table td,
.cashier-bills-table th,
.cashier-bills-table td {
  border-bottom: 1px solid #e8f2f5 !important;
}

.data-table th + th,
.data-table td + td,
.sales-table th + th,
.sales-table td + td,
.perf-compare-table th + th,
.perf-compare-table td + td,
.vt-sheet th + th,
.vt-sheet td + td,
.vt-table th + th,
.vt-table td + td,
.up-table th + th,
.up-table td + td,
.lm-table th + th,
.lm-table td + td,
.income-account-table th + th,
.income-account-table td + td,
.cashier-bills-table th + th,
.cashier-bills-table td + td {
  border-inline-start: 1px solid #e2eef2 !important;
}

/* صف الإجمالي: فواصل أوضح قليلاً على الخلفية الداكنة */
.sales-grand-row td + td,
.inv-table-foot .sales-grand-row td + td {
  border-inline-start: 1px solid rgba(255, 255, 255, 0.22) !important;
}
.sales-grand-row td,
.inv-table-foot .sales-grand-row td {
  border-bottom: none !important;
}

/* صف نشط عند النقر — يغلب تظليل الزوجي/التمرير */
table tbody tr.is-selected > td,
.page.sales-dash .data-table tbody tr.is-selected > td,
.page.sales-dash .sales-table tbody tr.is-selected > td,
.purchase-dash .data-table tbody tr.is-selected > td,
.income-dash .data-table tbody tr.is-selected > td,
.perf-dash .data-table tbody tr.is-selected > td,
.inv-dash .data-table tbody tr.is-selected > td,
.inv-dash .inv-table-compact tbody tr.is-selected > td,
.vpc-dash .data-table tbody tr.is-selected > td,
.unpriced-dash .data-table tbody tr.is-selected > td,
.unpriced-dash .up-table tbody tr.is-selected > td,
.low-margin-dash .lm-table tbody tr.is-selected > td,
.vendor-turnover-dash .data-table tbody tr.is-selected > td,
.vendor-turnover-dash .vt-sheet tbody tr.is-selected > td,
.vendor-turnover-dash .vt-table tbody tr.is-selected > td,
.suppliers-dash .data-table tbody tr.is-selected > td,
.page.sales-dash .data-table tbody tr.is-selected:nth-child(even) > td,
.page.sales-dash .data-table tbody tr.is-selected:hover > td,
.inv-dash .inv-table-compact tbody tr.is-selected:nth-child(even) > td,
.inv-dash .inv-table-compact tbody tr.is-selected:hover > td,
.page.sales-dash.inv-dash .inv-table-scroll tbody tr.is-selected > td.inv-col-sticky,
.page.sales-dash.inv-dash .inv-table-scroll tbody tr.is-selected > td.inv-col-sticky.inv-cell-clip,
.page.sales-dash.inv-dash .inv-table-scroll tbody tr.is-selected:nth-child(even) > td.inv-col-sticky,
.page.sales-dash.inv-dash .inv-table-scroll tbody tr.is-selected:hover > td.inv-col-sticky {
  background: #cffafe !important;
  color: #0e7490 !important;
  box-shadow: inset 0 0 0 1px #67e8f9;
}

table tbody tr.is-selected > td.mono,
table tbody tr.is-selected > td.sales-amt,
table tbody tr.is-selected > td.inv-col-qty,
table tbody tr.is-selected > td.inv-col-cost,
table tbody tr.is-selected > td.inv-col-share,
.page.sales-dash .data-table tbody tr.is-selected > td.mono,
.inv-dash .data-table tbody tr.is-selected > td.mono {
  color: #0e7490 !important;
}

table tbody tr.is-selected > td.inv-col-qty,
.inv-dash .data-table tbody tr.is-selected > td.inv-col-qty {
  color: #047857 !important;
}
table tbody tr.is-selected > td.inv-col-cost,
.inv-dash .data-table tbody tr.is-selected > td.inv-col-cost {
  color: #b45309 !important;
}
table tbody tr.is-selected > td.sales-amt,
table tbody tr.is-selected > td.sales-col-amt,
.page.sales-dash .data-table tbody tr.is-selected > td.sales-amt {
  color: #047857 !important;
}

.table-wrap:focus,
.vt-table-wrap:focus,
.vt-sheet-wrap:focus,
.inv-table-scroll:focus,
.sales-ov-scroll:focus,
.lm-scroll:focus,
.wh-out-scroll:focus {
  outline: 2px solid #06b6d4;
  outline-offset: -2px;
}

/* ═══════════════════════════════════════════════════════════
   تنسيق أعمدة الجداول — موحّد بكل الموقع
   نص ← بداية | أرقام ← نهاية | عرض رقمي مضغوط
   ═══════════════════════════════════════════════════════════ */

.data-table th,
.data-table td,
.sales-table th,
.sales-table td,
.perf-compare-table th,
.perf-compare-table td,
.vt-sheet th,
.vt-sheet td,
.vt-table th,
.vt-table td,
.up-table th,
.up-table td,
.lm-table th,
.lm-table td,
.income-account-table th,
.income-account-table td,
.cashier-bills-table th,
.cashier-bills-table td {
  vertical-align: middle !important;
  text-align: start;
}

/* أعمدة الأرقام */
.data-table th.mono,
.data-table td.mono,
.data-table th.sales-amt,
.data-table td.sales-amt,
.data-table .sales-amt,
.data-table .money,
.data-table th.inv-col-qty,
.data-table td.inv-col-qty,
.data-table th.inv-col-cost,
.data-table td.inv-col-cost,
.data-table th.inv-col-share,
.data-table td.inv-col-share,
.data-table th.inv-wastage-value,
.data-table td.inv-wastage-value,
.data-table th.inv-wastage-share,
.data-table td.inv-wastage-share,
.data-table th.sales-col-amt,
.data-table td.sales-col-amt,
.data-table th.sales-col-cost,
.data-table td.sales-col-cost,
.data-table th.sales-col-share,
.data-table td.sales-col-share,
.sales-table th.mono,
.sales-table td.mono,
.sales-table .sales-amt,
.sales-table .money,
.perf-compare-table th.mono,
.perf-compare-table td.mono,
.up-table th.mono,
.up-table td.mono,
.lm-table th.mono,
.lm-table td.mono,
.vt-sheet th.mono,
.vt-sheet td.mono,
.vt-table th.mono,
.vt-table td.mono,
.income-account-table th.mono,
.income-account-table td.mono,
.cashier-bills-table th.mono,
.cashier-bills-table td.mono {
  text-align: end !important;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums;
  width: 1%;
}

/* أعمدة الاسم/النص تتوسع */
.data-table td.inv-cell-clip,
.sales-table td.inv-cell-clip,
.perf-compare-table td.inv-cell-clip,
.data-table .inv-col-sticky,
.sales-table td:not(.mono):not(.sales-amt):not(.inv-col-qty):not(.inv-col-cost):not(.inv-col-share):not(.inv-wastage-value):not(.inv-wastage-share):not(.sales-col-amt):not(.sales-col-cost):not(.sales-col-share) {
  text-align: start !important;
}

/* جداول مدمجة: أول عمودين نص، الباقي أرقام بمحاذاة نهاية */
.inv-table-compact th:nth-child(-n + 2),
.inv-table-compact td:nth-child(-n + 2) {
  text-align: start !important;
  width: auto !important;
}

.inv-table-compact th:nth-child(n + 3),
.inv-table-compact td:nth-child(n + 3) {
  text-align: end !important;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums;
}

.inv-table-compact td.mono,
.inv-table-compact th.mono {
  font-family: var(--mono) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

/* صفوف الإجمالي: أرقام بمحاذاة نهاية */
.sales-grand-row td.mono,
.sales-grand-row td.sales-amt,
.sales-grand-row .money {
  text-align: end !important;
}

/* خلايا فارغة / رسائل */
.data-table td.sales-empty,
.sales-table td.sales-empty {
  text-align: center !important;
  width: auto !important;
  white-space: normal !important;
}

/* ═══════════════════════════════════════════════════════════
   PDF / Print — ألوان Aqua Mist محفوظة
   ═══════════════════════════════════════════════════════════ */
@media print {
  body.fit-printing,
  body.fit-printing * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.fit-printing {
    background: #f7fcfd !important;
    color: #1a2b33 !important;
  }

  body.fit-printing .dash-pdf-btn,
  body.fit-printing .dash-head-actions,
  body.fit-printing form,
  body.fit-printing .sales-ov-filter,
  body.fit-printing .purchase-filter,
  body.fit-printing .income-filter-bar,
  body.fit-printing .unpriced-filter,
  body.fit-printing .low-margin-filter,
  body.fit-printing .vpc-print-btn,
  body.fit-printing .btn-primary,
  body.fit-printing .alert {
    display: none !important;
  }

  body.fit-printing .dash-head {
    background: #ffffff !important;
    border: 1px solid #d7e8ec !important;
    box-shadow: none !important;
    margin-bottom: 0.6rem !important;
    padding: 0.55rem 0.75rem !important;
  }

  body.fit-printing .dash-head-copy h2 {
    color: #0e7490 !important;
    font-size: 1.15rem !important;
  }

  body.fit-printing .dash-kpi-card,
  body.fit-printing .dash-kpi-glass,
  body.fit-printing .dash-panel,
  body.fit-printing .dash-panel-glass {
    background: #ffffff !important;
    border: 1px solid #d7e8ec !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  body.fit-printing .dash-panel-head {
    background: linear-gradient(180deg, #ffffff 0%, #f7fcfd 100%) !important;
    border-bottom: 1px solid #d7e8ec !important;
  }

  body.fit-printing .dash-panel-head h3 {
    color: #0e7490 !important;
  }

  body.fit-printing .result-pill {
    background: #ecfeff !important;
    border: 1px solid #a5f3fc !important;
    color: #0e7490 !important;
  }

  body.fit-printing table.data-table thead th,
  body.fit-printing table.sales-table thead th,
  body.fit-printing table.lm-table thead th,
  body.fit-printing table.up-table thead th,
  body.fit-printing table.vt-sheet thead th,
  body.fit-printing table.vt-table thead th {
    background: #eef8fa !important;
    color: #0e7490 !important;
  }

  body.fit-printing table.data-table th,
  body.fit-printing table.data-table td,
  body.fit-printing table.sales-table th,
  body.fit-printing table.sales-table td {
    border: 1px solid #e2eef2 !important;
  }

  /* جدول رسمي: عرض المحتوى بدون فجوة وسطى */
  body.fit-printing table.data-table,
  body.fit-printing table.sales-table,
  body.fit-printing table.lm-table,
  body.fit-printing table.up-table,
  body.fit-printing table.nbc-table,
  body.fit-printing table.wh-out-table,
  body.fit-printing table.wh-exp-table,
  body.fit-printing table.inv-pack-err-table,
  body.fit-printing table.wqc-table,
  body.fit-printing table.vt-sheet,
  body.fit-printing table.vt-table,
  body.fit-printing table.perf-compare-table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 8.5px !important;
    border-collapse: collapse !important;
    font-variant-numeric: tabular-nums;
    color: #1a2b33 !important;
  }

  body.fit-printing table[data-fit-print-fs] {
    font-size: var(--fit-print-fs, 8.5px) !important;
  }

  body.fit-printing table[data-fit-print-fs][data-fit-measuring] {
    width: max-content !important;
    max-width: none !important;
    table-layout: auto !important;
  }

  body.fit-printing table th,
  body.fit-printing table td {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    max-width: none !important;
    min-width: 0 !important;
    width: 1% !important;
    padding: 0.18em 0.35em !important;
    line-height: 1.25 !important;
    vertical-align: middle !important;
    font-size: inherit !important;
  }

  /* أعمدة الأرقام: ضيقة + محاذاة نهاية */
  body.fit-printing table td.mono,
  body.fit-printing table th.mono,
  body.fit-printing table .inv-col-qty,
  body.fit-printing table .inv-col-cost,
  body.fit-printing table .inv-col-share,
  body.fit-printing table .inv-wastage-value,
  body.fit-printing table .inv-wastage-share,
  body.fit-printing table .sales-amt,
  body.fit-printing table .sales-col-amt,
  body.fit-printing table .sales-col-cost,
  body.fit-printing table .sales-col-share,
  body.fit-printing table .money {
    width: 1% !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    text-align: end !important;
    font-variant-numeric: tabular-nums;
  }

  /* أسماء نصية بكل الجداول: خلية مضغوطة بلا هامش فارغ ولا تكديس */
  body.fit-printing table td.inv-cell-clip,
  body.fit-printing table td.purchase-name,
  body.fit-printing table td.suppliers-name,
  body.fit-printing table td.income-name-cell,
  body.fit-printing table td.income-top-name,
  body.fit-printing table .inv-col-sticky,
  body.fit-printing table th:not(.mono):not(.inv-col-qty):not(.inv-col-cost):not(.inv-col-share),
  body.fit-printing .inv-table-compact th:nth-child(-n + 2),
  body.fit-printing .inv-table-compact td:nth-child(-n + 2) {
    width: 1% !important;
    max-width: none !important;
    text-align: start !important;
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    padding: 0.18em 0.35em !important;
  }

  body.fit-printing .inv-cell-clip,
  body.fit-printing .inv-col-sticky,
  body.fit-printing .purchase-name,
  body.fit-printing .suppliers-name,
  body.fit-printing .income-name-cell,
  body.fit-printing .income-top-name,
  body.fit-printing .inv-dash .inv-table-compact .inv-cell-clip,
  body.fit-printing .inv-dash .inv-table-compact .inv-col-sticky {
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }

  /* كل الجداول عند التصدير: إطار مضغوط بعرض المحتوى */
  body.fit-printing .table-wrap,
  body.fit-printing .inv-table-frame,
  body.fit-printing [class*="-scroll"] {
    width: max-content !important;
    max-width: 100% !important;
  }

  body.fit-printing table.data-table tbody tr:nth-child(even) td {
    background: #f7fcfd !important;
  }

  /* تلوين الأعمدة بعد حتى الصفوف حتى لا تُمحى */
  body.fit-printing table.data-table thead th.inv-col-qty,
  body.fit-printing table.data-table td.inv-col-qty,
  body.fit-printing table.data-table tbody tr:nth-child(even) td.inv-col-qty {
    background: #ecfdf5 !important;
    color: #047857 !important;
  }

  body.fit-printing table.data-table thead th.inv-col-cost,
  body.fit-printing table.data-table td.inv-col-cost,
  body.fit-printing table.data-table tbody tr:nth-child(even) td.inv-col-cost {
    background: #fffbeb !important;
    color: #b45309 !important;
  }

  body.fit-printing table.data-table thead th.inv-col-share,
  body.fit-printing table.data-table td.inv-col-share,
  body.fit-printing table.data-table tbody tr:nth-child(even) td.inv-col-share {
    background: #ecfeff !important;
    color: #0891b2 !important;
  }

  body.fit-printing .sales-grand-row td {
    background: #0e7490 !important;
    color: #ffffff !important;
  }

  body.fit-printing .inv-table-foot .sales-grand-row td {
    background: #0e7490 !important;
    color: #ffffff !important;
  }

  body.fit-printing .inv-table-foot .sales-grand-row td.inv-col-qty {
    background: #ecfdf5 !important;
    color: #047857 !important;
  }

  body.fit-printing .inv-table-foot .sales-grand-row td.inv-col-cost {
    background: #fffbeb !important;
    color: #b45309 !important;
  }

  body.fit-printing .inv-table-foot .sales-grand-row td.inv-col-share {
    background: #ecfeff !important;
    color: #0891b2 !important;
  }

  /* PDF للوحة/جدول واحد فقط — يخفي كل ما عدا اللوحة المختارة وأسلافها */
  body.fit-printing[data-print-scope="panel"] .page.has-sidebar > *:not(main):not(.is-print-ancestor) {
    display: none !important;
  }

  body.fit-printing[data-print-scope="panel"] main > *:not(.is-print-ancestor):not(.is-print-target) {
    display: none !important;
  }

  body.fit-printing[data-print-scope="panel"] .is-print-ancestor > *:not(.is-print-ancestor):not(.is-print-target) {
    display: none !important;
  }

  body.fit-printing[data-print-scope="panel"] .dash-panel:not(.is-print-target) {
    display: none !important;
  }

  body.fit-printing[data-print-scope="panel"] .is-print-ancestor {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.fit-printing[data-print-scope="panel"] .is-print-target {
    display: block !important;
    width: max-content !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }

  body.fit-printing[data-print-scope="panel"] .is-print-target .inv-table-frame,
  body.fit-printing[data-print-scope="panel"] .is-print-target .table-wrap,
  body.fit-printing[data-print-scope="panel"] .is-print-target .inv-table-scroll,
  body.fit-printing[data-print-scope="panel"] .is-print-target [class*="-scroll"] {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    width: max-content !important;
    max-width: 100% !important;
  }

  body.fit-printing[data-print-scope="panel"] .dash-panel-head-actions,
  body.fit-printing[data-print-scope="panel"] .dash-pdf-btn {
    display: none !important;
  }

  body.fit-printing .dash-kpi-ico {
    box-shadow: none !important;
  }
}
