:root {
  --bg: #f7fcfd;
  --ink: #3a3d63;
  --muted: #6b858f;
  --line: #d7e8ec;
  --panel: #ffffff;
  --brand: #0891b2;
  --brand-dark: #0e7490;
  --brand-soft: #ecfeff;
  --brand-mid: #06b6d4;
  --ok: #059669;
  --ok-bg: #ecfdf5;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --radius: 12px;
  --shadow: 0 14px 34px rgba(8, 145, 178, 0.08);
  --font: "IBM Plex Sans Arabic", "Tajawal", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 76px;
  --fw: 700;
  --fw-strong: 800;
}

* { box-sizing: border-box; }

html {
  font-size: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: var(--fw);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 50% at 12% 0%, rgba(6, 182, 212, 0.12), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 90%, rgba(8, 145, 178, 0.07), transparent 55%),
    linear-gradient(165deg, #eef8fa 0%, #f7fcfd 45%, #eef8fa 100%);
  overflow-x: hidden;
}

.app-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.app-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.45;
  animation: login-drift 16s ease-in-out infinite alternate;
}

.app-orb-a {
  width: min(38vw, 260px);
  height: min(38vw, 260px);
  top: -6%;
  inset-inline-end: -4%;
  background: radial-gradient(circle at 35% 35%, #7eb0e8, transparent 68%);
}

.app-orb-b {
  width: min(30vw, 200px);
  height: min(30vw, 200px);
  bottom: 8%;
  inset-inline-start: -6%;
  background: radial-gradient(circle at 60% 40%, #8dceb0, transparent 70%);
  animation-delay: -5s;
}

.app-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(8, 145, 178, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 145, 178, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 30%, #000 15%, transparent 78%);
}

body.login-body .app-backdrop { display: none; }

.page {
  position: relative;
  z-index: 1;
  width: min(1600px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.35rem 0 2.5rem;
  animation: login-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.page.has-sidebar {
  width: min(1600px, calc(100% - var(--sidebar-w) - 2.5rem));
  margin-inline-start: calc(var(--sidebar-w) + 1.25rem);
  margin-inline-end: auto;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    margin-inline-start 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Icons */
.ico {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.ico.lg {
  width: 2.4rem;
  height: 2.4rem;
  color: var(--brand-mid);
}

.ico.ok { color: var(--ok); }
.ico.warn { color: var(--warn); }

/* Sidebar */
.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 40;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 0.85rem 1.1rem;
  border-inline-end: 1px solid rgba(201, 216, 234, 0.95);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(244, 249, 255, 0.94) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 8px 0 28px rgba(8, 145, 178, 0.07);
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.2rem 0.95rem;
  border-bottom: 1px solid rgba(201, 216, 234, 0.85);
  margin-bottom: 0.45rem;
}

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

.sidebar-brand .brand-copy { min-width: 0; flex: 1; }
.sidebar-brand .brand {
  font-size: 0.95rem;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.sidebar-brand .tagline {
  font-size: 0.78rem;
  margin-top: 0.15rem;
}
.sidebar-brand .brand-mark,
.sidebar-brand .brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
}

.sidebar-collapse,
.sidebar-close {
  display: none;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid #c5d5e8;
  border-radius: 10px;
  background: #fff;
  color: var(--brand-dark);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
}
.sidebar-collapse:hover,
.sidebar-close:hover {
  background: var(--brand-soft);
  border-color: #a9c0db;
}
.sidebar-collapse svg,
.sidebar-close svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 901px) {
  .sidebar-collapse {
    display: grid;
  }

  html.sidebar-collapsed {
    --sidebar-w: var(--sidebar-w-collapsed);
  }

  html.sidebar-collapsed .sidebar {
    padding-inline: 0.55rem;
  }

  html.sidebar-collapsed .sidebar-brand {
    flex-direction: column;
    gap: 0.55rem;
    padding-inline: 0.15rem;
  }

  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 .brand-mark,
  html.sidebar-collapsed .sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  html.sidebar-collapsed .app-hard-refresh {
    width: 2rem;
    height: 2rem;
  }

  html.sidebar-collapsed .sidebar-section-label,
  html.sidebar-collapsed .sidebar-link > span,
  html.sidebar-collapsed .sidebar-group-chevron {
    display: none;
  }

  html.sidebar-collapsed .sidebar-group-items {
    display: none !important;
  }

  html.sidebar-collapsed .sidebar-group.is-current > .sidebar-group-toggle {
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.12) 0%, rgba(8, 145, 178, 0.1) 100%);
    border-color: #a9c0db;
    color: var(--brand-dark);
    box-shadow: inset 0 -3px 0 var(--brand-mid);
  }

  html.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 0.78rem 0.45rem;
    gap: 0;
  }

  html.sidebar-collapsed .sidebar-link.is-active {
    box-shadow: inset 0 -3px 0 var(--brand-mid);
  }

  /* ????? ???? ?????? ????? ????? ??? ??????? */
  html.sidebar-collapsed .sidebar-collapse-ico {
    transform: scaleX(-1);
  }

  html[dir="rtl"] .sidebar-collapse-ico {
    transform: scaleX(-1);
  }

  html[dir="rtl"].sidebar-collapsed .sidebar-collapse-ico {
    transform: none;
  }
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.15rem 0;
}

.sidebar-section-label {
  margin: 0.2rem 0.55rem 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.68rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #234468;
  font: 700 0.92rem var(--font);
  text-decoration: none;
  text-align: start;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.sidebar-link > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sidebar-link:hover {
  background: rgba(232, 241, 251, 0.95);
  border-color: #c5d5e8;
  color: var(--brand-dark);
}

.sidebar-link.is-active {
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.12) 0%, rgba(8, 145, 178, 0.1) 100%);
  border-color: #a9c0db;
  color: var(--brand-dark);
  box-shadow: inset 3px 0 0 var(--brand-mid);
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-group-toggle {
  position: relative;
}

.sidebar-group-chevron {
  width: 0.95rem;
  height: 0.95rem;
  margin-inline-start: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.18s ease;
}

.sidebar-group.is-open > .sidebar-group-toggle .sidebar-group-chevron {
  transform: rotate(180deg);
}

.sidebar-group-items {
  display: none;
  flex-direction: column;
  gap: 0.18rem;
  padding-inline-start: 0.55rem;
  margin-inline-start: 0.55rem;
  border-inline-start: 2px solid #d5e3f2;
}

.sidebar-group.is-open > .sidebar-group-items {
  display: flex;
}

.sidebar-sublink {
  padding: 0.55rem 0.75rem;
  font-size: 0.86rem;
  border-radius: 12px;
  color: #35567a;
  align-items: flex-start;
}

.sidebar-sublink > span {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}

.sidebar-sublink .sidebar-ico {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.12rem;
  flex-shrink: 0;
}

.sidebar-group.is-current > .sidebar-group-toggle {
  background: rgba(232, 241, 251, 0.7);
  border-color: #d0deee;
  color: var(--brand-dark);
}

.sidebar-ico {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(201, 216, 234, 0.85);
}

.sidebar-action.btn-refresh {
  background: linear-gradient(135deg, #148f52 0%, #23b268 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(20, 143, 82, 0.22);
  justify-content: flex-start;
}
.sidebar-action.btn-refresh:hover {
  filter: brightness(1.05);
  color: #fff;
  border-color: transparent;
}

.sidebar-action.btn-logout {
  background: #fff8f8;
  border-color: #e2c0c0;
  color: #9d2525;
  justify-content: flex-start;
}
.sidebar-action.btn-logout:hover {
  background: #fdeaea;
  color: #9d2525;
}

.logout-form { margin: 0; width: 100%; }

.sidebar-open {
  display: none;
  position: fixed;
  top: 0.85rem;
  inset-inline-start: 0.85rem;
  z-index: 35;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  border: 1px solid rgba(201, 216, 234, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-dark);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.sidebar-open svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.app-hard-refresh {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid rgba(34, 158, 94, 0.45);
  border-radius: 10px;
  background: linear-gradient(135deg, #148f52 0%, #23b268 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(20, 143, 82, 0.22);
  cursor: pointer;
  flex-shrink: 0;
  transition: filter 0.18s ease, transform 0.15s ease;
}
.app-hard-refresh:hover {
  filter: brightness(1.06);
}
.app-hard-refresh:active {
  transform: scale(0.96);
}
.app-hard-refresh:disabled {
  opacity: 0.75;
  cursor: wait;
}
.app-hard-refresh svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-hard-refresh.is-spinning svg {
  animation: btn-refresh-spin 0.7s linear infinite;
}

/* سطح المكتب: داخل شعار الشريط فقط */
.app-hard-refresh--float {
  display: none;
}

.app-hard-refresh--brand {
  display: grid;
}

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(18, 37, 63, 0.38);
  backdrop-filter: blur(2px);
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #148f52 0%, #23b268 100%);
  color: #fff;
  font: 700 0.9rem var(--font);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(20, 143, 82, 0.24);
  transition: filter 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}

.btn-refresh:hover {
  filter: brightness(1.06);
  box-shadow: 0 10px 22px rgba(20, 143, 82, 0.3);
}
.btn-refresh:active { transform: scale(0.97); }
.btn-refresh.is-spinning svg,
.btn-refresh.is-spinning .sidebar-ico { animation: btn-refresh-spin 0.7s linear infinite; }

.scroll-edge-btn {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 90;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(160deg, #0e7490, #06b6d4);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 40, 80, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scroll-edge-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 40, 80, 0.45);
}

.scroll-edge-btn svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.scroll-edge-btn.is-up svg {
  transform: rotate(180deg);
}

@media (max-width: 720px) {
  .scroll-edge-btn {
    bottom: 1rem;
    left: 1rem;
    width: 2.4rem;
    height: 2.4rem;
  }
}
.btn-refresh svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #e2c0c0;
  border-radius: 12px;
  background: #fff8f8;
  color: #9d2525;
  font: 700 0.9rem var(--font);
  cursor: pointer;
  transition: background 0.18s ease;
}

.btn-logout:hover { background: #fdeaea; }
.btn-logout svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Login — Arctic white / brand contemporary */
body.login-body {
  min-height: 100dvh;
  min-height: 100svh;
  background:
    radial-gradient(ellipse 70% 55% at 100% -5%, rgba(6, 182, 212, 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%);
  color: #1a2b33;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

.login-page .topbar,
.login-page .sidebar,
.login-page .sidebar-open,
.login-page .app-hard-refresh,
.login-page .sidebar-scrim { display: none !important; }
.login-page main { width: 100%; padding: 0; }

.login-shell {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  animation: login-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-welcome {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
  color: #e8eefc;
  background: #07101f;
  overflow: hidden;
  border-inline-end: 1px solid rgba(103, 232, 249, 0.12);
}

.login-welcome-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.login-welcome-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.04);
  animation: login-media- ken 22s ease-in-out infinite alternate;
}

.login-welcome-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 16, 31, 0.28) 0%, rgba(7, 16, 31, 0.55) 42%, rgba(7, 16, 31, 0.92) 100%),
    linear-gradient(90deg, rgba(7, 16, 31, 0.35), transparent 55%);
  pointer-events: none;
}

.login-welcome-glow {
  position: absolute;
  width: min(58vw, 420px);
  height: min(58vw, 420px);
  top: -18%;
  inset-inline-end: -12%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(103, 232, 249, 0.22), transparent 68%);
  animation: login-drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

.login-welcome-grid {
  display: none;
}

.login-welcome-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.8rem, 5.5vw, 3.4rem) clamp(1.6rem, 5vw, 3.4rem) clamp(2rem, 5vw, 3.6rem);
  max-width: 38rem;
}

.login-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  margin: 0 0 1.15rem;
  padding: 0.35rem 0.7rem 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  background: rgba(8, 18, 40, 0.55);
  color: #67E8F9;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

.login-kicker-ico {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(103, 232, 249, 0.16);
  color: #67E8F9;
}

.login-kicker-ico svg {
  width: 0.78rem;
  height: 0.78rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 0 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  background: linear-gradient(145deg, rgba(16, 25, 51, 0.9), rgba(10, 18, 41, 0.95));
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(103, 232, 249, 0.12),
    0 14px 28px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(103, 232, 249, 0.2);
  animation: login-mark-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
  user-select: none;
}

.login-mark svg {
  width: 1.85rem;
  height: 1.85rem;
}

.login-mark .brand-bar {
  fill: #67E8F9;
}

.login-brand {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #F2F5FF;
  font-family: "Tajawal", "IBM Plex Sans Arabic", sans-serif;
  font-size: clamp(2.1rem, 4.8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.login-hello {
  position: relative;
  z-index: 1;
  margin: 0.75rem 0 0;
  color: #67E8F9;
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  font-weight: 800;
}

.login-lead {
  position: relative;
  z-index: 1;
  max-width: 32rem;
  margin: 0.85rem 0 0;
  color: #B8C0DC;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.75;
}

.login-points {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  list-style: none;
  margin: 1.55rem 0 0;
  padding: 0;
  max-width: 34rem;
}

.login-points li {
  padding: 0.42rem 0.72rem;
  border-radius: 10px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  background: rgba(10, 18, 41, 0.55);
  color: #D7DDF5;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(6px);
}

.login-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(1.5rem, 4.5vw, 3rem) clamp(1.2rem, 3.5vw, 2.5rem);
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(103, 232, 249, 0.08), transparent 58%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(55, 210, 111, 0.06), transparent 50%),
    #0a1229;
  color: #D7DDF5;
}

.login-card {
  width: min(100%, 420px);
  padding: clamp(1.45rem, 3.5vw, 2.1rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.05), transparent 42%),
    rgba(16, 25, 51, 0.92);
  box-shadow:
    0 0 0 1px rgba(77, 141, 255, 0.1),
    0 18px 40px rgba(0, 0, 0, 0.35);
  animation: login-mark-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
  backdrop-filter: blur(10px);
}

.login-brand-block {
  text-align: start;
  margin-bottom: 1.35rem;
}

.login-panel-kicker {
  margin: 0 0 0.45rem;
  color: #67E8F9;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.login-panel-title {
  margin: 0;
  color: #F2F5FF;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.3;
}

.login-tagline {
  margin: 0.4rem 0 0;
  color: #8F99B7;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
}

.login-error {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 12px;
  background: rgba(127, 29, 29, 0.35);
  color: #fecdd3;
  font-weight: 700;
  font-size: 0.92rem;
  animation: login-shake 0.4s ease;
}

.login-error .ico {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #fecdd3;
}

.login-form {
  display: grid;
  gap: 1rem;
  text-align: start;
}

.login-field label {
  display: block;
  margin-bottom: 0.4rem;
  color: #B8C0DC;
  font-weight: 800;
  font-size: 0.9rem;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-field-ico {
  position: absolute;
  inset-inline-start: 0.9rem;
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: #8F99B7;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke 0.2s ease;
}

.login-form input {
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 0.95rem;
  padding-inline-start: 2.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(8, 14, 32, 0.72);
  color: #F2F5FF;
  font: 600 max(16px, 1rem) var(--font);
  direction: ltr;
  text-align: start;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-form input:hover {
  border-color: rgba(103, 232, 249, 0.35);
}

.login-form input:focus {
  border-color: #67E8F9;
  background: rgba(10, 18, 41, 0.95);
  outline: none;
  box-shadow: 0 0 0 4px rgba(103, 232, 249, 0.18);
}

.login-input-wrap:focus-within .login-field-ico {
  stroke: #67E8F9;
}

.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 52px;
  margin-top: 0.35rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #22d3ee 0%, #0891b2 48%, #0e7490 100%);
  color: #fff;
  font: 800 1.02rem var(--font);
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(8, 145, 178, 0.35);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.login-submit:hover {
  filter: brightness(1.06);
  box-shadow: 0 14px 30px rgba(34, 211, 238, 0.35);
}

.login-submit:active {
  transform: translateY(1px) scale(0.985);
}

.login-submit svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes login-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes login-mark-in {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes login-drift {
  from { transform: translate(0, 0); }
  to { transform: translate(-14px, 20px); }
}

@keyframes login-media-ken {
  from { transform: scale(1.02) translate(0, 0); }
  to { transform: scale(1.08) translate(-1.2%, 1%); }
}

@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (max-width: 900px) {
  body.login-body {
    min-height: 100dvh;
    min-height: 100svh;
  }

  .login-page,
  .login-page main {
    min-height: 100dvh;
    min-height: 100svh;
  }

  .login-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100dvh;
    min-height: 100svh;
  }

  .login-welcome {
    min-height: 15.5rem;
    padding: 0;
    border-inline-end: 0;
    border-bottom: 1px solid rgba(103, 232, 249, 0.12);
  }

  .login-welcome-copy {
    padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.25rem 1.15rem;
    max-width: none;
  }

  .login-welcome-glow {
    width: 220px;
    height: 220px;
    top: -40%;
    inset-inline-end: -20%;
  }

  .login-kicker {
    margin-bottom: 0.65rem;
    font-size: 0.72rem;
  }

  .login-mark {
    width: 48px;
    height: 48px;
    margin-bottom: 0.65rem;
    border-radius: 14px;
  }

  .login-mark svg {
    width: 1.4rem;
    height: 1.4rem;
  }

  .login-brand {
    font-size: 1.55rem;
  }

  .login-hello {
    margin-top: 0.35rem;
    font-size: 0.98rem;
  }

  .login-lead,
  .login-points {
    display: none;
  }

  .login-panel {
    flex: 1 1 auto;
    justify-content: flex-start;
    align-items: stretch;
    padding: 0 0 calc(1.2rem + env(safe-area-inset-bottom, 0px));
    background: #0a1229;
  }

  .login-card {
    width: 100%;
    max-width: none;
    border: 0;
    border-radius: 1.35rem 1.35rem 0 0;
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.28);
    padding: 1.35rem 1.2rem 1.5rem;
    animation: none;
  }

  .login-brand-block {
    margin-bottom: 1.1rem;
  }

  .login-panel-title {
    font-size: 1.28rem;
  }

  .login-tagline {
    font-size: 0.9rem;
  }

  .login-form {
    gap: 0.85rem;
  }

  .login-form input,
  .login-submit {
    min-height: 48px;
  }

  .login-submit {
    touch-action: manipulation;
  }
}

@media (max-width: 900px) and (max-height: 560px) and (orientation: landscape) {
  .login-shell {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-rows: 1fr;
  }

  .login-welcome {
    justify-content: flex-end;
    min-height: 0;
    border-bottom: 0;
    border-inline-end: 1px solid rgba(103, 232, 249, 0.12);
  }

  .login-welcome-copy {
    padding: 1rem calc(1rem + env(safe-area-inset-inline-start, 0px)) 1rem 1rem;
  }

  .login-hello,
  .login-lead,
  .login-points {
    display: none;
  }

  .login-panel {
    background: #0a1229;
    padding: 0.75rem;
  }

  .login-card {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    padding: 1rem;
  }
}

@media (max-width: 380px) {
  .login-welcome-copy {
    padding-inline: 1rem;
  }

  .login-card {
    padding-inline: 1rem;
  }

  .login-brand {
    font-size: 1.35rem;
  }

  .login-tagline {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-welcome-media img,
  .login-welcome-glow,
  .login-mark,
  .login-card,
  .login-shell {
    animation: none !important;
  }
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 10px 20px rgba(8, 145, 178, 0.25);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  user-select: none;
}

.brand {
  margin: 0;
  font-size: clamp(1.35rem, 3.5vw, 1.7rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #12345f;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

/* Search */
.search-box {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 216, 234, 0.95);
  border-radius: 22px;
  padding: 0;
  overflow: visible;
  box-shadow: var(--shadow);
}

.search-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.15rem;
  background: linear-gradient(180deg, rgba(243, 248, 255, 0.95) 0%, rgba(234, 242, 252, 0.75) 100%);
  border-bottom: 1px solid rgba(201, 216, 234, 0.85);
  border-radius: 22px 22px 0 0;
}

.search-head h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  color: #12345f;
}

.search-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.search-form {
  display: flex;
  gap: 0.8rem;
  align-items: flex-end;
  padding: 1.1rem 1.15rem;
  position: relative;
  z-index: 4;
}

.warehouse-field {
  flex: 0 1 20rem;
  min-width: 14rem;
  max-width: 24rem;
  position: relative;
  z-index: 6;
}

.scope-toggle {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  padding: 0.2rem;
  border: 1px solid #c5d5e8;
  border-radius: 12px;
  background: #f3f7fc;
  position: relative;
  z-index: 8;
  width: fit-content;
  min-width: 0;
  max-width: none;
  flex: 0 0 auto;
  align-self: flex-start;
  box-sizing: border-box;
}

.scope-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  color: #3d5a7a;
  user-select: none;
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
  box-sizing: border-box;
}

.scope-option input[type="radio"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #12345f;
  cursor: pointer;
  flex: 0 0 auto;
}

.scope-option.is-active {
  background: #12345f;
  color: #fff;
  box-shadow: 0 1px 0 rgba(18, 52, 95, 0.25);
}

.scope-option.is-active input[type="radio"] {
  accent-color: #fff;
}

.scope-field {
  flex: 0 0 auto !important;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  position: relative;
  z-index: 8;
  align-items: flex-start;
}

.scope-field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #2a4566;
}

.scope-field-label .ico {
  color: var(--brand-mid);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #2a4566;
}

.field label .ico {
  color: var(--brand-mid);
}

.toolbar .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.browse-form .btn-primary {
  align-self: flex-end;
}

@media (max-width: 720px) {
  .group-field { flex: 1 1 100%; }
}

.select-shell {
  position: relative;
  display: block;
}

.select-shell .warehouse-select,
.search-form .warehouse-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid #c5d5e8;
  border-radius: 14px;
  padding: 0.82rem 2.4rem 0.82rem 0.95rem;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  background: rgba(251, 253, 255, 0.95);
  color: #143a6b;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-box .inv-select {
  position: relative;
  width: 100%;
  z-index: 1;
}

.search-box .inv-select.is-open {
  z-index: 80;
}

.search-box .inv-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.search-box .inv-select-trigger {
  width: 100%;
  min-height: 3.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem 0.7rem 0.95rem;
  border: 1px solid #c5d5e8;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font: 700 0.95rem var(--font);
  color: #143a6b;
  cursor: pointer;
  text-align: right;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box .inv-select-trigger:hover {
  border-color: #9bb6d6;
  background: #fff;
}

.search-box .inv-select.is-open .inv-select-trigger {
  border-color: #06b6d4;
  box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.14);
}

.search-box .inv-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-box .inv-select-caret {
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  color: #1f4f8a;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.search-box .inv-select-caret svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-box .inv-select.is-open .inv-select-caret {
  transform: rotate(180deg);
}

.search-box .inv-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 18rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.35rem;
  border: 1px solid #c5d5e8;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 16px 36px rgba(18, 52, 95, 0.18),
    0 2px 0 rgba(255, 255, 255, 0.8) inset;
  backdrop-filter: blur(10px);
}

.search-box .inv-select-option {
  display: block;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #1a3358;
  font: 700 0.9rem var(--font);
  text-align: right;
  cursor: pointer;
}

.search-box .inv-select-option:hover {
  background: rgba(232, 241, 251, 0.95);
}

.search-box .inv-select-option.is-selected {
  background: rgba(8, 145, 178, 0.12);
  color: #0891b2;
}

.select-shell .warehouse-select:hover {
  border-color: #a9c0db;
  background: #fff;
}

.select-shell .warehouse-select:focus {
  outline: none;
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.14);
  background: #fff;
}

.select-chevron {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  color: #1f4f8a;
  pointer-events: none;
  display: grid;
  place-items: center;
}

.select-chevron svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.query-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.query-row input {
  flex: 1;
  min-width: 0;
}

.btn-scan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  flex-shrink: 0;
  border: 1px solid #f0b4b0;
  border-radius: 14px;
  background: rgba(255, 235, 234, 0.95);
  color: #c62828;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.btn-scan:hover {
  background: #ffd9d6;
  border-color: #e57373;
  color: #b71c1c;
}

.btn-scan:active { transform: scale(0.97); }

.btn-scan .ico {
  width: 1.25rem;
  height: 1.25rem;
}

.search-form input,
.search-form select {
  width: 100%;
  border: 1px solid #c5d5e8;
  border-radius: 14px;
  padding: 0.82rem 0.95rem;
  font: inherit;
  font-size: 1rem;
  background: rgba(251, 253, 255, 0.95);
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-form input:focus,
.search-form select:focus {
  outline: none;
  border-color: var(--brand-mid);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.14);
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.18s ease, background 0.18s ease, transform 0.15s ease;
}

.btn-primary {
  border: 0;
  padding: 0.85rem 1.3rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(8, 145, 178, 0.2);
}

.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: translateY(1px) scale(0.985); }

.btn-ghost {
  border: 1px solid #c5d5e8;
  padding: 0.55rem 0.95rem;
  color: var(--brand);
  background: rgba(232, 241, 251, 0.95);
  font-size: 0.92rem;
}

.btn-ghost:hover { background: #d9e9fb; }

#sync-btn {
  color: var(--brand-dark);
}

#sync-btn .ico {
  color: var(--brand-mid);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0;
  padding: 0.9rem 1.15rem;
  border-top: 1px solid rgba(201, 216, 234, 0.85);
  background: rgba(248, 251, 255, 0.75);
}

.sync-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.sync-secret-input {
  border: 1px solid #c5d5e8;
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-size: 0.88rem;
  min-width: 130px;
  background: #fff;
}

.sync-secret-input:focus {
  outline: none;
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

.cache-meta {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #c5d5e8;
  background: rgba(232, 241, 251, 0.95);
  color: #143a6b;
  font-size: 0.88rem;
  font-weight: 600;
}

.cache-meta .ico { color: var(--brand); }
.cache-meta.is-ready {
  color: #145a38;
  background: var(--ok-bg);
  border-color: #b7dfc8;
}
.cache-meta.is-ready .ico { color: var(--ok); }
.cache-meta.is-empty {
  background: var(--warn-bg);
  border-color: #f0d5a0;
  color: #8a5a00;
}
.cache-meta.is-empty .ico { color: var(--warn); }

/* Alerts */
.alert {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 500;
  box-shadow: var(--shadow);
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f3c2bf;
}

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f3c2bf;
}

.alert-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #b7dfc8;
}

/* Results */
.results {
  margin-top: 1.1rem;
  display: grid;
  gap: 0.9rem;
}

.match-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  padding: 0;
}

.match-card-simple {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: #f3f8ff;
}

.match-card-simple .match-code,
.match-card-simple .match-name {
  margin: 0;
}

.match-card-simple .match-code {
  font-size: 1.35rem;
}

.match-card-simple .match-name {
  flex: 1;
}

.match-warehouse {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.result-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.result-hero-main {
  min-width: 0;
}

.result-hero-code {
  margin: 0;
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 800;
  color: #c62828;
  line-height: 1.2;
}

.result-hero-name {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #12253f;
}

.result-hero-side {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #eef5ff;
  border: 1px solid #c5daf5;
  color: #143a6b;
  font-size: 0.84rem;
  font-weight: 600;
}

.result-prices .result-hero-side .result-pill {
  background: #c62828;
  border-color: #b71c1c;
  color: #fff;
}

.result-prices .result-hero-side .result-pill.mono {
  background: #2e7d32;
  border-color: #1b5e20;
  color: #fff;
}

.results-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  border-radius: 16px;
  box-shadow: 0 12px 26px rgba(8, 145, 178, 0.2);
}

.results-topbar-title {
  color: #fff;
  font-size: 0.98rem;
  font-weight: 700;
}

.results-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.browse-excel-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1px solid #86efac;
  color: #166534;
  font-weight: 700;
  text-decoration: none;
}

.browse-excel-btn:hover {
  background: #dcfce7;
  color: #14532d;
}

.browse-excel-btn .ico {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.btn-new-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.95rem;
  border-radius: 12px;
  background: #fff;
  color: #143a6b;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-new-search:hover { filter: brightness(0.98); }
.btn-new-search:active { transform: scale(0.97); }

.result-combined-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.result-combined-copy {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.65rem;
  flex: 1;
  min-width: 0;
}

.result-combined-label {
  flex-basis: 100%;
  color: var(--brand-mid);
  font-size: 0.78rem;
  font-weight: 700;
}

.result-combined-code {
  color: #c62828;
  font-size: 1.25rem;
}

.result-combined-name {
  color: #12253f;
  font-size: 1rem;
  font-weight: 700;
}

.item-suppliers {
  margin: 0.85rem 1.1rem 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(18, 37, 63, 0.1);
}

.item-suppliers-inline {
  margin: 0 1.1rem 0.75rem;
}

.item-suppliers-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.item-suppliers-title {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  border-radius: 8px;
  background: #ecfeff;
  border: 1px solid #c5d5e8;
  color: #12345f;
  font-size: 0.82rem;
  font-weight: 800;
}

.item-suppliers-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #c62828;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.item-suppliers-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.item-suppliers-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.7rem;
  padding: 0.45rem 0.65rem;
  background: rgba(18, 37, 63, 0.03);
  border-radius: 8px;
}

.item-supplier-name {
  color: #12253f;
  font-weight: 700;
  font-size: 0.92rem;
}

.item-supplier-code {
  color: #1b7a45;
  font-size: 0.8rem;
  font-weight: 700;
}

.item-supplier-date {
  margin-inline-start: auto;
  color: #c62828;
  font-size: 0.78rem;
  font-weight: 700;
}

.item-supplier-main {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #1a7a4c;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.page.results-focus .search-box,
.page.results-focus .alert {
  display: none !important;
}

/* ????? ????? ????? ?????? ??? ?????? ?? ???? ??????? */
.page.results-focus.search-keep-form .search-box {
  display: block !important;
  margin-bottom: 0.75rem;
  position: sticky;
  top: 0.55rem;
  z-index: 60;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 8px 24px rgba(18, 52, 95, 0.12),
    0 0 0 1px rgba(201, 216, 234, 0.9);
}

.page.results-focus.search-keep-form .search-box .search-head {
  display: none;
}

.page.results-focus.search-keep-form .search-box .toolbar {
  display: none;
}

.page.results-focus.search-keep-form .search-form {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.7rem;
  padding: 0.7rem 0.85rem;
}

.page.results-focus.search-keep-form .scope-field,
.page.results-focus.search-keep-form .warehouse-field,
.page.results-focus.search-keep-form .query-field {
  flex: 0 1 auto;
}

.page.results-focus.search-keep-form .query-field {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.page.results-focus.search-keep-form .warehouse-field {
  flex: 0 1 14rem;
  min-width: 11rem;
  max-width: 18rem;
}

.page.results-focus.search-keep-form .btn-primary {
  width: auto;
  flex: 0 0 auto;
  padding: 0.7rem 1.1rem;
}

.page.results-focus .results {
  margin-top: 0;
  clear: both;
}

.matched-unit {
  background: linear-gradient(180deg, #ecf8f1 0%, #ffffff 70%);
  border: 1px solid #b7dfc8;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.95rem 1.1rem 1.1rem;
}

.matched-unit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.matched-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: #1a7a4c;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.matched-barcode {
  color: #143a6b;
  font-size: 0.95rem;
  font-weight: 700;
}

.matched-unit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.matched-stat {
  background: #fff;
  border: 1px solid #d7e8f8;
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
}

.matched-stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.matched-stat strong {
  font-size: 1.15rem;
  color: #12253f;
}

.matched-stat-price {
  border-color: #c5daf5;
  background: #f3f8ff;
}

.matched-stat-price strong {
  color: #143a6b;
  font-size: 1.35rem;
}

.matched-stat-qty {
  border-color: #b7dfc8;
  background: #f3fbf6;
}

.matched-stat-qty strong {
  color: #0d5c38;
}

.price-table th {
  white-space: nowrap;
}

.warehouse-compare-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #9eb4ce;
}

.warehouse-compare-table th,
.warehouse-compare-table td {
  font-size: 0.88rem;
  padding: 0.38rem 0.55rem;
  line-height: 1.25;
  vertical-align: middle;
  border: 1px solid #b7c9de;
  background: #fff;
}

.warehouse-compare-table thead th {
  font-size: 0.8rem;
  padding: 0.42rem 0.55rem;
  background: #f7fcfd;
  color: #12345f;
  font-weight: 800;
  border-color: #9eb4ce;
}

.warehouse-compare-wh {
  min-width: 0;
}

.warehouse-compare-table .warehouse-compare-name {
  display: inline-block;
  max-width: 100%;
  padding: 0.12rem 0.45rem;
  border-radius: 7px;
  background: #ecfeff;
  border: 1px solid #c5d5e8;
  font-size: 0.88rem;
  font-weight: 800;
  color: #12345f;
  margin: 0;
  vertical-align: middle;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-compare-table .warehouse-compare-code {
  display: inline;
  font-size: 0.78rem;
  font-weight: 700;
  color: #c62828;
  margin-inline-start: 0.35rem;
  vertical-align: middle;
  white-space: nowrap;
}

.warehouse-compare-wh {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.warehouse-compare-table tbody tr:nth-child(even) td {
  background: #f7fafc;
}

.warehouse-compare-table tbody tr:hover td {
  background: #eef5fc;
}

.warehouse-compare-table tr.is-empty td {
  opacity: 0.72;
}

.warehouse-compare-table .price-cell,
.warehouse-compare-table .cost-cell,
.warehouse-compare-table .qty-cell,
.warehouse-compare-table .buy-cell,
.warehouse-compare-table .unit-cell {
  white-space: nowrap;
  font-weight: 700;
}

.warehouse-compare-table .unit-cell {
  font-weight: 800;
  color: #12345f;
}

.warehouse-compare-table .price-cell {
  color: #12345f;
}

.warehouse-compare-table .buy-cell {
  color: #c62828;
}

.warehouse-compare-table .cost-cell {
  color: #1b7a45;
}

.is-matched-row td {
  background: #eef9f2 !important;
}

.chip-matched {
  background: #1a7a4c;
  color: #fff;
  border-color: #1a7a4c;
}

.row-tag {
  display: inline-block;
  margin-inline-start: 0.4rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #ffe8a8;
  color: #7a5a00;
  font-size: 0.72rem;
  font-weight: 800;
}

.match-head {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, #f3f8ff 0%, #eaf2fc 100%);
  border-bottom: 1px solid var(--line);
}

.match-top {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem 1.1rem 0.2rem;
}

.match-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.match-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.match-copy {
  min-width: 0;
}

.match-label {
  margin: 0;
  color: var(--brand-mid);
  font-size: 0.9rem;
  font-weight: 700;
}

.match-code {
  margin: 0.2rem 0 0;
  font-family: var(--mono);
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  color: #c62828;
}

.match-name {
  margin: 0.35rem 0 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: #000;
}

.match-meta {
  margin: 0;
  padding: 0.85rem 1.1rem 1.05rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: #f8fbff;
  border-top: 1px solid var(--line);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #c5daf5;
  color: #143a6b;
  font-size: 0.86rem;
  font-weight: 500;
}

.meta-pill svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.meta-pill strong {
  font-weight: 800;
  color: var(--brand);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background-image: linear-gradient(180deg, #f3f8ff 0%, #ffffff 100%);
}

.section-title .panel-ico {
  margin: 0;
}

.section-title h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #143a6b;
}

.section-title p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(201, 216, 234, 0.95);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.panel-blue .panel-head {
  background: linear-gradient(180deg, rgba(243, 248, 255, 0.95) 0%, rgba(234, 242, 252, 0.8) 100%);
  border-bottom: 1px solid rgba(201, 216, 234, 0.85);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.7rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.panel-ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 16px rgba(8, 145, 178, 0.2);
}

.panel-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #143a6b;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  margin-inline-start: auto;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  min-width: 0;
  max-width: 100%;
}

.table-wrap::after {
  display: none !important;
  content: none !important;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 920px;
}

.data-table th,
.data-table td {
  padding: 0.85rem 1rem;
  text-align: right;
  border-bottom: 1px solid #e4ecf5;
  vertical-align: middle;
}

.data-table th {
  font-size: 0.78rem;
  color: var(--brand);
  background: #f5f9ff;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.data-table th .th-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-inline-end: 0.28rem;
  vertical-align: -0.2rem;
  color: var(--brand-mid);
}

.data-table th .th-ico svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.data-table tbody tr:hover td {
  background: #eef5ff;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

/* ???? ???? ????? ?????? ??????? ? ??? ????? data-table ??? ?? ????? */
.warehouse-compare-table.data-table {
  border-collapse: collapse;
  border-spacing: 0;
  min-width: 0;
  border: 1px solid #9eb4ce;
}

.warehouse-compare-table.data-table th,
.warehouse-compare-table.data-table td {
  border: 1px solid #b7c9de;
  border-bottom: 1px solid #b7c9de;
  padding: 0.38rem 0.55rem;
  font-size: 0.88rem;
  background: #fff;
}

.warehouse-compare-table.data-table thead th {
  background: #f7fcfd;
  border-color: #9eb4ce;
  font-size: 0.8rem;
  padding: 0.42rem 0.55rem;
}

.warehouse-compare-table.data-table tbody tr:nth-child(even) td {
  background: #f7fafc;
}

.warehouse-compare-table.data-table tbody tr:hover td {
  background: #eef5fc;
}

.warehouse-compare-table.data-table tbody tr:last-child td {
  border-bottom: 1px solid #b7c9de;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.9em;
}

.highlight-code {
  font-weight: 700;
  color: #c62828;
}

.name-cell {
  color: #000;
  font-weight: 600;
}

.gcode-cell {
  color: var(--brand);
  font-weight: 700;
}

.chip {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: #fdecea;
  color: #c62828;
  border: 1px solid #f3c2bf;
  font-size: 0.86rem;
  font-weight: 700;
}

.chip-group {
  background: #e8f6ee;
  color: #1a7a4c;
  border-color: #b7dfc8;
}

.price-cell { font-weight: 700; color: #143a6b; }
.cost-cell { font-weight: 700; color: #6b4f1f; }
.money {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  white-space: nowrap;
}
.sar-symbol {
  width: 0.95em;
  height: 1.05em;
  flex: 0 0 auto;
  color: inherit;
  vertical-align: -0.12em;
}

.page.sales-dash .money,
.page.sales-dash .sales-amt .money,
.page.sales-dash .dash-kpi-value .money,
.page.sales-dash .dash-kpi-hint .money,
.page.sales-dash .branch-chart-amt .money,
.page.sales-dash .branch-donut-legend-meta .money {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  white-space: nowrap;
}

.page.sales-dash .dash-kpi-value .sar-symbol {
  width: 0.7em;
  height: 0.78em;
}

.page.sales-dash .dash-kpi-hint .sar-symbol,
.page.sales-dash .sales-amt .sar-symbol,
.page.sales-dash .branch-chart-amt .sar-symbol {
  width: 0.82em;
  height: 0.92em;
}
.qty-cell { font-weight: 700; color: #0d5c38; }
.expected-qty-cell { font-weight: 800; color: #148f52; }
.expected-qty-cell.is-low { color: #b06a00; }
.expected-qty-cell.is-neg { color: #c62828; }

.empty-state {
  text-align: center;
  padding: 2.2rem 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background-image: linear-gradient(180deg, #f5f9ff 0%, #ffffff 55%);
}

.empty-title {
  margin: 0.55rem 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #143a6b;
}

.empty-state p:last-child {
  margin: 0;
  color: var(--muted);
}

.name-results .panel-head {
  align-items: flex-start;
}

.name-results .panel-sub {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Browse loading ? ???? ???? ???? */
.browse-loading {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 35, 65, 0.28);
  backdrop-filter: blur(2px);
}

.browse-loading[hidden] {
  display: none !important;
}

.browse-loading-card {
  width: min(280px, 92vw);
  background: #fff;
  border-radius: 12px;
  border: 1px solid #d7e3f2;
  box-shadow: 0 10px 28px rgba(20, 58, 107, 0.14);
  padding: 0.85rem 1rem 0.75rem;
  text-align: center;
}

.browse-loading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.browse-loading-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0891b2;
}

.browse-loading-label {
  margin: 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: #5a7290;
  font-variant-numeric: tabular-nums;
}

.browse-loading-track {
  height: 6px;
  border-radius: 999px;
  background: #e8eef6;
  overflow: hidden;
}

.browse-loading-fill {
  height: 100%;
  width: 1%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0891b2, #06b6d4);
}

.browse-loading.is-active .browse-loading-fill {
  animation: browse-fill-progress 25s cubic-bezier(0.15, 0.6, 0.35, 1) forwards;
}

@keyframes browse-fill-progress {
  0% { width: 1%; }
  25% { width: 55%; }
  55% { width: 78%; }
  100% { width: 96%; }
}

.browse-loading-cancel {
  margin-top: 0.65rem;
  border: 0;
  background: transparent;
  color: #6b849f;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
}

.browse-loading-cancel:hover {
  color: #b3261e;
}

/* ?????? ? ??????? ???? */
body.sales-dash-body {
  background: #fff;
}

body.sales-dash-body .app-backdrop {
  display: none;
}

.page.sales-dash {
  width: min(1600px, calc(100% - var(--sidebar-w) - 2rem));
  max-width: calc(100% - 1.25rem);
  min-width: 0;
  background: #fff;
}

.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.dash-head-copy h2 {
  margin: 0 0 0.2rem;
  color: #12345f;
  font-size: 1.45rem;
}

.dash-head-copy p {
  margin: 0;
  color: #6a809c;
  font-size: 0.9rem;
}

.dash-filter {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.dash-filter .field {
  margin: 0;
}

.dash-filter label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #5a7394;
  margin-bottom: 0.25rem;
}

.dash-filter input[type="date"],
.dash-filter select {
  min-height: 2.55rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid #c5d5e8;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font: 600 0.92rem var(--font);
}

.dash-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.page.sales-dash .dash-kpi {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.page.sales-dash .dash-kpi > .dash-kpi-card {
  min-height: 7.5rem;
  height: auto;
  min-width: 0;
  padding: 1.1rem 1.05rem;
  gap: 0.4rem;
  box-sizing: border-box;
  justify-content: flex-start;
  overflow: visible;
}

.page.sales-dash .dash-kpi .dash-kpi-label {
  font-size: 0.8rem;
  width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
  align-items: flex-start;
}

.page.sales-dash .dash-kpi .dash-kpi-label-text {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.page.sales-dash .dash-kpi .dash-kpi-rank {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.28rem;
  margin-inline-start: auto;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: #12345f;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.page.sales-dash .dash-kpi-glass-visit .dash-kpi-rank { background: #be123c; }
.page.sales-dash .dash-kpi-glass-item-amt .dash-kpi-rank { background: #15803d; }
.page.sales-dash .dash-kpi-glass-item-qty .dash-kpi-rank { background: #0891b2; }
.page.sales-dash .dash-kpi-glass-item-ret .dash-kpi-rank { background: #b91c1c; }

.page.sales-dash .dash-kpi .dash-kpi-ico {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 9px;
}

.page.sales-dash .dash-kpi .dash-kpi-ico svg {
  width: 0.92rem;
  height: 0.92rem;
}

.page.sales-dash .dash-kpi .dash-kpi-value {
  font-size: 1.12rem;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.page.sales-dash .dash-kpi .dash-kpi-value:not(.mono) {
  font-size: 0.98rem;
}

.page.sales-dash .dash-kpi .dash-kpi-hint {
  font-size: 0.78rem;
  width: 100%;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.page.sales-dash .dash-kpi-glass-item-ret .dash-kpi-hint {
  color: #c62828;
}

.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,
.page.sales-dash .dash-kpi-glass-visit .dash-kpi-value {
  font-size: 0.9rem;
  line-height: 1.4;
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.dash-kpi-card .dash-kpi-value:not(.mono) {
  font-size: 1.05rem;
}

.dash-kpi-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(165deg, #fff 0%, #f3f7fc 100%);
  border: 1px solid #d5e3f2;
  border-radius: 18px;
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.dash-kpi-glass {
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 10px 28px rgba(18, 52, 95, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dash-kpi-glass::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.dash-kpi-glass::after {
  content: "";
  position: absolute;
  inset: auto -30% -45% auto;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.dash-kpi-glass > * {
  position: relative;
  z-index: 1;
}

.dash-kpi-glass:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 34px rgba(18, 52, 95, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.dash-kpi-glass-pos {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(210, 230, 255, 0.28)),
    linear-gradient(160deg, rgba(8, 145, 178, 0.22), rgba(8, 145, 178, 0.12));
}

.dash-kpi-glass-returns {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(255, 220, 220, 0.35)),
    linear-gradient(160deg, rgba(198, 40, 40, 0.2), rgba(183, 28, 28, 0.12));
}

.dash-kpi-glass-wholesale {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(230, 235, 242, 0.3)),
    linear-gradient(160deg, rgba(107, 124, 147, 0.22), rgba(68, 84, 104, 0.12));
}

.dash-kpi-glass-total,
.dash-kpi-accent {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(200, 228, 255, 0.35)),
    linear-gradient(160deg, rgba(63, 143, 216, 0.28), rgba(29, 107, 184, 0.16));
  border-color: rgba(183, 207, 234, 0.7);
}

.dash-kpi-glass-sellers {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(220, 232, 255, 0.3)),
    linear-gradient(160deg, rgba(91, 141, 239, 0.24), rgba(58, 102, 199, 0.12));
}

.dash-kpi-glass-devices {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(210, 245, 228, 0.3)),
    linear-gradient(160deg, rgba(35, 178, 104, 0.22), rgba(20, 143, 82, 0.12));
}

.dash-kpi-glass-branches {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(255, 236, 210, 0.32)),
    linear-gradient(160deg, rgba(224, 161, 74, 0.24), rgba(192, 122, 34, 0.12));
}

.dash-kpi-glass-visit {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(255, 220, 228, 0.3)),
    linear-gradient(160deg, rgba(214, 95, 120, 0.2), rgba(176, 55, 82, 0.12));
}

.dash-kpi-glass-item-amt {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(210, 245, 220, 0.32)),
    linear-gradient(160deg, rgba(46, 125, 50, 0.22), rgba(27, 94, 32, 0.12));
}

.dash-kpi-glass-item-qty {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(200, 240, 235, 0.32)),
    linear-gradient(160deg, rgba(0, 137, 123, 0.22), rgba(0, 105, 92, 0.12));
}

.dash-kpi-glass-item-ret {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(255, 220, 220, 0.35)),
    linear-gradient(160deg, rgba(198, 40, 40, 0.2), rgba(183, 28, 28, 0.12));
}

.dash-kpi-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #3f5878;
}

.dash-kpi-ico {
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 8px;
  flex-shrink: 0;
  color: #fff;
}

.dash-kpi-ico svg {
  width: 0.85rem;
  height: 0.85rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-kpi-ico-pos {
  background: linear-gradient(145deg, #06b6d4, #0891b2);
  box-shadow: 0 4px 10px rgba(8, 145, 178, 0.22);
}

.dash-kpi-ico-returns {
  background: linear-gradient(145deg, #e57373, #c62828);
  box-shadow: 0 4px 10px rgba(198, 40, 40, 0.22);
}

.dash-kpi-ico-wholesale {
  background: linear-gradient(145deg, #6b7c93, #445468);
  box-shadow: 0 4px 10px rgba(68, 84, 104, 0.2);
}

.dash-kpi-ico-total {
  background: linear-gradient(145deg, #22d3ee, #1d6bb8);
  box-shadow: 0 4px 10px rgba(29, 107, 184, 0.22);
}

.dash-kpi-ico-sellers {
  background: linear-gradient(145deg, #5b8def, #3a66c7);
  box-shadow: 0 4px 10px rgba(58, 102, 199, 0.22);
}

.dash-kpi-ico-devices {
  background: linear-gradient(145deg, #23b268, #148f52);
  box-shadow: 0 4px 10px rgba(20, 143, 82, 0.2);
}

.dash-kpi-ico-branches {
  background: linear-gradient(145deg, #e0a14a, #c07a22);
  box-shadow: 0 4px 10px rgba(192, 122, 34, 0.2);
}

.dash-kpi-ico-visit {
  background: linear-gradient(145deg, #d45f78, #a83752);
  box-shadow: 0 4px 10px rgba(168, 55, 82, 0.2);
}

.dash-kpi-ico-item-amt {
  background: linear-gradient(145deg, #2e7d32, #1b5e20);
  box-shadow: 0 4px 10px rgba(46, 125, 50, 0.22);
}

.dash-kpi-ico-item-qty {
  background: linear-gradient(145deg, #00897b, #00695c);
  box-shadow: 0 4px 10px rgba(0, 137, 123, 0.22);
}

.dash-kpi-ico-item-ret {
  background: linear-gradient(145deg, #e53935, #b71c1c);
  box-shadow: 0 4px 10px rgba(183, 28, 28, 0.22);
}

.dash-loading {
  padding: 1.2rem 0.85rem !important;
  color: #0891b2 !important;
  font-weight: 700;
}

.dash-loading.dash-load-progress {
  display: grid;
  gap: 0.45rem;
  justify-items: stretch;
  text-align: center;
}

.dash-load-msg {
  font-size: 0.92rem;
  line-height: 1.35;
}

.dash-load-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.dash-load-track {
  flex: 1;
  height: 0.72rem;
  border-radius: 999px;
  background: #d7e4f5;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(18, 52, 95, 0.12);
}

.dash-load-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0891b2, #06b6d4 55%, #67e8f9);
  transition: width 0.35s ease;
}

.dash-load-pct {
  min-width: 2.6rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: #12345f;
  text-align: end;
}

.dash-kpi-value {
  font-size: 1.28rem;
  font-weight: 800;
  color: #12345f;
  line-height: 1.25;
  word-break: break-word;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.dash-kpi-hint {
  font-size: 0.78rem;
  color: #5a7394;
  font-weight: 600;
}

.dash-tabs {
  display: flex;
  gap: 0.55rem;
  margin-bottom: 0.95rem;
  flex-wrap: wrap;
}

.dash-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  border: 1px solid #c9dcf0;
  border-radius: 12px;
  background: #f7fafd;
  color: #35567e;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.92rem;
}

.dash-tab span {
  color: #0891b2;
  font-size: 0.86rem;
}

.dash-tab.is-active {
  background: #0891b2;
  border-color: #0891b2;
  color: #fff;
}

.dash-tab.is-active span {
  color: #d7e8ff;
}

/* ??????? ??????? (????? ??? ?????) */
.dash-analysis-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.35rem;
  flex-wrap: wrap;
  border: 1px solid #d5e4f4;
  border-radius: 14px;
  background: linear-gradient(180deg, #f4f8fc 0%, #eef4fb 100%);
}

.dash-analysis-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: #3a5d86;
  font: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dash-analysis-tab:hover {
  background: rgba(8, 145, 178, 0.08);
  color: #0891b2;
}

.dash-analysis-tab.is-active {
  background: #fff;
  border-color: #c5d8ef;
  color: #0891b2;
  box-shadow: 0 1px 2px rgba(8, 145, 178, 0.08);
}

.dash-tab-panel {
  display: none;
}

.dash-tab-panel.is-active {
  display: block;
}

.dash-overview-stack,
.dash-returns-stack {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.dash-overview-stack > .dash-panel,
.dash-returns-stack > .dash-panel {
  margin-top: 0;
  margin-bottom: 0;
}

.dash-kpi-overview {
  margin-bottom: 0.85rem;
}

.dash-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.95fr);
  gap: 0.95rem;
  margin-top: 0.95rem;
  margin-bottom: 0.95rem;
  align-items: stretch;
}

.dash-charts.dash-charts-branches-only {
  grid-template-columns: 1fr;
}

/* ?????? ?????? ??????? + ???? ??? ?????? ????? ??? ??? */
.dash-branch-margin-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  margin-top: 0.95rem;
  margin-bottom: 0.95rem;
  align-items: stretch;
}

.dash-branch-margin-pair > .dash-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dash-branch-margin-pair #chart-branches-board {
  flex: 1;
  min-height: 24rem;
}

.dash-branch-margin-pair .dash-margins-branches .margin-scroll,
.dash-branch-margin-pair .dash-margins-branches .margin-table-block {
  flex: 1;
  min-height: 0;
}

/* ??????? ????????? + ??????? ?????? ??????? ????? ??? ??? */
.dash-returns-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  margin-top: 0.95rem;
  margin-bottom: 0.95rem;
  align-items: stretch;
}

.dash-returns-pair > .dash-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dash-returns-pair .dash-returns-body {
  flex: 1;
  min-height: 32rem;
  max-height: 32rem;
  overflow: auto;
}

.dash-returns-pair .dash-chart-items .seller-board,
.dash-returns-pair #chart-items-board {
  flex: none;
  width: 100%;
  min-height: 32rem;
  max-height: 32rem;
  overflow: auto;
  box-sizing: border-box;
  gap: 0.5rem;
  padding: 0.7rem 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
}

.dash-margins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  margin-top: 0.95rem;
  margin-bottom: 0.95rem;
  align-items: stretch;
}

.dash-margins .dash-panel,
.dash-margins-branches {
  min-width: 0;
}

.dash-margins .table-wrap,
.dash-margins-branches .table-wrap {
  max-height: calc(2.2rem + (19 * 2.05rem) + 2.55rem);
  overflow: auto;
  padding: 0 0.55rem 0.55rem;
}

.dash-margins .margin-table-block,
.dash-margins-branches .margin-table-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ?????? ????? ? ???????? ???? ????? */
.dash-margins .margin-scroll,
.dash-margins-branches .margin-scroll {
  max-height: calc(2.2rem + (19 * 2.05rem));
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior: contain;
  padding: 0 0.55rem;
}

.dash-margins .margin-scroll::after {
  display: none;
}

.dash-margins .margin-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef4fb;
}

.dash-margins .margin-scroll .sales-table,
.dash-margins .margin-totals-table {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}

.dash-margins .m-col-idx,
.dash-margins .m-col-name,
.dash-margins .m-col-num {
  width: auto;
}

.dash-margins .margin-totals {
  flex: 0 0 auto;
  padding: 0 0.55rem 0.45rem;
  border-top: 1px solid #c5d8ef;
  background: #ecfeff;
  overflow-x: auto;
}

.dash-margins .margin-totals-table td {
  white-space: nowrap;
  font-size: 0.78rem;
  padding: 0.45rem 0.5rem;
  border-bottom: 0;
  font-weight: 800;
}

.dash-margins .sales-table th,
.dash-margins .sales-table td {
  white-space: nowrap;
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
  overflow: visible;
  text-overflow: clip;
}

.dash-margins .margin-scroll .sales-table th:nth-child(n + 3),
.dash-margins .margin-scroll .sales-table td:nth-child(n + 3),
.dash-margins .margin-totals-table td:nth-child(n + 2) {
  border-inline-start: 1px solid #e4ecf5;
}

.dash-margins .sales-table td:nth-child(2) {
  max-width: none;
}

.dash-margins .sales-table .margin-cost { color: #c62828; font-weight: 800; }
.dash-margins .sales-table .is-up { color: #0b7a45; font-weight: 800; }
.dash-margins .sales-table .is-down { color: #b34040; font-weight: 800; }

.dash-branch-chart,
.dash-charts .dash-top-items,
.dash-charts .dash-chart-items {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.branch-chart {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 0.9rem 0.95rem;
  max-height: 28rem;
  overflow: auto;
}

.branch-donut {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: center;
  max-height: none;
  overflow: visible;
  padding: 0.9rem 1rem 1.1rem;
}

.branch-donut-visual {
  position: relative;
  width: 100%;
  max-width: 210px;
  margin-inline: auto;
  aspect-ratio: 1;
}

.branch-donut-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 4px 14px rgba(8, 145, 178, 0.12));
}

.branch-donut-legend-item.is-clickable {
  cursor: pointer;
  border-radius: 8px;
}

.branch-donut-legend-item.is-clickable:hover,
.branch-donut-legend-item.is-clickable:focus-visible {
  background: #eef4fb;
  outline: none;
}

.branch-donut-slice {
  cursor: pointer;
  transition: stroke-width 0.2s ease, opacity 0.2s ease;
}

.branch-donut-visual:hover .branch-donut-slice {
  opacity: 0.72;
}

.branch-donut-visual:hover .branch-donut-slice:hover {
  opacity: 1;
  stroke-width: 20;
}

.branch-donut-label {
  font-size: 6.2px;
  font-weight: 800;
  fill: #fff;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  paint-order: stroke fill;
  stroke: rgba(18, 40, 70, 0.45);
  stroke-width: 0.55px;
  letter-spacing: -0.02em;
}

.branch-donut-center {
  position: absolute;
  inset: 28%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  gap: 0.15rem;
}

.branch-donut-center-pct {
  font-size: clamp(1.05rem, 3.2vw, 1.35rem);
  font-weight: 800;
  color: #12345f;
  line-height: 1.1;
}

.branch-donut-center-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #5a7394;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 0.25rem;
}

.branch-donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 22rem;
  overflow: auto;
}

.branch-donut-legend-item {
  display: grid;
  grid-template-columns: 0.7rem minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.28rem 0.2rem;
  animation: seller-in 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 28ms);
}

.branch-donut-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.branch-donut-legend-body {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.branch-donut-legend-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #1a3558;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.branch-donut-legend-meta {
  font-size: 0.7rem;
  color: #7a90ab;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.branch-donut-pct {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0891b2;
  min-width: 3.2rem;
  text-align: end;
}

@media (max-width: 720px) {
  .branch-donut {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .branch-donut-legend {
    width: 100%;
    max-height: 14rem;
  }
}

.branch-chart-row {
  display: grid;
  grid-template-columns: 1.6rem minmax(5.5rem, 8.5rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.2rem;
  animation: seller-in 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 30ms);
}

.branch-chart-rank {
  font-size: 0.78rem;
  font-weight: 800;
  color: #7a90ab;
  text-align: center;
}

.branch-chart-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #1a3558;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.branch-chart-track {
  display: block;
  height: 0.72rem;
  border-radius: 999px;
  background: #e8eef6;
  overflow: hidden;
}

.branch-chart-fill {
  display: block;
  height: 100%;
  width: var(--bar-pct, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #06b6d4 0%, #0891b2 100%);
  transition: width 0.55s ease;
}

.branch-chart-row:nth-child(1) .branch-chart-fill {
  background: linear-gradient(90deg, #e8b84a 0%, #c9891a 100%);
}
.branch-chart-row:nth-child(2) .branch-chart-fill {
  background: linear-gradient(90deg, #9aa8b8 0%, #6d7f93 100%);
}
.branch-chart-row:nth-child(3) .branch-chart-fill {
  background: linear-gradient(90deg, #d4a07a 0%, #b0754a 100%);
}
.branch-chart-row.is-return .branch-chart-fill {
  background: linear-gradient(90deg, #d47878 0%, #b34040 100%);
}

.branch-chart-row.is-return:nth-child(1) .branch-chart-fill {
  background: linear-gradient(90deg, #e08a8a 0%, #c44a4a 100%);
}
.branch-chart-row.is-return:nth-child(2) .branch-chart-fill {
  background: linear-gradient(90deg, #d99a7a 0%, #b86a40 100%);
}
.branch-chart-row.is-return:nth-child(3) .branch-chart-fill {
  background: linear-gradient(90deg, #c9a06a 0%, #a07838 100%);
}

.branch-chart-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  min-width: 5.5rem;
}

.branch-chart-amt {
  font-size: 0.84rem;
  font-weight: 800;
  color: #12345f;
}

.branch-chart-inv {
  font-size: 0.72rem;
  color: #7a90ab;
}

.dash-charts .top20-board,
.dash-charts .top20-chart {
  max-height: 28rem;
  overflow: auto;
  padding: 0.55rem 0.65rem 0.75rem;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.9fr);
  gap: 0.95rem;
  align-items: stretch;
}

.dash-main-col,
.dash-side-col {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  min-width: 0;
  min-height: 100%;
}

.dash-branches,
.dash-sellers,
.dash-top-items {
  flex-shrink: 0;
}

.dash-panel {
  background: #fff;
  border: 1px solid #d5e3f2;
  border-radius: 16px;
  overflow: hidden;
  min-width: 0;
}

.dash-panel-glass {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.72), rgba(220, 236, 252, 0.38)),
    linear-gradient(165deg, rgba(8, 145, 178, 0.14), rgba(8, 145, 178, 0.08));
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 12px 30px rgba(18, 52, 95, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.dash-panel-glass::before {
  content: "";
  position: absolute;
  inset: -35% auto auto -15%;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.dash-panel-glass::after {
  content: "";
  position: absolute;
  inset: auto -25% -40% auto;
  width: 11rem;
  height: 11rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 214, 255, 0.35) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.dash-panel-glass > * {
  position: relative;
  z-index: 1;
}

.dash-panel-glass .dash-panel-head {
  background: rgba(244, 248, 253, 0.55);
  border-bottom-color: rgba(225, 235, 246, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dash-panel-glass .table-wrap,
.dash-panel-glass .data-table {
  background: transparent;
}

.dash-panel-glass .data-table th {
  background: rgba(245, 249, 255, 0.72);
}

.dash-panel-glass .data-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.28);
}

.dash-panel-glass .data-table tbody tr:hover td {
  background: rgba(232, 241, 251, 0.55);
}

.dash-panel-glass .sales-grand-row td {
  background: #eaf2fb;
}

.dash-panel-glass .sales-grand-row .sales-amt {
  background: #e6f6ee;
}

.dash-panel-glass.dash-sellers,
.dash-panel-glass.dash-top-items {
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(8, 145, 178, 0.12), transparent 55%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.72), rgba(220, 236, 252, 0.38)),
    linear-gradient(165deg, rgba(8, 145, 178, 0.14), rgba(8, 145, 178, 0.08));
}

.dash-panel-glass .seller-board,
.dash-panel-glass .branch-chart,
.dash-panel-glass .top20-chart {
  background: transparent;
}

.dash-panel-glass .seller-card {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(201, 220, 240, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dash-panel-glass .cashier-machine {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(201, 220, 240, 0.65);
}

.dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e1ebf6;
  background: #f4f8fd;
}

.dash-panel-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #12345f;
}

.dash-panel-head-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dash-branches-title {
  min-width: 0;
}

.dash-branches-sub {
  margin: 0.12rem 0 0;
  color: #7a90ab;
  font-size: 0.68rem;
  font-weight: 600;
}

.dash-branch-filter {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dash-branch-filter select {
  min-height: 2rem;
  max-width: 11.5rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid #b7cfea;
  border-radius: 10px;
  background: #fff;
  color: #173e70;
  font: 700 0.78rem var(--font);
  cursor: pointer;
}

.sales-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.85rem;
  padding: 0.22rem 0.7rem;
  border: 1px solid #0891b2;
  border-radius: 9px;
  background: linear-gradient(145deg, #06b6d4, #0891b2);
  color: #fff;
  font: 800 0.72rem var(--font);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(8, 145, 178, 0.18);
}

.sales-view-btn:hover {
  filter: brightness(1.06);
  color: #fff;
}

.dash-grid.is-daily {
  grid-template-columns: 1fr;
}

.dash-grid.is-daily .dash-side-col {
  display: none;
}

.dash-items-mark {
  background: linear-gradient(145deg, #23b268, #148f52) !important;
  box-shadow: 0 6px 14px rgba(20, 143, 82, 0.22) !important;
}

.dash-top-items {
  display: flex;
  flex-direction: column;
  padding-bottom: 0.55rem;
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(20, 143, 82, 0.08), transparent 55%),
    linear-gradient(180deg, #fff 0%, #f7fafd 100%);
}

.dash-top-items .seller-board {
  flex: none;
  width: 100%;
  box-sizing: border-box;
}

.dash-top-items .seller-card {
  cursor: default;
}

/* ???? ??????? ??? ?????? ??? ????? ?????? ?????? */
.page.sales-dash .dash-top-items > #items-loading.dash-loading {
  margin: 0;
  padding: 0.55rem 0.75rem;
}

.page.sales-dash .dash-top-items > #items-loading.dash-load-progress {
  position: absolute;
  inset-inline: 0.55rem;
  top: auto;
  bottom: 0.55rem;
  z-index: 4;
  margin: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 16px rgba(15, 60, 40, 0.12);
}

.dash-branches.is-cols-expanded,
.dash-grid:has(.sales-table.is-cols-expanded) .dash-main-col {
  min-width: 0;
}

.dash-main-col .table-wrap {
  max-height: calc(2.15rem + (19 * 1.9rem) + 2.55rem);
  overflow: auto;
}

.dash-groups {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ??? + 19 ???? + ?? ????????? ??????? ????? ??????? */
.dash-groups .table-wrap {
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(2.15rem + (19 * 1.9rem) + 2.55rem);
  overflow: auto;
}

.dash-groups .table-wrap thead th,
.dash-main-col .table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef4fb;
}

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

.dash-main-col .table-wrap::after {
  display: none;
}

.sales-cols-toggle {
  border: 1px solid #b7cfea;
  border-radius: 999px;
  background: #fff;
  color: #0891b2;
  font: 700 0.78rem var(--font);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.sales-cols-toggle:hover,
.sales-cols-toggle[aria-expanded="true"] {
  background: #ecfeff;
  border-color: #0891b2;
}

.sales-num-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-family: var(--mono);
  font-weight: 800;
  padding: 0.15rem 0.35rem;
  margin: -0.15rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(8, 145, 178, 0.35);
  text-underline-offset: 0.18em;
}

.sales-num-btn:hover,
.sales-num-btn:focus-visible {
  background: #ecfeff;
  color: #0891b2;
  outline: none;
}

.sales-table .sales-col-extra {
  display: none;
}

.sales-table.is-cols-expanded .sales-col-extra {
  display: table-cell;
}

.dash-grid:has(.sales-table.is-cols-expanded) {
  grid-template-columns: 1fr;
}

.dash-grid:has(.sales-table.is-cols-expanded) .dash-side-col {
  display: none;
}

.dash-invoices .table-wrap::after {
  display: none;
}

.page.sales-dash .sales-table,
.page.sales-dash .cashier-bills-table {
  min-width: 0;
  font-size: 0.82rem;
}

.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 {
  padding: 0.38rem 0.55rem;
  font-size: 0.8rem;
}

.page.sales-dash .sales-table tbody td:not(.mono),
.page.sales-dash .sales-table tbody td:not(.mono) button {
  color: #0a0a0a;
  font-weight: 700;
}

.page.sales-dash .sales-table th,
.page.sales-dash .cashier-bills-table th {
  font-size: 0.7rem;
}

.page.sales-dash .sales-table .sales-amt,
.page.sales-dash .cashier-bills-table .sales-amt {
  font-size: 0.8rem;
}

.page.sales-dash .sales-grand-row td {
  font-size: 0.84rem;
  padding-block: 0.48rem;
}

.page.sales-dash .sales-num-btn {
  font-size: inherit;
  padding: 0.05rem 0.2rem;
}

.dash-sellers {
  padding-bottom: 0.55rem;
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(8, 145, 178, 0.1), transparent 55%),
    linear-gradient(180deg, #fff 0%, #f7fafd 100%);
}

.dash-sellers-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.dash-sellers-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: linear-gradient(145deg, #06b6d4, #0891b2);
  color: #fff;
  box-shadow: 0 6px 14px rgba(8, 145, 178, 0.22);
  flex-shrink: 0;
}

.dash-sellers-mark svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-sellers-sub {
  margin: 0.1rem 0 0;
  color: #7a90ab;
  font-size: 0.68rem;
  font-weight: 600;
}

.seller-board {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem 0.2rem;
  margin: 0;
  max-height: 28rem;
  overflow: auto;
}

.dash-sellers .seller-board,
.dash-top-items .seller-board {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.7rem 0.75rem 0.85rem;
  width: 100%;
  max-height: 32rem;
  min-height: 32rem;
  overflow: auto;
  box-sizing: border-box;
}

.dash-sellers .seller-board > .sales-empty,
.dash-top-items .seller-board > .sales-empty {
  grid-column: unset;
}

.dash-sellers .seller-card,
.dash-top-items .seller-card {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  flex-shrink: 0;
  min-height: auto;
  height: auto;
  aspect-ratio: auto;
  max-height: none;
  overflow: visible;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(201, 216, 234, 0.9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
  text-align: start;
  box-sizing: border-box;
}

.dash-sellers .seller-rank,
.dash-top-items .seller-rank {
  align-self: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.dash-sellers .seller-body,
.dash-top-items .seller-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.28rem;
  min-width: 0;
  min-height: 0;
  flex: unset;
  overflow: hidden;
}

.dash-sellers .seller-name,
.dash-top-items .seller-name {
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.3;
  color: #12345f;
  display: block;
  -webkit-line-clamp: unset;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: start;
  max-width: 100%;
}

.dash-sellers .seller-meta,
.dash-top-items .seller-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
  font-size: 0.7rem;
  color: #7a90ab;
  font-weight: 600;
}

.dash-sellers .seller-meta-inv,
.dash-top-items .seller-meta-inv {
  color: #7a90ab;
  font-weight: 600;
}

.dash-top-items .seller-meta-inv {
  color: #0f7a45;
  font-weight: 700;
}

.dash-sellers .seller-meta-code,
.dash-top-items .seller-meta-code {
  background: transparent;
  border-radius: 0;
  padding: 0;
  font-size: 0.7rem;
}

.dash-sellers .seller-meta-code {
  color: #7a90ab;
}

.dash-top-items .seller-meta-code,
.dash-sellers .seller-meta-inv {
  color: #c62828;
  font-weight: 700;
}

.dash-sellers .seller-meta-code::before,
.dash-top-items .seller-meta-code::before {
  content: none;
}

.dash-sellers .seller-track,
.dash-top-items .seller-track {
  width: 100%;
  height: 0.32rem;
  margin-top: 0.18rem;
  background: #e6edf5;
  border-radius: 999px;
}

.dash-sellers .seller-fill,
.dash-top-items .seller-fill {
  background: linear-gradient(90deg, #0891b2 0%, #06b6d4 100%);
}

.dash-sellers .seller-side,
.dash-top-items .seller-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.28rem;
  min-width: 5.2rem;
  margin-top: 0;
}

.dash-sellers .seller-amt,
.dash-top-items .seller-amt {
  display: inline-flex;
  align-items: center;
  gap: 0.28em;
  font-size: 0.92rem;
  font-weight: 800;
  color: #12345f;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.15;
}

.dash-top-items .seller-amt .sar-symbol {
  width: 0.85em;
  height: 0.95em;
  color: #12345f;
}

.dash-sellers .seller-pct,
.dash-top-items .seller-pct {
  min-width: 2.6rem;
  padding: 0.14rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  background: #e6f6ee;
  color: #0f7a45;
  border-radius: 999px;
}

.dash-sellers .seller-card:hover,
.dash-top-items .seller-card:hover {
  transform: translateY(-1px);
  border-color: #9fbae0;
  box-shadow: 0 8px 18px rgba(8, 145, 178, 0.08);
  background: #fff;
}

.dash-sellers .seller-card.is-active {
  border-color: #0891b2;
  background: linear-gradient(135deg, #eef5ff 0%, #f8fbff 100%);
}

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

.seller-card {
  --bar-pct: 0%;
  --i: 0;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(201, 216, 234, 0.85);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.18s ease,
    box-shadow 0.2s ease,
    background 0.18s ease;
  animation: seller-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 45ms);
}

.seller-card:hover {
  transform: translateY(-2px);
  border-color: #9fbae0;
  box-shadow: 0 10px 22px rgba(8, 145, 178, 0.1);
  background: #fff;
}

.seller-card.is-active {
  border-color: #0891b2;
  background: linear-gradient(135deg, #eef5ff 0%, #f8fbff 100%);
  box-shadow: 0 0 0 1px rgba(8, 145, 178, 0.12), 0 10px 22px rgba(8, 145, 178, 0.1);
}

.seller-rank {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8eef8;
  color: #35567e;
  font-size: 0.68rem;
  font-weight: 800;
}

.seller-card.rank-1 .seller-rank {
  background: linear-gradient(145deg, #f0c14b, #d4a017);
  color: #fff;
}

.seller-card.rank-2 .seller-rank {
  background: linear-gradient(145deg, #c5d0dc, #8fa0b5);
  color: #fff;
}

.seller-card.rank-3 .seller-rank {
  background: linear-gradient(145deg, #d8a07a, #b57a4a);
  color: #fff;
}

.seller-body {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.seller-name {
  font-weight: 800;
  font-size: 0.84rem;
  color: #12345f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.seller-meta {
  font-size: 0.66rem;
  color: #7a90ab;
  font-weight: 600;
}

.seller-track {
  display: block;
  height: 0.28rem;
  border-radius: 999px;
  background: #e4ecf5;
  overflow: hidden;
  margin-top: 0.12rem;
}

.seller-fill {
  display: block;
  height: 100%;
  width: var(--bar-pct);
  border-radius: inherit;
  background: linear-gradient(90deg, #0891b2 0%, #06b6d4 100%);
  transform-origin: right center;
  animation: seller-bar 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(0.12s + var(--i) * 45ms);
}

html[dir="rtl"] .seller-fill {
  transform-origin: left center;
}

@keyframes seller-bar {
  from { width: 0; }
  to { width: var(--bar-pct); }
}

.seller-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  min-width: 4.5rem;
}

.seller-amt {
  font-weight: 800;
  font-size: 0.8rem;
  color: #143a6b;
  white-space: nowrap;
  line-height: 1.15;
}

.seller-pct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #ecfeff;
  color: #0891b2;
  font-size: 0.66rem;
  font-weight: 800;
}

.seller-card.is-active .seller-pct {
  background: #0891b2;
  color: #fff;
}

.page.sales-dash .dash-panel-head {
  padding: 0.55rem 0.75rem;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
}

.page.sales-dash .dash-panel-head > .dash-sellers-title,
.page.sales-dash .dash-panel-head > .dash-branches-title {
  flex: 1 1 auto;
  min-width: 0;
}

.page.sales-dash .dash-sellers-title > div,
.page.sales-dash .dash-branches-title {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
}

.page.sales-dash .dash-panel-head h3 {
  font-size: 0.9rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
}

.page.sales-dash .dash-sellers-sub,
.page.sales-dash .dash-branches-sub {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.page.sales-dash .dash-panel-head-actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  min-width: 0;
}

.page.sales-dash .result-pill {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}

.page.sales-dash .sales-cols-toggle {
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
}

.page.sales-dash .sales-table th,
.page.sales-dash .cashier-bills-table th,
.page.sales-dash .data-table th {
  white-space: nowrap;
}

.dash-invoices {
  margin-top: 0.95rem;
  padding: 0 0 0.85rem;
}

.dash-invoices-sub {
  margin: 0.2rem 0 0;
  color: #637b99;
  font-size: 0.82rem;
}

.dash-invoices .cashier-machine {
  margin: 0.7rem 0.9rem 0;
}

.sales-form input[type="date"] {
  min-height: 2.7rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #c5d5e8;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: 600 0.95rem var(--font);
}

.sales-results {
  overflow: hidden;
}

.sales-table .sales-amt {
  font-weight: 800;
  color: #143a6b;
  white-space: nowrap;
}

.sales-table .sales-amt-net {
  color: #0b7a45;
}

.sales-table .sales-empty {
  text-align: center;
  color: var(--muted);
  padding: 1.4rem 0.75rem;
}

.sales-grand-row td {
  background: #eaf2fb;
  border-top: 2px solid #0891b2;
  font-size: 1.02rem;
  font-weight: 800;
  color: #143a6b;
}

.sales-grand-row .sales-amt {
  color: #0b7a45;
  background: #e6f6ee;
}

.sales-table .sales-amt-gross,
.sales-table .sales-amt-avg,
.sales-grand-row .sales-amt-gross,
.sales-grand-row .sales-amt-avg {
  color: #c62828;
}

.sales-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.1rem 0 0.35rem;
}

.sales-stat-card {
  background: linear-gradient(165deg, #ffffff 0%, #f3f7fc 100%);
  border: 1px solid #d5e3f2;
  border-radius: 16px;
  padding: 1rem 1.05rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.sales-stat-card-accent {
  background: linear-gradient(165deg, #eef5ff 0%, #dceafb 100%);
  border-color: #b7cfea;
}

.sales-stat-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #5a7394;
}

.sales-stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #143a6b;
  line-height: 1.25;
  word-break: break-word;
}

.sales-stat-name {
  font-size: 1.05rem;
  font-family: var(--font);
}

.sales-stat-hint {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.sales-bars {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sales-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.sales-bar-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
}

.sales-bar-rank {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e7eef8;
  color: #0891b2;
  font-size: 0.7rem;
  font-weight: 800;
}

.sales-bar-name {
  font-weight: 700;
  font-size: 0.84rem;
  color: #12345f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-bar-amt {
  font-weight: 800;
  font-size: 0.8rem;
  color: #143a6b;
  white-space: nowrap;
}

.sales-bar-track {
  height: 0.48rem;
  border-radius: 999px;
  background: #e8eef6;
  overflow: hidden;
}

.sales-bar-fill {
  display: block;
  height: 100%;
  width: var(--bar-pct, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #0891b2 0%, #3d7ec4 100%);
  transition: width 0.55s ease;
}

.sales-bar-sub {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #6a809c;
  font-weight: 600;
}

.sales-invoice-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.7rem;
  border: 1px solid #b9cde5;
  border-radius: 9px;
  color: #0891b2;
  background: #f5f9fe;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.sales-invoice-link:hover,
.sales-invoice-link.is-active {
  color: #fff;
  background: #0891b2;
  border-color: #0891b2;
}

.cashier-machine {
  border: 1px solid #d2e0ef;
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
}

.cashier-machine summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.48rem 0.7rem;
  background: #f4f8fd;
  color: #173e70;
  cursor: pointer;
  font-size: 0.78rem;
}

.cashier-machine[open] summary {
  border-bottom: 1px solid #d7e4f2;
}

.cashier-machine-main,
.cashier-machine-totals {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
}

.cashier-machine-totals {
  white-space: nowrap;
}

.cashier-bills-wrap {
  max-height: 22rem;
  overflow: auto;
}

.cashier-bills-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eaf2fb;
}

@media (max-width: 1180px) {
  .dash-grid,
  .dash-charts,
  .dash-margins,
  .dash-returns-pair,
  .dash-branch-margin-pair {
    grid-template-columns: 1fr;
  }

  .dash-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page.sales-dash .dash-kpi {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .branch-chart-row {
    grid-template-columns: 1.4rem minmax(4.5rem, 7rem) minmax(0, 1fr) auto;
  }
}

@media (max-width: 980px) {
  .page.sales-dash {
    width: min(1000px, calc(100% - 1.5rem));
  }

  .sales-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page.sales-dash .dash-kpi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .dash-kpi,
  .sales-stats {
    grid-template-columns: 1fr;
  }

  .page.sales-dash .dash-kpi {
    grid-template-columns: 1fr;
  }

  .sales-bar-meta {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .sales-bar-amt {
    grid-column: 2;
  }

  .cashier-machine summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

.browse-item-link {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.browse-item-link:hover {
  color: var(--brand-mid);
  text-decoration: underline;
}

.browse-item-name {
  color: #12345f;
}

.browse-results {
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(8, 145, 178, 0.08);
}

.browse-results-head {
  padding: 0.65rem 0.85rem;
  gap: 0.55rem;
  align-items: center !important;
}

.browse-results-head .panel-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  box-shadow: 0 4px 10px rgba(8, 145, 178, 0.18);
}

.browse-results-head .panel-ico svg {
  width: 15px;
  height: 15px;
}

.browse-results-title {
  min-width: 0;
  flex: 1;
}

.browse-results-head h3 {
  font-size: 0.95rem;
  line-height: 1.25;
  margin: 0;
}

.browse-results-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.28rem;
}

.browse-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  color: #3d5a7a;
  background: #eef4fb;
  border: 1px solid #d7e4f3;
  line-height: 1.35;
}

.browse-meta-chip b {
  font-weight: 800;
  color: #143a6b;
}

.browse-meta-chip.is-ok {
  color: #1a6b45;
  background: #e8f7ef;
  border-color: #c6e8d4;
}

.browse-meta-chip.is-warn {
  color: #8a5a00;
  background: #fff6e8;
  border-color: #f0dfb8;
}

.browse-meta-chip.is-muted {
  color: #6b7f96;
  background: #f3f6fa;
  border-color: #e2e8f0;
}

.browse-price-table {
  min-width: 720px;
  font-size: 0.86rem;
}

.browse-price-table td,
.browse-price-table th {
  white-space: nowrap;
  padding: 0.42rem 0.65rem;
}

.browse-price-table th {
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  padding: 0.4rem 0.65rem;
  background: #f3f7fd;
}

.browse-price-table td:nth-child(2) {
  white-space: normal;
  min-width: 8.5rem;
  max-width: 16rem;
  line-height: 1.35;
  font-weight: 600;
}

.browse-price-table .price-cell,
.browse-price-table .cost-cell,
.browse-price-table .qty-cell {
  font-size: 0.84rem;
}

.browse-price-table .money-value {
  font-variant-numeric: tabular-nums;
}

.browse-price-table .sar-symbol {
  width: 0.78em;
  height: 0.86em;
}

.browse-results .table-wrap {
  border-radius: 0;
}

.browse-results .table-wrap::after {
  display: none;
}

.browse-results tbody tr:nth-child(even) td {
  background: #fafcfe;
}

.browse-results tbody tr:hover td {
  background: #eef5fc;
}

.browse-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem 0.4rem;
  padding: 0.55rem 0.75rem 0.65rem;
  border-top: 1px solid rgba(201, 216, 234, 0.85);
  background: #f8fbff;
}

.browse-pager-pages {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.browse-pager-btn,
.browse-pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  min-height: 1.85rem;
  padding: 0.22rem 0.5rem;
  border: 1px solid #c5d5e8;
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  font: 700 0.8rem var(--font);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.browse-pager-btn:hover,
.browse-pager-num:hover {
  background: var(--brand-soft);
  border-color: #a9c0db;
}

.browse-pager-num.is-current {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  border-color: transparent;
  color: #fff;
}

.browse-pager-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f4f7fb;
}

.browse-pager-ellipsis {
  color: var(--muted);
  font-weight: 700;
  padding: 0 0.15rem;
}

.browse-stock-total {
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0.95rem 1rem 0.85rem;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(168, 216, 255, 0.22), transparent 55%),
    linear-gradient(135deg, #0e7490 0%, #0891b2 48%, #2a6bb8 100%);
  color: #eef6ff;
  isolation: isolate;
  animation: browse-stock-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.browse-stock-total-glow {
  position: absolute;
  inset: auto -20% -60% 40%;
  height: 140%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.browse-stock-total-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.browse-stock-total-copy {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: min(100%, 220px);
}

.browse-stock-total-kicker {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #9fd0ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
}

.browse-stock-total-copy strong {
  color: #fff;
  font-size: clamp(1.05rem, 2.4vw, 1.28rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.browse-stock-total-formula {
  color: rgba(220, 235, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 500;
}

.browse-stock-total-value {
  font-size: clamp(1.35rem, 3.4vw, 1.95rem);
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 8px 24px rgba(0, 20, 50, 0.28);
  animation: browse-stock-value 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.browse-stock-money {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #fff;
}

.browse-stock-money .sar-symbol {
  width: 0.72em;
  height: 0.8em;
  opacity: 0.92;
}

.browse-stock-total-chips {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.7rem;
}

.browse-stock-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
}

.browse-stock-chip.is-muted {
  background: rgba(0, 0, 0, 0.14);
  border-color: rgba(255, 255, 255, 0.08);
}

.browse-stock-chip.is-soft {
  background: rgba(159, 208, 255, 0.12);
}

.browse-stock-chip-n {
  font-size: 0.98rem;
  font-weight: 800;
  color: #fff;
}

.browse-stock-chip-l {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(220, 235, 255, 0.78);
}

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

@keyframes browse-stock-value {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 720px) {
  .browse-pager {
    gap: 0.4rem;
  }
  .browse-pager-btn {
    flex: 1 1 auto;
  }
  .browse-stock-total {
    padding: 1.15rem 1rem 1.05rem;
  }
  .browse-stock-total-main {
    flex-direction: column;
    align-items: flex-start;
  }
}

.name-result-list li {
  border-top: 1px solid rgba(201, 216, 234, 0.75);
}

.name-result-list li:first-child {
  border-top: 0;
}

.name-result-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem 0.85rem;
  align-items: center;
  padding: 0.85rem 1.1rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.name-result-link:hover {
  background: rgba(232, 241, 251, 0.85);
}

.name-result-code {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.88rem;
  font-weight: 700;
}

.name-result-name {
  font-weight: 700;
  color: #12345f;
  line-height: 1.35;
}

.name-result-unit {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

@media (max-width: 720px) {
  .name-result-link {
    grid-template-columns: 1fr auto;
  }
  .name-result-code {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 900px) {
  .page.has-sidebar,
  .page.sales-dash.has-sidebar {
    width: min(1000px, calc(100% - 1.5rem));
    max-width: none;
    margin-inline: auto;
    padding-top: 4.1rem;
  }

  .sidebar-open {
    display: grid;
    z-index: 50;
  }

  /* جوال: بجانب زر فتح القائمة — وإخفاء زر الشعار */
  .app-hard-refresh--brand {
    display: none !important;
  }

  .app-hard-refresh--float {
    display: grid;
    position: fixed;
    top: 0.85rem;
    inset-inline-start: calc(0.85rem + 2.55rem + 0.45rem);
    z-index: 50;
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 14px;
  }

  .app-hard-refresh--float svg {
    width: 1.2rem;
    height: 1.2rem;
  }

  /* الشريط مفتوح: التحديث داخل الشعار، وإخفاء الزر العائم */
  body.sidebar-open .app-hard-refresh--float {
    display: none !important;
  }

  body.sidebar-open .app-hard-refresh--brand {
    display: grid !important;
  }

  .sidebar-collapse {
    display: none !important;
  }

  .sidebar {
    /* force full drawer width on mobile even if desktop was collapsed */
    width: 248px;
    transform: translateX(-110%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: none;
    pointer-events: none;
  }

  html[dir="rtl"] .sidebar {
    transform: translateX(110%);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 34px rgba(8, 145, 178, 0.18);
    pointer-events: auto;
  }

  body.sidebar-open .sidebar-scrim {
    display: block;
  }

  .sidebar-close {
    display: grid;
  }

  body.sidebar-open {
    overflow: hidden;
  }
}

@media (max-width: 720px) {
  .search-form {
    flex-direction: column;
    align-items: stretch;
  }
  /* ?? ???????: ???? ?????? ?????? ??? ?????? ??? ???? ???? */
  .page.results-focus.search-keep-form .search-form {
    flex-direction: row;
    align-items: flex-end;
  }
  .warehouse-field { flex: 1 1 auto; }
  .btn-primary { width: 100%; }
  .page.results-focus.search-keep-form .btn-primary {
    width: auto;
  }
  .match-top,
  .match-head { flex-direction: column; }
  .match-card-simple {
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
  }
  .match-card-simple .match-name {
    flex-basis: 100%;
    order: 3;
  }
  .result-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .result-hero-side {
    justify-content: flex-start;
  }
  .result-combined-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .result-combined-head .result-hero-side {
    flex-basis: 100%;
  }
  .matched-unit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .matched-unit-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .result-prices .table-wrap {
    overflow-x: hidden;
  }
  .result-prices .table-wrap::after {
    display: none;
  }
  .result-prices .price-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }
  .result-prices .price-table th,
  .result-prices .price-table td {
    padding: 0.55rem 0.2rem;
    text-align: center;
    font-size: 0.68rem;
    overflow-wrap: anywhere;
  }
  .result-prices .price-table th:nth-child(1) { width: 16%; }
  .result-prices .price-table th:nth-child(2) { width: 22%; }
  .result-prices .price-table th:nth-child(3) { width: 12%; }
  .result-prices .price-table th:nth-child(4) { width: 17%; }
  .result-prices .price-table th:nth-child(5) { width: 17%; }
  .result-prices .price-table th:nth-child(6) { width: 16%; }
  .result-prices .price-table .mono {
    font-size: 0.66rem;
    word-break: break-all;
  }
  .result-prices .price-table .chip {
    padding: 0.18rem 0.3rem;
    font-size: 0.67rem;
  }
  .result-prices .price-table .row-tag {
    display: block;
    width: fit-content;
    margin: 0.2rem auto 0;
    font-size: 0.6rem;
  }
}

/* ?? Sync progress overlay ?? */
.sync-progress {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(15, 35, 65, 0.45);
  backdrop-filter: blur(4px);
}

.sync-progress[hidden] {
  display: none !important;
}

.sync-progress-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(20, 58, 107, 0.22);
  padding: 1.6rem 1.4rem 1.35rem;
  text-align: center;
}

.sync-progress-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}

.sync-progress-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: sync-spin 1.1s linear infinite;
}

.sync-progress.is-done .sync-progress-icon {
  background: #e6f6ea;
  color: #1b7a3d;
}

.sync-progress.is-done .sync-progress-icon svg {
  animation: none;
}

.sync-progress.is-error .sync-progress-icon {
  background: #fdecea;
  color: #c62828;
}

.sync-progress.is-error .sync-progress-icon svg {
  animation: none;
}

.sync-progress-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: #143a6b;
}

.sync-progress-status {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.95rem;
  min-height: 1.4em;
}

.sync-progress-track {
  height: 12px;
  border-radius: 999px;
  background: #e8eef6;
  overflow: hidden;
  border: 1px solid #d5e2f2;
}

.sync-progress-fill {
  height: 100%;
  width: 1%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0891b2, #06b6d4);
  transition: width 0.28s ease;
}

.sync-progress.is-done .sync-progress-fill {
  background: linear-gradient(90deg, #1b7a3d, #3cb371);
}

.sync-progress.is-error .sync-progress-fill {
  background: linear-gradient(90deg, #c62828, #e57373);
}

.sync-progress-label {
  margin: 0.65rem 0 0;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: #143a6b;
  font-variant-numeric: tabular-nums;
}

.sync-progress #sync-progress-close {
  margin-top: 1rem;
}

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

/* ?? Barcode camera scanner ?? */
.barcode-scanner {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(15, 35, 65, 0.55);
  backdrop-filter: blur(4px);
}

.barcode-scanner[hidden] {
  display: none !important;
}

.barcode-scanner-card {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(20, 58, 107, 0.22);
  padding: 1.1rem 1.1rem 1.25rem;
  overflow: hidden;
}

.barcode-scanner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.barcode-scanner-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #143a6b;
}

.barcode-scanner-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.barcode-scanner-torch {
  border: 1px solid #c5d8f0;
  background: #eef5ff;
  color: #1f4f8a;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.barcode-scanner-torch.is-on {
  background: #ffe9a8;
  border-color: #f0c94d;
  color: #7a5a00;
}

.barcode-scanner-status {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
  min-height: 1.35em;
}

.barcode-scanner-status.is-error {
  color: var(--danger);
  font-weight: 600;
}

.barcode-scanner-status.is-ok {
  color: var(--ok);
  font-weight: 700;
}

.barcode-scanner-viewport {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1a2e;
  min-height: 320px;
}

.zebra-viewport {
  aspect-ratio: 3 / 4;
  max-height: min(78vh, 720px);
}

.zebra-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.zebra-guide {
  position: absolute;
  inset: 10% 6%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.42);
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.zebra-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: #ff2d2d;
  border-style: solid;
  border-width: 0;
  z-index: 3;
}

.zebra-corner-tl { top: 0; left: 0; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 8px; }
.zebra-corner-tr { top: 0; right: 0; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 8px; }
.zebra-corner-bl { bottom: 0; left: 0; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 8px; }
.zebra-corner-br { bottom: 0; right: 0; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 8px; }

.zebra-laser {
  position: absolute;
  pointer-events: none;
  z-index: 2;
}

.zebra-laser-h {
  left: 4%;
  right: 4%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ff1a1a 10%, #ff4040 50%, #ff1a1a 90%, transparent);
  box-shadow: 0 0 12px 2px rgba(255, 40, 40, 0.85);
}

.zebra-laser-v {
  top: 4%;
  bottom: 4%;
  width: 2px;
  background: linear-gradient(180deg, transparent, #ff1a1a 10%, #ff4040 50%, #ff1a1a 90%, transparent);
  box-shadow: 0 0 12px 2px rgba(255, 40, 40, 0.85);
}

.zebra-laser-h1 { animation: zebra-laser-down 1.1s ease-in-out infinite; }
.zebra-laser-h2 { animation: zebra-laser-up 1.1s ease-in-out infinite; }
.zebra-laser-v1 { animation: zebra-laser-right 1.1s ease-in-out infinite; }
.zebra-laser-v2 { animation: zebra-laser-left 1.1s ease-in-out infinite; }

.zebra-hint {
  margin: 0.75rem 0 0;
  text-align: center;
  color: #6b858f;
  font-size: 0.88rem;
  font-weight: 600;
}

@keyframes zebra-laser-down {
  0% { top: 6%; opacity: 0.45; }
  50% { top: 50%; opacity: 1; }
  100% { top: 94%; opacity: 0.45; }
}

@keyframes zebra-laser-up {
  0% { top: 94%; opacity: 0.45; }
  50% { top: 50%; opacity: 1; }
  100% { top: 6%; opacity: 0.45; }
}

@keyframes zebra-laser-right {
  0% { left: 6%; opacity: 0.45; }
  50% { left: 50%; opacity: 1; }
  100% { left: 94%; opacity: 0.45; }
}

@keyframes zebra-laser-left {
  0% { left: 94%; opacity: 0.45; }
  50% { left: 50%; opacity: 1; }
  100% { left: 6%; opacity: 0.45; }
}

@media (max-width: 720px) {
  .btn-scan { width: 49px; }
}

/* Users management */
.users-page {
  display: grid;
  gap: 0.9rem;
}

.users-dash .users-dash-head {
  align-items: center;
}

.users-head-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.users-count-pill {
  background: linear-gradient(145deg, rgba(35, 178, 104, 0.18), rgba(20, 143, 82, 0.08));
  border: 1px solid rgba(140, 210, 170, 0.7);
  color: #0f7a45;
}

.users-open-modal {
  min-height: 1.85rem;
  height: 1.85rem;
  padding: 0.22rem 0.7rem;
  border-radius: 9px;
  font: 800 0.72rem var(--font);
  box-shadow: 0 4px 10px rgba(8, 145, 178, 0.18);
}

html.users-modal-open {
  overflow: hidden;
}

.users-modal-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(560px, calc(100% - 1.5rem));
  max-height: min(90vh, 640px);
  overflow: auto;
  padding: 0;
  border: 1px solid rgba(201, 220, 240, 0.85);
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(12, 28, 52, 0.28);
  color: inherit;
  animation: users-modal-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.users-modal-dialog:not([open]) {
  display: none;
}

.users-modal-dialog[open] {
  display: block;
}

.users-modal-dialog::backdrop {
  background: rgba(12, 28, 52, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.users-modal-dialog.is-adding {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(210, 230, 255, 0.55)),
    linear-gradient(160deg, rgba(8, 145, 178, 0.16), rgba(8, 145, 178, 0.08));
}

.users-modal-dialog.is-editing {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 236, 205, 0.55)),
    linear-gradient(160deg, rgba(224, 161, 74, 0.18), rgba(192, 122, 34, 0.08));
  border-color: rgba(230, 190, 130, 0.75);
}

@keyframes users-modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.users-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem 0.35rem;
}

.users-modal-head h3 {
  margin: 0;
  color: #12345f;
  font-size: 1.1rem;
}

.users-modal-sub {
  margin: 0.25rem 0 0;
  color: #5a7394;
  font-size: 0.82rem;
  font-weight: 600;
}

.users-modal-x {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border: 1px solid #c5d5e8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  color: #0891b2;
  cursor: pointer;
}

.users-modal-x svg {
  width: 1.05rem;
  height: 1.05rem;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
}

.users-modal-dialog .user-form {
  padding: 0.55rem 1rem 1.05rem;
}

.users-modal-dialog .user-form-grid {
  grid-template-columns: 1fr;
}

.user-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.user-form .field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 800;
  font-size: 0.8rem;
  color: #3a5578;
}

.users-field-name label { color: #0891b2; }
.users-field-phone label { color: #0f7a45; }
.users-field-role label { color: #6d28d9; }
.users-field-pass label { color: #9a5b12; }

.user-form input {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.8rem;
  border: 1px solid #c5d5e8;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.88);
  font: 600 0.98rem var(--font);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.users-field-name input:focus {
  border-color: #06b6d4;
  outline: 3px solid rgba(61, 124, 196, 0.16);
}

.users-field-phone input:focus {
  border-color: #23b268;
  outline: 3px solid rgba(35, 178, 104, 0.16);
}

.users-field-role input:focus {
  border-color: #8b5cf6;
  outline: 3px solid rgba(139, 92, 246, 0.16);
}

.users-field-pass input:focus {
  border-color: #e0a14a;
  outline: 3px solid rgba(224, 161, 74, 0.18);
}

.field-error {
  margin: 0.35rem 0 0;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 700;
}

.field-hint {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.user-form-actions {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.95rem;
  flex-wrap: wrap;
}

.users-table-panel {
  overflow: hidden;
}

.users-table-wrap {
  padding: 0 0.35rem 0.55rem;
  overflow-x: auto;
}

.users-dash .users-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.users-dash .users-table th {
  background: rgba(232, 242, 252, 0.92) !important;
  color: #0891b2;
  font-weight: 800;
  height: 2.75rem;
  padding: 0.45rem 0.65rem !important;
  white-space: nowrap;
  vertical-align: middle;
}

.users-dash .users-table tbody tr td {
  background: rgba(255, 255, 255, 0.42);
  border-bottom: 1px solid rgba(201, 220, 240, 0.55);
  vertical-align: middle;
  height: 3.15rem;
  padding: 0.4rem 0.65rem !important;
  white-space: nowrap;
}

.users-dash .users-table tbody tr:nth-child(even) td {
  background: rgba(241, 247, 253, 0.55);
}

.users-dash .users-table tbody tr:hover td {
  background: rgba(220, 236, 252, 0.72);
}

.users-name-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  height: 2.15rem;
  flex-wrap: nowrap;
}

.users-avatar {
  flex: 0 0 auto;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #06b6d4, #0891b2);
  box-shadow: 0 4px 10px rgba(8, 145, 178, 0.2);
}

.users-avatar svg {
  width: 1rem;
  height: 1rem;
}

.users-col-num {
  width: 3.2rem;
  text-align: center;
  color: #0891b2;
  font-weight: 800;
}

.users-col-name {
  width: 34%;
}

.users-col-role {
  width: 22%;
}

.users-col-phone {
  width: 16%;
}

.users-col-perms {
  width: 4.5rem;
  text-align: center;
  font-weight: 800;
  color: #3d5560;
}

.users-col-actions {
  width: 14rem;
}

.users-dash .btn-perms {
  color: #5b21b6;
  background: #f3e8ff;
  border-color: #d8b4fe;
}

.users-dash .btn-perms:hover {
  background: #ede9fe;
}

.user-perms-page .user-perms-form {
  display: grid;
  gap: 1rem;
}

.user-perms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 0.85rem;
}

.user-perms-card {
  padding: 0.85rem 0.95rem 1rem;
  border: 1px solid #d7e2ef;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.user-perms-card.is-on {
  border-color: #cffafe;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.user-perms-section {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font-weight: 800;
  color: #1a2b33;
}

.user-perms-section-check {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #06b6d4;
}

.user-perms-screens {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #cbd5e1;
}

.user-perms-screens-hint {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  color: #6b858f;
  font-weight: 600;
}

.user-perms-screen-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.user-perms-screen {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: #3d5560;
  cursor: pointer;
  padding: 0.28rem 0.4rem;
  border-radius: 8px;
}

.user-perms-screen.is-blocked {
  background: #fef2f2;
  color: #991b1b;
  font-weight: 700;
}

.user-perms-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.users-dash .users-table th.users-col-num,
.users-dash .users-table td.users-col-num {
  text-align: center;
}

.users-name {
  color: #12345f;
  font-size: 0.9rem;
  line-height: 1.2;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-dash .row-tag {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  height: 1.45rem;
  min-height: 1.45rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;
}

.users-dash .row-tag-self {
  background: rgba(35, 178, 104, 0.14);
  color: #0f7a45;
  border-color: rgba(140, 210, 170, 0.7);
}

.users-dash .row-tag-staff {
  background: rgba(61, 124, 196, 0.14);
  color: #0891b2;
  border-color: rgba(160, 190, 230, 0.75);
}

.users-phone {
  color: #0f7a45;
  font-weight: 800;
  line-height: 1;
}

.users-role {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.55rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
  color: #5b21b6;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-role.is-staff-role {
  color: #0891b2;
  background: rgba(61, 124, 196, 0.14);
  border-color: rgba(160, 190, 230, 0.75);
}

.users-role.is-exec-role {
  color: #9a3412;
  background: rgba(251, 146, 60, 0.18);
  border-color: rgba(253, 186, 116, 0.85);
}

.users-role.is-mgr-role {
  color: #0891b2;
  background: rgba(45, 212, 191, 0.16);
  border-color: rgba(94, 234, 212, 0.75);
}

.users-field-role select {
  width: 100%;
  min-height: 2.4rem;
  border-radius: 10px;
  border: 1px solid #d8c6f5;
  background: #faf7ff;
  color: #4c1d95;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
}

.users-table .actions-cell {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  align-items: center;
  height: 2.15rem;
}

.inline-form { display: inline; margin: 0; }

.users-dash .btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.85rem;
  min-height: 1.85rem;
  padding: 0 0.65rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font: 700 0.8rem var(--font);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.users-dash .btn-edit {
  background: linear-gradient(145deg, rgba(210, 230, 255, 0.85), rgba(8, 145, 178, 0.12));
  color: #0891b2;
  border-color: rgba(160, 190, 230, 0.8);
}

.users-dash .btn-delete {
  background: linear-gradient(145deg, rgba(255, 220, 220, 0.85), rgba(201, 72, 72, 0.12));
  color: #9c2828;
  border-color: rgba(220, 150, 150, 0.8);
}

.users-locked {
  display: inline-flex;
  align-items: center;
  height: 1.85rem;
  min-height: 1.85rem;
  padding: 0 0.55rem;
  border-radius: 8px;
  font: 700 0.75rem var(--font);
  line-height: 1;
  color: #6a809c;
  background: rgba(230, 236, 244, 0.8);
  border: 1px solid rgba(180, 195, 210, 0.7);
  white-space: nowrap;
}

.users-dash .is-editing-row td {
  background: rgba(255, 244, 220, 0.72) !important;
  box-shadow: inset 0 0 0 1px rgba(224, 161, 74, 0.35);
}

.activity-filter {
  margin-bottom: 0.85rem;
}

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

.activity-phone {
  color: #5a7394;
  font-size: 0.72rem;
  font-weight: 700;
}

.activity-col-when {
  width: 9.6rem;
  white-space: nowrap;
}

.activity-col-dur {
  width: 8.2rem;
  white-space: nowrap;
}

.activity-col-status {
  width: 8.4rem;
}

.activity-col-ip {
  width: 8.5rem;
  color: #5a7394;
  font-size: 0.78rem;
}

.users-dash .row-tag-online {
  background: rgba(35, 178, 104, 0.14);
  color: #0f7a45;
  border-color: rgba(140, 210, 170, 0.7);
}

.users-dash .row-tag-out {
  background: rgba(61, 124, 196, 0.12);
  color: #0891b2;
  border-color: rgba(160, 190, 230, 0.75);
}

.users-dash .row-tag-missed {
  background: rgba(224, 161, 74, 0.16);
  color: #9a5b12;
  border-color: rgba(232, 190, 120, 0.75);
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 1.2rem !important;
}

@media (max-width: 860px) {
  .user-form-grid { grid-template-columns: 1fr; }
  .users-dash .users-dash-head {
    align-items: flex-start;
  }
}

/* ??? ???? ?????? ??? */
.perf-hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.95fr) minmax(0, 1.35fr);
  gap: 0.9rem 1.1rem;
  padding: 0.95rem 1.05rem;
  border-radius: 16px;
  margin-bottom: 0.85rem;
  align-items: stretch;
}

.perf-hero-good {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(210, 245, 228, 0.35)),
    linear-gradient(160deg, rgba(35, 178, 104, 0.14), rgba(20, 143, 82, 0.06));
  border-color: rgba(140, 210, 170, 0.55);
}

.perf-hero-ok {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(210, 230, 255, 0.35)),
    linear-gradient(160deg, rgba(61, 124, 196, 0.16), rgba(8, 145, 178, 0.06));
  border-color: rgba(160, 190, 230, 0.55);
}

.perf-hero-warn {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 236, 205, 0.4)),
    linear-gradient(160deg, rgba(224, 161, 74, 0.18), rgba(192, 122, 34, 0.07));
  border-color: rgba(230, 190, 130, 0.6);
}

.perf-hero-bad {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 220, 226, 0.4)),
    linear-gradient(160deg, rgba(212, 95, 120, 0.18), rgba(168, 55, 82, 0.07));
  border-color: rgba(220, 150, 165, 0.6);
}

.perf-score {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.perf-tone-mark,
.perf-meta-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
}

.perf-tone-mark {
  width: 2.35rem;
  height: 2.35rem;
}

.perf-meta-mark {
  width: 1.35rem;
  height: 1.35rem;
}

.perf-tone-mark svg,
.perf-meta-mark svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.perf-meta-mark svg {
  width: 0.85rem;
  height: 0.85rem;
}

.perf-score-good .perf-tone-mark {
  color: #15803d;
  background: rgba(34, 197, 94, 0.18);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.55);
}

.perf-score-ok .perf-tone-mark {
  color: #0e7490;
  background: rgba(34, 211, 238, 0.18);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.5);
}

.perf-score-warn .perf-tone-mark {
  color: #b45309;
  background: rgba(251, 191, 36, 0.22);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.5);
}

.perf-score-bad .perf-tone-mark {
  color: #be123c;
  background: rgba(251, 113, 133, 0.2);
  box-shadow: 0 0 16px rgba(251, 113, 133, 0.5);
}

.perf-meta-best .perf-meta-mark {
  color: #15803d;
  background: rgba(34, 197, 94, 0.18);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.45);
}

.perf-meta-drop .perf-meta-mark {
  color: #be123c;
  background: rgba(251, 113, 133, 0.18);
  box-shadow: 0 0 12px rgba(251, 113, 133, 0.45);
}

.perf-meta-return .perf-meta-mark {
  color: #b45309;
  background: rgba(251, 191, 36, 0.2);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.perf-score-ring {
  width: 5.2rem;
  height: 5.2rem;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 4px solid #c9dcf0;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.perf-score-ring strong {
  font-size: 1.65rem;
  color: #12345f;
}

.perf-score-good .perf-score-ring { border-color: #23b268; }
.perf-score-ok .perf-score-ring { border-color: #06b6d4; }
.perf-score-warn .perf-score-ring { border-color: #e0a14a; }
.perf-score-bad .perf-score-ring { border-color: #d45f78; }

.perf-score-good .perf-score-ring strong { color: #0f7a45; }
.perf-score-ok .perf-score-ring strong { color: #0891b2; }
.perf-score-warn .perf-score-ring strong { color: #9a5b12; }
.perf-score-bad .perf-score-ring strong { color: #a83752; }

.perf-score-eyebrow {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: #7a90ab;
  letter-spacing: 0.02em;
}

.perf-score-copy h3 {
  margin: 0 0 0.2rem;
  color: #12345f;
  font-size: 1.15rem;
}

.perf-score-copy p {
  margin: 0;
  color: #5a7394;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
}

.perf-hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.perf-meta-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid transparent;
}

.perf-meta-best {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.75), rgba(210, 245, 228, 0.4)),
    linear-gradient(160deg, rgba(35, 178, 104, 0.28), rgba(20, 143, 82, 0.12));
  border-color: rgba(140, 210, 170, 0.7);
}

.perf-meta-drop {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.75), rgba(255, 220, 220, 0.4)),
    linear-gradient(160deg, rgba(201, 72, 72, 0.28), rgba(156, 40, 40, 0.12));
  border-color: rgba(220, 150, 150, 0.7);
}

.perf-meta-return {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.75), rgba(255, 232, 200, 0.42)),
    linear-gradient(160deg, rgba(224, 161, 74, 0.28), rgba(192, 122, 34, 0.12));
  border-color: rgba(230, 190, 130, 0.7);
}

.perf-meta-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: #6a809c;
}

.perf-meta-name {
  color: #0a0a0a;
  font-size: 0.9rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.perf-meta-value {
  font-weight: 800;
  font-size: 0.88rem;
}

.perf-meta-best .perf-meta-value { color: #0f7a45; }
.perf-meta-drop .perf-meta-value { color: #9c2828; }
.perf-meta-return .perf-meta-value { color: #9a5b12; }

.perf-kpi-top {
  margin-bottom: 0;
}

.perf-snapshot {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.perf-snapshot .perf-hero {
  margin-bottom: 0;
}

.perf-decision-row {
  margin-bottom: 0.85rem;
}

.perf-tables-duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  align-items: start;
}

.perf-panel-compact {
  margin: 0;
  min-width: 0;
}

.perf-panel-compact .dash-panel-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.7rem;
}

.perf-panel-compact .dash-panel-head h3 {
  font-size: 0.88rem;
}

.perf-table-scroll {
  max-height: min(22rem, 52vh);
  overflow: auto;
  border-radius: 0 0 12px 12px;
}

.perf-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef4fb !important;
  box-shadow: 0 1px 0 #d5e3f2;
}

.perf-table-scroll tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 3;
}

.perf-cell-clip {
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ??? ????? ????? ? ??????? ????? ??????? */
.perf-orb {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.55rem 0.7rem 0.75rem;
  align-items: center;
}

.perf-orb-stage {
  position: relative;
  width: min(100%, 15.5rem);
  aspect-ratio: 1;
  margin-inline: auto;
}

.perf-orb-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.perf-orb-disc {
  fill: rgba(255, 255, 255, 0.72);
  stroke: rgba(186, 210, 235, 0.65);
  stroke-width: 1;
}

.perf-orb-guide {
  fill: none;
  stroke: rgba(148, 163, 184, 0.28);
  stroke-width: 18;
  stroke-linecap: round;
}

.perf-orb-track {
  fill: none;
  stroke: rgba(226, 232, 240, 0.95);
  stroke-width: 16;
  stroke-linecap: round;
}

.perf-orb-arc {
  fill: none;
  stroke-width: 16;
  stroke-linecap: round;
  transition: stroke-dasharray 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
  opacity: 0.92;
}

.perf-orb-arc.tone-good { stroke: #0f7a45; }
.perf-orb-arc.tone-bad { stroke: #dc2626; }
.perf-orb-arc.tone-flat { stroke: #94a3b8; }

.perf-orb-arc.is-active {
  opacity: 1;
  stroke-width: 18;
  filter: brightness(1.05);
}

.perf-orb-arc.is-dim {
  opacity: 0.28;
}

.perf-orb-dot {
  fill: #fff;
  stroke-width: 2.5;
  transition: r 0.25s ease;
}

.perf-orb-dot.tone-good { stroke: #0f7a45; }
.perf-orb-dot.tone-bad { stroke: #dc2626; }
.perf-orb-dot.tone-flat { stroke: #94a3b8; }

.perf-orb-hub {
  position: absolute;
  inset: 28%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), rgba(236, 245, 255, 0.88));
  box-shadow:
    inset 0 0 0 1px rgba(186, 210, 235, 0.55),
    0 8px 22px rgba(18, 52, 95, 0.08);
  animation: seller-in 0.45s ease both;
}

.perf-orb-hub-kicker {
  font-size: 0.62rem;
  font-weight: 800;
  color: #6b858f;
  letter-spacing: 0.02em;
}

.perf-orb-hub-delta {
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.15;
  color: #3d5560;
  margin-top: 0.1rem;
}

.perf-orb-hub-delta.is-up { color: #047857; }
.perf-orb-hub-delta.is-down { color: #b91c1c; }

.perf-orb-hub-sub {
  font-size: 0.58rem;
  font-weight: 700;
  color: #94a3b8;
  margin-top: 0.12rem;
}

.perf-orb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.perf-orb-item {
  animation: seller-in 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

.perf-orb-item-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 0.45rem minmax(0, 1fr);
  gap: 0.4rem;
  align-items: stretch;
  padding: 0.35rem 0.42rem;
  border-radius: 8px;
  border: 1px solid rgba(201, 220, 240, 0.55);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  text-align: start;
  font: inherit;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.perf-orb-item-btn:hover,
.perf-orb-item.is-active .perf-orb-item-btn {
  border-color: rgba(8, 145, 178, 0.45);
  background: #fff;
  box-shadow: 0 4px 14px rgba(18, 52, 95, 0.08);
}

.perf-orb-swatch {
  width: 0.4rem;
  border-radius: 999px;
  background: #94a3b8;
  align-self: stretch;
}

.perf-orb-item.tone-good .perf-orb-swatch { background: #0f7a45; }
.perf-orb-item.tone-bad .perf-orb-swatch { background: #dc2626; }

.perf-orb-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}

.perf-orb-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  min-width: 0;
}

.perf-orb-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: #12345f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.perf-orb-line {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: 0.28rem;
  align-items: baseline;
  min-width: 0;
}

.perf-orb-lbl {
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.2;
}

.perf-orb-line.is-a .perf-orb-lbl { color: #0f7a45; }
.perf-orb-line.is-b .perf-orb-lbl { color: #0891b2; }

.perf-orb-num {
  font-size: 0.68rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: end;
  direction: ltr;
  unicode-bidi: plaintext;
}

.perf-orb-line.is-a .perf-orb-num { color: #065f3a; }
.perf-orb-line.is-b .perf-orb-num { color: #0e7490; }

.perf-orb-delta {
  font-size: 0.7rem;
  font-weight: 900;
  color: #6b858f;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: plaintext;
}

.perf-orb-item.tone-good .perf-orb-delta { color: #047857; }
.perf-orb-item.tone-bad .perf-orb-delta { color: #b91c1c; }

@media (max-width: 900px) {
  .perf-orb {
    grid-template-columns: 1fr;
  }
  .perf-orb-stage {
    width: min(100%, 13.5rem);
  }
}

/* ??? ?????? ? ????? ? */
.perf-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-inline-start: auto;
}

.perf-leg {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.68rem;
  font-weight: 800;
}

.perf-leg::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 4px;
}

.perf-leg-a { color: #065f3a; }
.perf-leg-a::before {
  background: linear-gradient(90deg, #23b268, #0f7a45);
}

.perf-leg-b { color: #0e7490; }
.perf-leg-b::before {
  background: linear-gradient(90deg, #06b6d4, #0891b2);
}

.perf-leg-high { color: #047857; }
.perf-leg-high::before { background: #0f7a45; }

.perf-leg-low { color: #b91c1c; }
.perf-leg-low::before { background: #dc2626; }

.perf-inv-chart {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.4rem 0.55rem 0.55rem;
}

.perf-inv-chart.is-scroll {
  height: min(26rem, 58vh);
  max-height: min(26rem, 58vh);
  overflow-y: auto;
  overflow-x: hidden;
}

.perf-inv-row {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.28rem 0.4rem 0.32rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(201, 220, 240, 0.55);
  animation: seller-in 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 28ms);
}

.perf-inv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  min-width: 0;
}

.perf-inv-name {
  font-size: 0.7rem;
  font-weight: 800;
  color: #12345f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
  line-height: 1.2;
}

.perf-inv-bars {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  width: 100%;
  min-width: 0;
  direction: ltr;
}

.perf-inv-bar-line {
  display: grid;
  grid-template-columns: 0.95rem minmax(0, 1fr) 3.6rem;
  gap: 0.3rem;
  align-items: center;
  width: 100%;
}

.perf-inv-tag {
  font-size: 0.58rem;
  font-weight: 900;
  text-align: center;
  line-height: 1;
  color: #6b858f;
}

.perf-inv-track {
  display: block;
  position: relative;
  height: 0.55rem;
  border-radius: 3px;
  overflow: hidden;
  min-width: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
}

.perf-inv-fill {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: 0 2px 2px 0;
  transition: none;
}

.perf-inv-fill.is-high {
  background: #0f7a45;
}

.perf-inv-fill.is-low {
  background: #dc2626;
}

.perf-inv-val {
  font-size: 0.66rem;
  font-weight: 800;
  min-width: 0;
  text-align: end;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #3d5560;
}

.perf-inv-val.is-high { color: #047857; }
.perf-inv-val.is-low { color: #b91c1c; }

.perf-inv-fill.is-qty {
  background: #b45309;
}

.perf-inv-val.is-qty { color: #9a3412; }

.perf-inv-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-inline-end: 0.28rem;
  border-radius: 4px;
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
  font-size: 0.58rem;
  font-weight: 900;
  vertical-align: middle;
}

/* ???? ????? ??????? ? ??? ????? perf-inv */
.dash-returns-pair #chart-items-board.perf-inv-chart,
.dash-chart-items #chart-items-board.perf-inv-chart {
  height: min(26rem, 58vh);
  max-height: min(26rem, 58vh);
  overflow-y: auto;
  overflow-x: hidden;
  gap: 0.28rem;
  padding: 0.4rem 0.55rem 0.55rem;
  box-sizing: border-box;
}

.dash-returns-pair #chart-items-board .perf-inv-row.is-return {
  background: rgba(255, 255, 255, 0.72);
}

.dash-returns-pair #chart-items-board .perf-inv-delta.is-down {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
  border-radius: 4px;
  padding: 0.08rem 0.2rem;
}

.perf-inv-delta {
  font-size: 0.64rem;
  font-weight: 800;
  text-align: end;
  color: #6b858f;
  flex-shrink: 0;
  line-height: 1.2;
}

.perf-inv-delta.is-up {
  color: #047857;
  background: rgba(16, 185, 129, 0.14);
  border-radius: 4px;
  padding: 0.08rem 0.2rem;
}

.perf-inv-delta.is-down {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.14);
  border-radius: 4px;
  padding: 0.08rem 0.2rem;
}

.perf-dash .perf-compare-table th,
.perf-dash .perf-compare-table td {
  padding: 0.32rem 0.4rem !important;
  font-size: 0.74rem !important;
  white-space: nowrap;
}

.perf-kpi .dash-kpi-hint.is-up { color: #0b7a45; }
.perf-kpi .dash-kpi-hint.is-down { color: #b34040; }

.perf-kpi-sales {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(210, 245, 228, 0.35)),
    linear-gradient(160deg, rgba(35, 178, 104, 0.22), rgba(20, 143, 82, 0.1));
  border-color: rgba(140, 210, 170, 0.65);
}
.perf-kpi-sales .dash-kpi-value { color: #0f7a45; }

.perf-kpi-invoices {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(210, 230, 255, 0.35)),
    linear-gradient(160deg, rgba(8, 145, 178, 0.22), rgba(8, 145, 178, 0.1));
  border-color: rgba(160, 190, 230, 0.65);
}
.perf-kpi-invoices .dash-kpi-value { color: #0891b2; }

.perf-kpi-returns {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 220, 226, 0.38)),
    linear-gradient(160deg, rgba(212, 95, 120, 0.22), rgba(168, 55, 82, 0.1));
  border-color: rgba(220, 150, 165, 0.65);
}
.perf-kpi-returns .dash-kpi-value { color: #a83752; }

.perf-kpi-rate {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 232, 200, 0.4)),
    linear-gradient(160deg, rgba(224, 161, 74, 0.24), rgba(192, 122, 34, 0.1));
  border-color: rgba(230, 190, 130, 0.65);
}
.perf-kpi-rate .dash-kpi-value { color: #9a5b12; }

.perf-kpi-basket {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(225, 235, 250, 0.4)),
    linear-gradient(160deg, rgba(91, 141, 239, 0.2), rgba(61, 124, 196, 0.1));
  border-color: rgba(170, 195, 235, 0.65);
}
.perf-kpi-basket .dash-kpi-value { color: #06b6d4; }

.perf-kpi-rows {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(230, 236, 244, 0.4)),
    linear-gradient(160deg, rgba(109, 127, 147, 0.2), rgba(68, 84, 104, 0.1));
  border-color: rgba(180, 195, 210, 0.65);
}
.perf-kpi-rows .dash-kpi-value { color: #445468; }

.perf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  margin-bottom: 0.95rem;
}

.perf-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.perf-panel .dash-panel-head h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #12345f;
}

.perf-actions,
.perf-alerts,
.perf-list {
  list-style: none;
  margin: 0;
  padding: 0.75rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.perf-actions {
  counter-reset: perf-act;
}

.perf-action {
  counter-increment: perf-act;
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  gap: 0.45rem 0.65rem;
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(201, 220, 240, 0.65);
}

.perf-action::before {
  content: counter(perf-act);
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font: 800 0.75rem var(--font);
  color: #fff;
  background: #0891b2;
  grid-row: 1 / span 2;
  align-self: start;
}

.perf-action.sev-high::before { background: #b34040; }
.perf-action.sev-medium::before { background: #c07a22; }
.perf-action.sev-low::before { background: #06b6d4; }

.perf-action-text {
  font-weight: 700;
  color: #0a0a0a;
  font-size: 0.88rem;
  grid-column: 2;
}

.perf-action-src {
  grid-column: 2;
  font-size: 0.72rem;
  color: #7a90ab;
  font-weight: 600;
}

.perf-alert {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(201, 220, 240, 0.65);
  border-inline-start: 4px solid #06b6d4;
}

.perf-alert.sev-high { border-inline-start-color: #b34040; }
.perf-alert.sev-medium { border-inline-start-color: #c07a22; }
.perf-alert.sev-low { border-inline-start-color: #06b6d4; }

.perf-alert strong {
  display: block;
  color: #12345f;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.perf-alert p {
  margin: 0;
  color: #5a7394;
  font-size: 0.82rem;
  font-weight: 600;
}

.perf-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid rgba(225, 235, 246, 0.8);
  color: #0a0a0a;
  font-weight: 700;
  font-size: 0.86rem;
}

.perf-list li:last-child { border-bottom: 0; }

.perf-list .is-up { color: #0b7a45; }
.perf-list .is-down { color: #b34040; }
.perf-empty {
  color: #7a90ab !important;
  font-weight: 600 !important;
  justify-content: center !important;
}

.perf-filter {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  margin-bottom: 1rem;
}

.perf-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.perf-filter-periods {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.65rem;
  align-items: stretch;
}

.perf-period {
  margin: 0;
  padding: 0.85rem 0.9rem 0.95rem;
  border: 1.5px solid rgba(201, 220, 240, 0.75);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  position: relative;
}

.perf-period legend {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0891b2;
  max-width: calc(100% - 0.5rem);
}

.perf-period-title {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  line-height: 1.25;
}

.perf-period-title strong {
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0;
}

.perf-period-title em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.85;
}

.perf-period-badge {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.perf-period-vs {
  display: grid;
  place-items: center;
  align-self: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  color: #355a86;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(226, 236, 248, 0.9));
  border: 1px solid rgba(170, 196, 224, 0.85);
  box-shadow: 0 2px 8px rgba(40, 80, 130, 0.08);
}

.perf-period-a {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(210, 245, 228, 0.55)),
    linear-gradient(160deg, rgba(35, 178, 104, 0.2), rgba(20, 143, 82, 0.08));
  border-color: rgba(45, 170, 110, 0.85);
  box-shadow:
    inset 4px 0 0 #1fa85c,
    0 0 0 1px rgba(35, 178, 104, 0.08);
}

.perf-period-a legend {
  color: #0b6b3c;
}

.perf-period-a .perf-period-title em {
  color: #1a8a52;
}

.perf-period-a .perf-period-badge {
  background: linear-gradient(160deg, #2bc978, #1a9a55);
}

.perf-period-a input[type="date"] {
  border-color: #7fc9a0;
  background: rgba(255, 255, 255, 0.92);
}

.perf-period-a input[type="date"]:focus {
  outline: 2px solid rgba(35, 178, 104, 0.4);
  border-color: #1fa85c;
}

.perf-period-b {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 236, 205, 0.58)),
    linear-gradient(160deg, rgba(224, 161, 74, 0.22), rgba(192, 122, 34, 0.09));
  border-color: rgba(210, 150, 60, 0.88);
  box-shadow:
    inset 4px 0 0 #d08920,
    0 0 0 1px rgba(224, 161, 74, 0.08);
}

.perf-period-b legend {
  color: #8a4f0c;
}

.perf-period-b .perf-period-title em {
  color: #b06a14;
}

.perf-period-b .perf-period-badge {
  background: linear-gradient(160deg, #e0a14a, #c07818);
}

.perf-period-b input[type="date"] {
  border-color: #dbb56e;
  background: rgba(255, 255, 255, 0.92);
}

.perf-period-b input[type="date"]:focus {
  outline: 2px solid rgba(224, 161, 74, 0.45);
  border-color: #d08920;
}

.perf-period.is-disabled {
  opacity: 0.5;
  filter: grayscale(0.15);
}

.perf-period-tag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.35;
  vertical-align: baseline;
}

.perf-period-tag.is-current {
  color: #0b6b3c;
  background: rgba(35, 178, 104, 0.16);
}

.perf-period-tag.is-previous {
  color: #8a4f0c;
  background: rgba(224, 161, 74, 0.2);
}

.perf-compare-table .perf-col-a {
  color: #0b6b3c !important;
  background: rgba(35, 178, 104, 0.14) !important;
}

.perf-compare-table .perf-col-b {
  color: #0891b2 !important;
  background: rgba(61, 124, 196, 0.14) !important;
}

.perf-compare-table .perf-col-delta {
  color: #445468 !important;
  background: rgba(148, 163, 184, 0.12) !important;
}

.perf-compare-table .perf-col-ret {
  color: #9a5b12 !important;
  background: rgba(224, 161, 74, 0.16) !important;
}

.perf-compare-table .perf-col-inv {
  color: #5b21b6 !important;
  background: rgba(139, 92, 246, 0.12) !important;
}

.perf-compare-table .perf-cell-a {
  color: #065f3a !important;
  background: rgba(35, 178, 104, 0.08) !important;
  font-weight: 700;
}

.perf-compare-table .perf-cell-b {
  color: #0e7490 !important;
  background: rgba(61, 124, 196, 0.08) !important;
  font-weight: 700;
}

.perf-compare-table .perf-cell-ret {
  color: #92400e !important;
  background: rgba(224, 161, 74, 0.1) !important;
  font-weight: 700;
}

.perf-compare-table .perf-cell-inv {
  color: #5b21b6 !important;
  background: rgba(139, 92, 246, 0.08) !important;
  font-weight: 700;
}

.perf-compare-table .perf-cell-delta.is-up {
  color: #047857 !important;
  background: rgba(16, 185, 129, 0.16) !important;
  font-weight: 800;
}

.perf-compare-table .perf-cell-delta.is-down {
  color: #b91c1c !important;
  background: rgba(239, 68, 68, 0.16) !important;
  font-weight: 800;
}

.perf-compare-table .is-up { color: #0b7a45; font-weight: 800; }
.perf-compare-table .is-down { color: #b34040; font-weight: 800; }

.perf-filter .field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #5a7394;
  margin-bottom: 0.22rem;
}

.perf-filter select,
.perf-filter input[type="date"] {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #c5d5e8;
  border-radius: 10px;
  background: #fff;
  font: 600 0.86rem var(--font);
  color: var(--ink);
}

.perf-filter-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
}

.perf-note {
  margin: 0;
  padding: 0.55rem 0.9rem 0;
  color: #8a6a2b;
  font-size: 0.82rem;
  font-weight: 700;
}

.perf-dash .sales-grand-row td {
  background: #e6f6ee !important;
  border-top: 2px solid #23b268;
  color: #0f7a45;
  font-weight: 800;
}

.perf-dash .sales-grand-row .sales-amt {
  background: #d8f3e4 !important;
  color: #0b7a45;
}

@media (max-width: 760px) {
  .perf-tables-duo,
  .perf-grid,
  .perf-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .perf-hero,
  .perf-filter-grid,
  .perf-filter-periods {
    grid-template-columns: 1fr;
  }

  .perf-hero-meta {
    grid-template-columns: 1fr;
  }

  .perf-period {
    grid-template-columns: 1fr 1fr;
  }

  .perf-period-vs {
    width: 100%;
    height: 1.8rem;
    border-radius: 999px;
  }
}

/* ?? ????? ??????? ?? */
.inv-dash .inv-hero-copy h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  color: #143a6b;
}

.inv-dash .inv-hero-copy p {
  margin: 0;
  color: #5a7394;
  font-size: 0.88rem;
}

.inv-dash .inv-note {
  margin-top: 0.55rem !important;
  font-size: 0.78rem !important;
  color: #7a8fa8 !important;
  line-height: 1.45;
}

.inv-dash .inv-summary {
  display: grid;
  gap: 0.85rem;
  margin: 0.85rem 0 0.35rem;
}

.inv-dash .inv-top {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.55rem 0 0.4rem;
  align-items: stretch;
}

.inv-dash .inv-top > .dash-kpi-card {
  min-height: 5.25rem;
  height: 100%;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  gap: 0.15rem;
  border-radius: 12px;
  box-sizing: border-box;
}

.inv-dash .inv-top .dash-kpi-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.inv-dash .inv-summary-scope {
  padding: 0.5rem 0.6rem;
  gap: 0;
  justify-content: center;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.75), rgba(220, 236, 252, 0.4)),
    linear-gradient(160deg, rgba(8, 145, 178, 0.2), rgba(8, 145, 178, 0.1));
  border-color: rgba(160, 190, 230, 0.7);
}

.inv-dash .inv-summary-scope-main {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.inv-dash .inv-summary-scope-main .dash-kpi-ico {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 8px;
  flex-shrink: 0;
}

.inv-dash .inv-summary-scope-main .dash-kpi-ico svg {
  width: 0.75rem;
  height: 0.75rem;
}

.inv-dash .inv-summary-scope-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.inv-dash .inv-summary-scope-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #5a7394;
}

.inv-dash .inv-summary-scope-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #143a6b;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inv-dash .inv-summary-note {
  display: none;
}

.inv-dash .inv-summary-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.inv-dash .inv-hl-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: #1a3358;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inv-dash .inv-hl-wh {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(210, 245, 228, 0.38)),
    linear-gradient(160deg, rgba(35, 178, 104, 0.26), rgba(20, 143, 82, 0.12));
  border-color: rgba(140, 210, 170, 0.7);
}

.inv-dash .inv-hl-wh .dash-kpi-value {
  color: #0f7a45;
  font-size: 0.85rem;
}

.inv-dash .inv-hl-group {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(210, 230, 255, 0.38)),
    linear-gradient(160deg, rgba(8, 145, 178, 0.26), rgba(8, 145, 178, 0.12));
  border-color: rgba(160, 190, 230, 0.7);
}

.inv-dash .inv-hl-group .dash-kpi-value {
  color: #0891b2;
  font-size: 0.85rem;
}

.inv-dash .inv-hl-branch {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 232, 200, 0.4)),
    linear-gradient(160deg, rgba(224, 161, 74, 0.28), rgba(192, 122, 34, 0.12));
  border-color: rgba(230, 190, 130, 0.7);
}

.inv-dash .inv-hl-branch .dash-kpi-value {
  color: #9a5b12;
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .inv-dash .inv-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .inv-dash .inv-top,
  .inv-dash .inv-summary-highlights {
    grid-template-columns: 1fr;
  }
}

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

.inv-dash .inv-value,
.inv-dash .inv-col-cost {
  color: #92400e !important;
  font-weight: 800;
}

.inv-dash .inv-table-compact th.inv-col-qty,
.inv-dash .inv-table-compact td.inv-col-qty {
  background: #eafaf0 !important;
  color: #166534 !important;
  font-weight: 800;
}

.inv-dash .inv-table-compact th.inv-col-cost,
.inv-dash .inv-table-compact td.inv-col-cost {
  background: #fef7e8 !important;
  color: #92400e !important;
  font-weight: 800;
}

.inv-dash .inv-table-compact th.inv-col-share,
.inv-dash .inv-table-compact td.inv-col-share {
  background: #eef6fd !important;
  color: #0891b2 !important;
  font-weight: 700;
}

.inv-dash .sales-grand-row .inv-value,
.inv-dash .sales-grand-row .inv-col-cost,
.inv-dash .inv-table-scroll tfoot td.inv-col-cost {
  color: #78350f !important;
  background: #fdeecd !important;
}

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

.inv-dash .sales-grand-row .inv-col-qty,
.inv-dash .inv-table-scroll tfoot td.inv-col-qty {
  color: #14532d !important;
  background: #d7f3e3 !important;
}

.inv-dash .perf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
}

.inv-dash .inv-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.45rem 0 0.9rem;
}

.inv-dash .inv-kpi-card {
  min-height: 5.25rem;
  height: 100%;
  min-width: 0;
  justify-content: flex-start;
  padding: 0.5rem 0.6rem;
  gap: 0.15rem;
  border-radius: 12px;
  box-sizing: border-box;
}

.inv-dash .inv-kpi-card .dash-kpi-label {
  font-size: 0.68rem;
  gap: 0.28rem;
}

.inv-dash .inv-kpi-card .dash-kpi-ico {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 6px;
}

.inv-dash .inv-kpi-card .dash-kpi-ico svg {
  width: 0.65rem;
  height: 0.65rem;
}

.inv-dash .inv-kpi-card .dash-kpi-value {
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.inv-dash .inv-kpi-card .dash-kpi-hint {
  font-size: 0.64rem;
}

.inv-dash .inv-filter {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 0.55rem 0.75rem;
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  overflow: visible;
  position: relative;
  z-index: 80;
  isolation: auto;
}

.inv-dash .inv-filter .perf-filter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.inv-dash .inv-filter .field {
  min-width: 0;
}

.inv-dash .inv-filter .field label {
  font-size: 0.68rem;
  margin-bottom: 0.12rem;
}

.inv-dash .inv-filter select {
  min-height: 2rem;
  padding: 0.22rem 0.45rem;
  border-radius: 8px;
  font-size: 0.8rem;
}

/* ????? ?????? ????? ? ???? ?????? ?????? */
.inv-dash .inv-select {
  position: relative;
  width: 100%;
  min-width: 0;
  z-index: 1;
}

.inv-dash .inv-select.is-open {
  z-index: 90;
}

.inv-dash .inv-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.inv-dash .inv-select-trigger {
  width: 100%;
  min-height: 2.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.28rem 0.55rem 0.28rem 0.65rem;
  border: 1px solid #c5d5e8;
  border-radius: 10px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font: 650 0.82rem var(--font);
  color: #143a6b;
  cursor: pointer;
  text-align: right;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.inv-dash .inv-select-trigger:hover {
  border-color: #9bb6d6;
}

.inv-dash .inv-select.is-open .inv-select-trigger {
  border-color: #06b6d4;
  box-shadow:
    0 0 0 3px rgba(8, 145, 178, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.inv-dash .inv-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-dash .inv-select-caret {
  display: grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  color: #5a7394;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.inv-dash .inv-select-caret svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inv-dash .inv-select.is-open .inv-select-caret {
  transform: rotate(180deg);
  color: #0891b2;
}

.inv-dash .inv-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 15.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.3rem;
  border: 1px solid #c5d5e8;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 14px 34px rgba(18, 52, 95, 0.16),
    0 2px 0 rgba(255, 255, 255, 0.8) inset;
  backdrop-filter: blur(10px);
}

.inv-dash .inv-select-option {
  display: block;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1a3358;
  font: 650 0.82rem var(--font);
  text-align: right;
  cursor: pointer;
}

.inv-dash .inv-select-option:hover,
.inv-dash .inv-select-option:focus-visible {
  background: #eaf2fb;
  outline: none;
}

.inv-dash .inv-select-option.is-selected {
  background: linear-gradient(145deg, #e7f1fc, #d7e8fa);
  color: #0891b2;
  font-weight: 800;
}

.inv-dash .inv-select-opt-main {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.55rem;
  min-width: 0;
  width: 100%;
}

.inv-dash .inv-select-opt-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: start;
}

.inv-dash .inv-select-opt-code {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  color: #0891b2;
  font-variant-numeric: tabular-nums;
}

.inv-dash .inv-select-mark {
  background: #ffe08a;
  color: inherit;
  border-radius: 3px;
  padding: 0 0.1rem;
}

.inv-dash .inv-select.is-searchable .inv-select-row {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

/* داخل شريط الفلتر المضغوط: لا تضع مربع البحث بجانب/فوق الزر (يكسر التخطيط). */
.inv-dash .inv-filter .inv-select.is-searchable .inv-select-row {
  display: block;
  min-width: 0;
}

.inv-dash .inv-filter .inv-select.is-searchable .inv-select-row .inv-select-search-input {
  display: none;
}

.inv-dash .inv-select-search-input {
  width: 100%;
  min-height: 2rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid #c5d5e8;
  border-radius: 8px;
  font: 650 0.8rem var(--font);
  color: #143a6b;
  background: #fff;
  box-sizing: border-box;
}

.inv-dash .inv-select-search-input:focus {
  outline: none;
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.14);
}

.inv-dash .inv-select-meta {
  margin: 0.2rem 0.15rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #5a7394;
}

.inv-dash .inv-select-empty {
  padding: 0.75rem 0.55rem;
  text-align: center;
  color: #6b7c93;
  font-size: 0.8rem;
  font-weight: 700;
}

.inv-dash .inv-filter .perf-filter-actions {
  display: flex;
  align-items: end;
  gap: 0.35rem;
  padding-bottom: 0.05rem;
}

.inv-dash .inv-filter .btn-primary {
  min-height: 2rem;
  padding: 0.28rem 0.9rem;
  font-size: 0.78rem;
  border-radius: 8px;
  white-space: nowrap;
}

.inv-dash .inv-table-scroll {
  max-height: calc(1.95rem + (19 * 1.85rem) + 2.4rem);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0;
}

.inv-dash .inv-table-frame {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  background: #fff;
}

.inv-dash .inv-table-frame .inv-table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 0;
}

.inv-dash .inv-table-foot {
  flex: 0 0 auto;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  margin: 0;
  border-top: 2px solid #0e7490;
}

.inv-dash .inv-table-foot td {
  position: static !important;
  background: #0891b2 !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;
}

.inv-dash .inv-table-foot td.inv-col-qty {
  background: #d7f3e3 !important;
  color: #14532d !important;
}

.inv-dash .inv-table-foot td.inv-col-cost {
  background: #fdeecd !important;
  color: #78350f !important;
}

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

.inv-dash .inv-table-foot .inv-col-sticky {
  position: static !important;
  inset: auto !important;
  box-shadow: none !important;
  border-inline-end: 1px solid #0a3a57;
}

.inv-dash .inv-tables-duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.65rem;
  margin: 0.55rem 0 0.65rem;
  align-items: start;
  position: relative;
  z-index: 1;
}

.inv-dash .inv-panel-compact {
  position: relative;
  z-index: 1;
  margin: 0 0 0.65rem;
  min-width: 0;
}

.inv-dash .inv-tables-duo .inv-panel-compact {
  margin-bottom: 0;
}

.inv-dash .inv-panel-compact .dash-panel-head {
  padding: 0.45rem 0.65rem;
}

.inv-dash .inv-panel-compact .dash-panel-head h3 {
  font-size: 0.9rem;
}

.inv-dash .inv-match-hint {
  margin: 0 0.75rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #5a6b7d;
}

.inv-dash .inv-table-compact {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}

.inv-dash .inv-table-compact th,
.inv-dash .inv-table-compact td {
  padding: 0.28rem 0.4rem !important;
  font-size: 0.72rem !important;
  line-height: 1.25;
  white-space: nowrap !important;
  vertical-align: middle;
  box-sizing: border-box;
}

.inv-dash .inv-table-compact .inv-cell-clip,
.inv-dash .inv-table-compact .inv-col-sticky {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  max-width: 0; /* ellipsis ?? fixed layout */
}

.inv-dash .inv-table-compact .inv-col-qty,
.inv-dash .inv-table-compact .inv-col-cost,
.inv-dash .inv-table-compact .inv-col-share,
.inv-dash .inv-table-compact td.mono {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-align: end;
  font-variant-numeric: tabular-nums;
  width: auto !important; /* ?????? width:1% ?? theme */
}

/* ??? ?????: ??? | ???/??? | ????? | ???? | ???? | ??? */
.inv-dash .inv-tables-duo .inv-table-compact th:nth-child(1),
.inv-dash .inv-tables-duo .inv-table-compact td:nth-child(1) {
  width: 26%;
}

.inv-dash .inv-tables-duo .inv-table-compact th:nth-child(2),
.inv-dash .inv-tables-duo .inv-table-compact td:nth-child(2) {
  width: 18%;
}

.inv-dash .inv-tables-duo .inv-table-compact th:nth-child(3),
.inv-dash .inv-tables-duo .inv-table-compact td:nth-child(3) {
  width: 10%;
  text-align: center;
  max-width: none;
}

.inv-dash .inv-tables-duo .inv-table-compact th:nth-child(4),
.inv-dash .inv-tables-duo .inv-table-compact td:nth-child(4) {
  width: 15%;
  max-width: none;
}

.inv-dash .inv-tables-duo .inv-table-compact th:nth-child(5),
.inv-dash .inv-tables-duo .inv-table-compact td:nth-child(5) {
  width: 18%;
  max-width: none;
}

.inv-dash .inv-tables-duo .inv-table-compact th:nth-child(6),
.inv-dash .inv-tables-duo .inv-table-compact td:nth-child(6) {
  width: 13%;
  max-width: none;
}

.inv-dash .inv-table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #e8f0fa !important;
  color: #173e69 !important;
  box-shadow: 0 1px 0 #c5d6ea;
}

.inv-dash .inv-table-scroll thead th.inv-col-qty {
  background: #d7f3e3 !important;
  color: #14532d !important;
}

.inv-dash .inv-table-scroll thead th.inv-col-cost {
  background: #fdeecd !important;
  color: #78350f !important;
}

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

/* ???? ????? ???? ????? ??????? ?????? ? ????? ????? ???? ????? ???? */
.inv-dash .inv-table-scroll .inv-col-sticky {
  position: sticky;
  inset-inline-start: 0;
  z-index: 4;
  background: #ffffff !important;
  opacity: 1;
  border-inline-end: 1px solid #d5e3f2;
  box-shadow: -4px 0 8px -4px rgba(15, 40, 70, 0.18);
}

.inv-dash .inv-table-scroll thead th.inv-col-sticky {
  z-index: 7;
  top: 0;
  background: #e8f0fa !important;
  box-shadow:
    0 1px 0 #c5d6ea,
    -4px 0 8px -4px rgba(15, 40, 70, 0.18);
}

.inv-dash .inv-table-scroll tbody tr:nth-child(even) .inv-col-sticky {
  background: #f3f7fb !important;
}

.inv-dash .inv-table-scroll tbody tr:hover .inv-col-sticky {
  background: #e8f1f8 !important;
}

.inv-dash .inv-table-scroll tfoot td.inv-col-sticky,
.inv-dash .inv-table-scroll tfoot .inv-col-sticky {
  z-index: 8;
  bottom: 0;
  background: #0891b2 !important;
  color: #fff !important;
  border-inline-end-color: #0a3a57;
  box-shadow:
    0 -2px 0 #0e7490,
    -4px 0 8px -4px rgba(0, 0, 0, 0.25);
}

.inv-dash .inv-table-scroll tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 6;
  background: #0891b2 !important;
  color: #fff !important;
  box-shadow: 0 -2px 0 #0e7490;
  max-width: none;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 1100px) {
  .inv-dash .inv-tables-duo {
    grid-template-columns: 1fr;
  }
}

.inv-dash .inv-rank-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  min-width: 0;
}

.inv-dash .inv-rank-chart {
  padding: 0.45rem 0.55rem 0.65rem;
  max-height: calc(1.85rem + (15 * 1.85rem));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.inv-dash .inv-rank-period {
  margin: 0;
  padding: 0 0.65rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #5a7394;
}

.inv-dash .inv-rank-row {
  --bar-pct: 0%;
  --i: 0;
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  gap: 0.4rem;
  align-items: start;
  animation: inv-rank-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 40ms);
}

@keyframes inv-rank-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.inv-dash .inv-rank-num {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-radius: 999px;
  background: #eaf2fb;
  color: #0891b2;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  direction: ltr;
  padding: 0;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

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

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

.inv-dash .inv-rank-row:nth-child(3) .inv-rank-num {
  background: linear-gradient(145deg, #e0a14a, #c07a22);
  color: #fff;
}

.inv-dash .inv-rank-body {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.inv-dash .inv-rank-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
}

.inv-dash .inv-rank-name {
  font-size: 0.74rem;
  font-weight: 800;
  color: #1a3358;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.inv-dash .inv-rank-pct {
  font-size: 0.72rem;
  flex-shrink: 0;
}

.inv-dash .inv-rank-track {
  height: 0.55rem;
  border-radius: 999px;
  background: #e2eef2;
  overflow: hidden;
  width: 100%;
}

.inv-dash .inv-rank-fill {
  display: block;
  height: 100%;
  width: 0;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #0891b2);
}

.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-meta {
  font-size: 0.66rem;
  color: #5a7394;
  font-weight: 700;
}

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

/* ترتيب المشتريات (أصناف / مستخدمون) — نفس تصميم ترتيب المخازن */
.purchase-dash .inv-rank-chart {
  padding: 0.45rem 0.55rem 0.65rem;
  max-height: calc(1.85rem + (15 * 1.85rem));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.purchase-dash .inv-rank-row {
  --bar-pct: 0%;
  --i: 0;
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  gap: 0.4rem;
  align-items: start;
  animation: inv-rank-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 40ms);
}

.purchase-dash .inv-rank-num {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border-radius: 999px;
  background: #eaf2fb;
  color: #0891b2;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  direction: ltr;
  padding: 0;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

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

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

.purchase-dash .inv-rank-row:nth-child(3) .inv-rank-num {
  background: linear-gradient(145deg, #e0a14a, #c07a22);
  color: #fff;
}

.purchase-dash .inv-rank-body {
  min-width: 0;
  display: grid;
  gap: 0.18rem;
}

.purchase-dash .inv-rank-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
}

.purchase-dash .inv-rank-name {
  font-size: 0.74rem;
  font-weight: 800;
  color: #1a3358;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.purchase-dash .inv-rank-pct {
  font-size: 0.72rem;
  flex-shrink: 0;
}

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

.purchase-dash .inv-rank-fill {
  display: block;
  height: 100%;
  width: 0;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #0891b2);
}

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

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

.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;
}

.purchase-dash .purchase-items-board .inv-rank-row:nth-child(1) .inv-rank-num {
  background: linear-gradient(145deg, #34d399, #047857);
  color: #fff;
}

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

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

.purchase-dash .purchase-items-panel .inv-rank-chart,
.purchase-dash .purchase-users-panel .inv-rank-chart {
  max-height: 27rem;
}

@media (prefers-reduced-motion: reduce) {
  .purchase-dash .inv-rank-row {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inv-dash .inv-rank-row {
    animation: none;
  }
}

@media (min-width: 1101px) {
  .inv-dash .inv-branch-charts-row {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }
}

.inv-dash .inv-branch-stagnant-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  min-width: 0;
}

.inv-dash .inv-stagnant-panel {
  min-width: 0;
}

.inv-dash .inv-wastage-panel {
  min-width: 0;
}

.inv-dash .inv-wastage-panel .inv-table-scroll {
  max-height: 18rem;
}

.inv-dash .inv-wastage-panel .inv-table-compact {
  min-width: 40rem;
}

.inv-dash .inv-wastage-highlight {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  margin: 0.35rem 0.55rem 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(198, 40, 40, 0.2);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff7f7, #fff 62%, #fce8e8);
  box-shadow: 0 7px 18px rgba(120, 30, 30, 0.08);
}

.inv-dash .inv-wastage-highlight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #dc4b4b, #a91f1f);
}

.inv-dash .inv-wastage-highlight-icon svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inv-dash .inv-wastage-highlight-body {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.inv-dash .inv-wastage-highlight-label {
  color: #8d3a3a;
  font-size: 0.66rem;
  font-weight: 800;
}

.inv-dash .inv-wastage-highlight-name {
  overflow: hidden;
  color: #641d1d;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-dash .inv-wastage-highlight-meta {
  overflow: hidden;
  color: #7f5a5a;
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-dash .inv-wastage-highlight-side {
  display: grid;
  gap: 0.1rem;
  text-align: end;
  white-space: nowrap;
}

.inv-dash .inv-wastage-highlight-side strong {
  color: #c62828;
  font-size: 0.95rem;
}

.inv-dash .inv-wastage-highlight-side > span {
  color: #a23a3a;
  font-size: 0.64rem;
  font-weight: 800;
}

.inv-dash .inv-wastage-value,
.inv-dash .inv-wastage-total,
.inv-dash .inv-wastage-total .money {
  color: #c62828;
  font-weight: 800;
}

.inv-dash .inv-wastage-share {
  color: #b42318;
  font-weight: 800;
}

@media (max-width: 640px) {
  .inv-dash .inv-wastage-highlight {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.5rem 0.7rem;
  }

  .inv-dash .inv-wastage-highlight-side {
    grid-column: 1 / -1;
    padding-inline-start: 3.2rem;
    text-align: start;
  }
}

/* ???? ????? ????????? */
.purchase-dash .purchase-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(8.5rem, 0.8fr)) repeat(2, minmax(10rem, 1fr)) minmax(14rem, 1.35fr) auto;
  align-items: end;
  gap: 0.6rem;
  margin: 0.65rem 0 0.85rem;
  padding: 0.7rem;
  border-radius: 14px;
}

.purchase-dash .purchase-filter .field {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.purchase-dash .purchase-filter label {
  color: #294f78;
  font-size: 0.7rem;
  font-weight: 800;
}

.purchase-dash .purchase-filter input,
.purchase-dash .purchase-filter select {
  width: 100%;
  min-width: 0;
  min-height: 2.2rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #c9d9eb;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  color: #183d66;
  font-size: 0.76rem;
}

.purchase-dash .purchase-filter .btn-primary {
  min-height: 2.2rem;
  white-space: nowrap;
}

.purchase-dash .purchase-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.purchase-dash .purchase-kpi {
  min-width: 0;
  min-height: 7rem;
  padding: 0.75rem;
}

.purchase-dash .purchase-kpi .dash-kpi-label {
  color: #315777;
  font-size: 0.68rem;
  gap: 0.32rem;
}

.purchase-dash .purchase-kpi .dash-kpi-ico {
  width: 1.28rem;
  height: 1.28rem;
  border-radius: 7px;
}

.purchase-dash .purchase-kpi .dash-kpi-ico svg {
  width: 0.72rem;
  height: 0.72rem;
}

.dash-kpi-ico-pur-total {
  background: linear-gradient(145deg, #23b268, #12854b);
  box-shadow: 0 4px 10px rgba(18, 133, 75, 0.22);
}

.dash-kpi-ico-pur-net {
  background: linear-gradient(145deg, #22d3ee, #1d6bb8);
  box-shadow: 0 4px 10px rgba(29, 107, 184, 0.22);
}

.dash-kpi-ico-pur-vat {
  background: linear-gradient(145deg, #e53935, #b71c1c);
  box-shadow: 0 4px 10px rgba(183, 28, 28, 0.22);
}

.dash-kpi-ico-pur-inv {
  background: linear-gradient(145deg, #6b7c93, #445468);
  box-shadow: 0 4px 10px rgba(68, 84, 104, 0.2);
}

.dash-kpi-ico-pur-vendors {
  background: linear-gradient(145deg, #e0a14a, #c07a22);
  box-shadow: 0 4px 10px rgba(192, 122, 34, 0.2);
}

.dash-kpi-ico-pur-qty {
  background: linear-gradient(145deg, #00897b, #00695c);
  box-shadow: 0 4px 10px rgba(0, 137, 123, 0.22);
}

.purchase-dash .purchase-kpi .dash-kpi-value {
  overflow: hidden;
  font-size: clamp(0.88rem, 1.15vw, 1.12rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-dash .purchase-kpi .dash-kpi-hint {
  color: #a33a32;
  font-size: 0.62rem;
}

.purchase-dash .purchase-kpi-total {
  border-color: rgba(35, 178, 104, 0.38);
  background: linear-gradient(145deg, #fff, #e8f8ef);
}

.purchase-dash .purchase-kpi-total .dash-kpi-value,
.purchase-dash .purchase-kpi-net .dash-kpi-value {
  color: #0b7a45;
}

.purchase-dash .purchase-kpi-vat {
  border-color: rgba(198, 40, 40, 0.24);
  background: linear-gradient(145deg, #fff, #fff0f0);
}

.purchase-dash .purchase-kpi-vat .dash-kpi-value {
  color: #c62828;
}

.purchase-dash .purchase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0.8rem;
}

.purchase-dash .purchase-panel {
  min-width: 0;
}

.purchase-dash .purchase-branch-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.purchase-returns-dash .pr-q-field {
  min-width: 12rem;
  flex: 1 1 12rem;
}

.purchase-returns-dash .pr-return-kpis .purchase-kpi-total,
.purchase-returns-dash .pr-return-kpis .purchase-kpi-net {
  border-color: rgba(185, 28, 28, 0.35);
}

.purchase-returns-dash .pr-amt {
  color: #b91c1c;
  font-weight: 800;
}

.purchase-returns-dash .pr-limit-note {
  margin: -0.25rem 0 0.85rem;
  color: #9a3412;
}

.purchase-returns-dash .vt-excel-btn {
  min-height: 2.35rem;
  padding-inline: 0.9rem;
  font-weight: 700;
}

.purchase-returns-dash .pr-loader {
  text-align: center;
  padding: 0.55rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #06b6d4;
  background: #f1f6fc;
  border-top: 1px dashed #c3d4ea;
}

.purchase-returns-dash .pr-loader.pr-done {
  color: #6b858f;
  background: #fff;
  border-top-style: solid;
}

.purchase-returns-dash .ed-panel {
  overflow: visible;
}

.purchase-returns-dash .pr-returns-scroll {
  max-height: none;
  overflow: visible;
}

.purchase-returns-dash .pr-returns-table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
  font-size: 0.85rem;
}

.purchase-returns-dash .pr-returns-table th,
.purchase-returns-dash .pr-returns-table td {
  padding: 0.4rem 0.45rem;
  white-space: nowrap;
  vertical-align: middle;
}

.purchase-returns-dash .pr-returns-scroll thead th {
  position: sticky;
  top: 0.5rem;
  z-index: 5;
  background: #fdf1f1 !important;
  color: #7f1d1d;
  box-shadow: 0 1px 0 #ecc9c9, 0 6px 14px -8px rgba(127, 29, 29, 0.25);
}

.purchase-returns-dash .pr-returns-table tbody tr:hover td {
  background: #fdf5f5 !important;
}

.purchase-returns-dash .pr-returns-table td small {
  display: inline-block;
  margin-inline-start: 0.35rem;
  color: #6b858f;
  font-weight: 600;
  font-size: 0.72rem;
}

.purchase-returns-dash .pr-returns-table .pr-vendor,
.purchase-returns-dash .pr-returns-table .pr-item {
  width: 1%;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.purchase-returns-dash .pr-returns-table .pr-branch,
.purchase-returns-dash .pr-returns-table .pr-group {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #475569;
}

.purchase-returns-dash .pr-returns-table tbody td.pr-col-amt {
  background: #fef2f2 !important;
  color: #b91c1c;
  font-weight: 800;
}

.purchase-returns-dash .pr-returns-scroll thead th.pr-col-amt {
  background: #fee2e2 !important;
  color: #991b1b;
}

.purchase-returns-dash .pr-returns-table tfoot td.pr-col-amt {
  background: #fecaca !important;
  color: #7f1d1d;
}

.purchase-returns-dash .pr-vendors-wrap {
  max-height: min(70vh, 42rem);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #d5e0ee;
  border-radius: 8px;
  background: #ffffff;
  isolation: isolate;
}

.purchase-returns-dash .pr-vendors-table {
  font-size: 0.78rem;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff !important;
}

.purchase-returns-dash .pr-vendors-table th,
.purchase-returns-dash .pr-vendors-table td {
  padding: 0.28rem 0.4rem !important;
  line-height: 1.25;
  vertical-align: middle;
}

.purchase-returns-dash .pr-vendors-wrap thead th {
  top: 0 !important;
  z-index: 30 !important;
  background: #0e7490 !important;
  background-color: #0e7490 !important;
  background-image: none !important;
  color: #ffffff !important;
  opacity: 1 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
  font-size: 0.72rem;
}

.purchase-returns-dash .pr-vendors-table tbody td {
  background: #ffffff !important;
}

.purchase-returns-dash .pr-vendors-table tbody tr:nth-child(even) td {
  background: #f3f6fb !important;
}

.purchase-returns-dash .pr-vendors-table tbody tr.pr-vendor-row:hover td {
  background: #e8f0fa !important;
}

.purchase-returns-dash .pr-vendors-table .pr-vendor {
  max-width: 14rem;
}

.purchase-returns-dash .pr-vendors-table .pr-vendor small {
  display: block;
  margin-inline-start: 0;
  margin-top: 0.05rem;
  font-size: 0.65rem;
  color: #6b7c93;
  font-weight: 600;
}

.purchase-returns-dash .pr-vendors-table tbody td.pr-col-amt {
  background: #fef2f2 !important;
  color: #b91c1c;
  font-weight: 800;
}

.purchase-returns-dash .pr-vendors-table tbody tr:nth-child(even) td.pr-col-amt {
  background: #fee2e2 !important;
}

.purchase-returns-dash .pr-vendors-table tbody tr.pr-vendor-row:hover td.pr-col-amt {
  background: #fecaca !important;
}

.purchase-returns-dash .pr-vendors-wrap thead th.pr-col-amt {
  background: #0e7490 !important;
  color: #fecaca !important;
}

.purchase-returns-dash .pr-vendors-table tfoot .sales-grand-row td {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: #0e7490 !important;
  background-color: #0e7490 !important;
  background-image: none !important;
  color: #ffffff !important;
  border-top: 2px solid #16304f !important;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.18);
  font-weight: 800;
  opacity: 1 !important;
}

.purchase-returns-dash .pr-vendors-table tfoot .sales-grand-row td.pr-col-amt {
  background: #7f1d1d !important;
  background-color: #7f1d1d !important;
  color: #fecaca !important;
}

.purchase-returns-dash .pr-returns-duo {
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.7fr);
  align-items: start;
}

.purchase-returns-dash .pr-branch-panel {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 8px 20px rgba(8, 145, 178, 0.08);
}

.purchase-returns-dash .pr-branch-rank {
  max-height: min(70vh, 42rem);
}

.purchase-returns-dash .pr-branch-rank .income-rank-amt {
  color: #b91c1c;
}

.purchase-returns-dash .pr-branch-rank .income-rank-num {
  color: #991b1b;
  background: #fee2e2;
}

.purchase-returns-dash .pr-branch-rank .income-rank-row:nth-child(1) .income-rank-num {
  background: #b91c1c;
  color: #fff;
}

.purchase-returns-dash .pr-branch-rank .income-rank-row:nth-child(2) .income-rank-num {
  background: #d08920;
  color: #fff;
}

.purchase-returns-dash .pr-branch-rank .income-rank-row:nth-child(3) .income-rank-num {
  background: #6b858f;
  color: #fff;
}

.purchase-returns-dash .pr-vendors-table tbody tr.pr-vendor-row {
  cursor: pointer;
}

.purchase-returns-dash .pr-vendors-table tbody tr.pr-vendor-row.pr-hidden {
  display: none;
}

.purchase-returns-dash .pr-vendors-table tbody tr.pr-vendor-row:focus-visible {
  outline: 2px solid #06b6d4;
  outline-offset: -2px;
}

.purchase-returns-dash .pr-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-inline-end: 0.6rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #f7fcfd;
  color: #0891b2;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #e0f7fa;
}

.purchase-returns-dash .pr-back-link:hover {
  background: #ecfeff;
}

/* هوية حمراء خفيفة لصفحة مردود المشتريات تميّزها عن المشتريات */
.purchase-returns-dash .dash-head-copy h2 {
  color: #7f1d1d;
}

.purchase-returns-dash .dash-head-copy p {
  color: #b34040;
}

.purchase-returns-dash .pr-return-kpis .purchase-kpi {
  border-color: rgba(185, 28, 28, 0.22);
  background: linear-gradient(145deg, #fff, #fdf1f1);
}

.purchase-returns-dash .pr-return-kpis .dash-kpi-label {
  color: #991b1b;
}

.purchase-returns-dash .pr-return-kpis .dash-kpi-value {
  color: #b91c1c;
}

.purchase-returns-dash .pr-return-kpis .dash-kpi-hint {
  color: #c07070;
}

.purchase-returns-dash .purchase-filter {
  border-color: rgba(185, 28, 28, 0.18);
}

.purchase-returns-dash .purchase-filter label {
  color: #7f2a2a;
}

.purchase-returns-dash .purchase-filter input:focus,
.purchase-returns-dash .purchase-filter select:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
  outline: none;
}

.purchase-returns-dash .purchase-filter .btn-primary {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  box-shadow: 0 10px 22px rgba(185, 28, 28, 0.22);
}

.purchase-returns-dash .purchase-filter .btn-primary:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
}

.purchase-returns-dash .result-pill {
  background: #fdecec;
  border-color: #f3c1c1;
  color: #7f1d1d;
}

.purchase-returns-dash .dash-panel-head h3 {
  color: #7f1d1d;
}

.purchase-returns-dash .ed-panel,
.purchase-returns-dash .pr-branch-panel {
  border: 1px solid rgba(185, 28, 28, 0.14);
}

.purchase-returns-dash .pr-back-link {
  background: #fdecec;
  color: #b91c1c;
  border-color: #f3c1c1;
}

.purchase-returns-dash .pr-back-link:hover {
  background: #fadcdc;
}

.purchase-returns-dash .pr-loader {
  color: #b91c1c;
  background: #fdf1f1;
  border-top-color: #f3c1c1;
}

.purchase-returns-dash .pr-loader.pr-done {
  color: #a37272;
  background: #fff;
}

.purchase-returns-dash .pr-vendors-wrap {
  border-color: #edd5d5;
}

.purchase-returns-dash .pr-vendors-wrap thead th {
  background: #7f1d1d !important;
  background-color: #7f1d1d !important;
}

.purchase-returns-dash .pr-vendors-table tfoot .sales-grand-row td {
  background: #7f1d1d !important;
  background-color: #7f1d1d !important;
  border-top-color: #5f1212 !important;
}

.purchase-returns-dash .pr-vendors-table tfoot .sales-grand-row td.pr-col-amt {
  background: #991b1b !important;
  background-color: #991b1b !important;
  color: #ffe4e4 !important;
}

.purchase-returns-dash .pr-vendors-table tbody tr.pr-vendor-row:focus-visible {
  outline-color: #dc2626;
}

.purchase-returns-dash .income-rank-period {
  color: #b34040;
}

.unsold-dash .unsold-duo {
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.7fr);
  align-items: start;
}

.unsold-dash .pr-vendors-wrap {
  max-height: min(70vh, 42rem);
}

.unsold-dash .unsold-table .pr-item {
  max-width: 14rem;
}

.unsold-dash .unsold-table .pr-wh {
  max-width: 11rem;
}

.unsold-dash .us-loader {
  margin: 0.4rem 0.6rem 0.6rem;
}

.pr-compare-dash .dash-head-copy p {
  color: #c62828;
}

.pr-compare-dash,
.pr-compare-dash *:not(svg):not(path):not(circle):not(line) {
  font-weight: 700;
}

.pr-compare-dash .dash-head-copy h2,
.pr-compare-dash .dash-panel-head h3,
.pr-compare-dash .pr-compare-filter label,
.pr-compare-dash .pr-compare-chip,
.pr-compare-dash .pr-compare-chip-muted,
.pr-compare-dash .pr-compare-sheet-link,
.pr-compare-dash .btn-primary,
.pr-compare-dash th {
  font-weight: 800;
}

.pr-compare-dash .pr-compare-filter {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 1.05rem 0.9rem;
  margin-bottom: 0.9rem;
  border-radius: 16px;
  border: 1px solid #d5e3f2;
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 8px 22px rgba(18, 52, 95, 0.06);
}

.pr-compare-dash .pr-compare-filter::before,
.pr-compare-dash .pr-compare-filter::after {
  content: none;
}

.pr-compare-dash .pr-compare-filter-grid {
  display: grid;
  grid-template-columns:
    minmax(8.5rem, 10rem)
    minmax(0, 1.1fr)
    minmax(0, 1.1fr)
    minmax(0, 1fr)
    minmax(0, 1fr)
    minmax(0, 0.9fr)
    auto;
  gap: 0.75rem 0.85rem;
  align-items: end;
}

.pr-compare-dash .pr-compare-filter .field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
}

.pr-compare-dash .req-user-suggest {
  position: relative;
  min-width: 0;
  width: 100%;
}

.pr-compare-dash .req-user-suggest .vendor-suggest-list {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  z-index: 50;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  max-height: 14rem;
  overflow: auto;
  background: #fff;
  border: 1px solid #cfdceb;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 35, 65, 0.14);
}

.pr-compare-dash .req-user-suggest .vendor-suggest-list[hidden] {
  display: none !important;
}

.pr-compare-dash .req-user-suggest .vendor-suggest-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.45rem 0.7rem;
  border: 0;
  background: transparent;
  text-align: start;
  cursor: pointer;
  font: inherit;
  color: #1d334d;
}

.pr-compare-dash .req-user-suggest .vendor-suggest-option:hover,
.pr-compare-dash .req-user-suggest .vendor-suggest-option.is-active {
  background: #eef8f1;
}

.pr-compare-dash .req-user-suggest .vendor-suggest-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pr-compare-dash .req-user-suggest .vendor-suggest-code {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: #5d738c;
}

.pr-compare-dash .req-user-suggest .vendor-suggest-empty {
  padding: 0.55rem 0.7rem;
  color: #6a7f96;
  font-size: 0.85rem;
}

.pr-compare-dash .pr-compare-filter label {
  color: #148f52;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.pr-compare-dash .pr-compare-filter input[type="date"],
.pr-compare-dash .pr-compare-filter input[type="search"],
.pr-compare-dash .pr-compare-filter select {
  width: 100%;
  min-height: 2.55rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid #cfdceb;
  border-radius: 10px;
  background: #fff;
  color: #173e69;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pr-compare-dash .pr-compare-filter select option {
  font-family: var(--font);
  font-weight: 700;
  color: #173e69;
}

.pr-compare-dash .pr-compare-filter input[type="date"]:hover,
.pr-compare-dash .pr-compare-filter select:hover {
  border-color: #9fbae0;
}

.pr-compare-dash .pr-compare-filter input[type="date"]:focus,
.pr-compare-dash .pr-compare-filter select:focus {
  outline: none;
  border-color: #1d6bb8;
  box-shadow: 0 0 0 3px rgba(29, 107, 184, 0.14);
}

.pr-compare-dash .pr-compare-filter select:disabled {
  background: #f3f6fa;
  color: #8aa0b8;
  cursor: not-allowed;
}

.pr-compare-dash .pr-compare-select-wrap {
  position: relative;
}

.pr-compare-dash .pr-compare-select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  inset-inline-end: 0.85rem;
  width: 0.45rem;
  height: 0.45rem;
  border-inline-end: 2px solid #6a829e;
  border-bottom: 2px solid #6a829e;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.pr-compare-dash .pr-compare-select-wrap select {
  appearance: none;
  padding-inline-end: 2rem;
}

.pr-compare-dash .pr-compare-submit {
  min-height: 2.55rem;
  padding-inline: 1.15rem;
  border-radius: 10px;
  white-space: nowrap;
}

.pr-compare-dash .pr-compare-filter-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.pr-compare-dash .pr-compare-chip,
.pr-compare-dash .pr-compare-chip-muted {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.pr-compare-dash .pr-compare-chip {
  background: #fdecea;
  color: #c62828;
}

.pr-compare-dash .pr-compare-chip.is-today {
  background: #eaf8ef;
  color: #148f52;
}

.pr-compare-dash .pr-compare-chip.is-wh {
  background: #fff4e5;
  color: #b06a00;
}

.pr-compare-dash .pr-compare-chip-muted {
  background: #eaf8ef;
  color: #148f52;
}

.pr-compare-dash .pr-compare-table-wrap {
  max-height: 32rem;
  overflow: auto;
}

.pr-compare-dash .pr-compare-list-panel .dash-panel-head {
  background: #fff;
  border-bottom: 1px solid #e5eef8;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.pr-compare-dash .pr-compare-list-panel .dash-panel-head h3 {
  color: #c62828;
  font-weight: 800;
}

.pr-compare-dash .pr-compare-list-sheet {
  width: 100%;
  min-width: 52rem;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-list-col-req {
  min-width: 5.5rem;
  color: #148f52;
  font-weight: 900;
  text-align: center;
  background: #eaf8ef;
}

.pr-compare-dash .pr-compare-list-sheet thead .pr-compare-list-col-req {
  background: #d9f5e3;
  color: #0f5c22;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-list-col-when {
  min-width: 8.5rem;
  text-align: center;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-list-col-vendor,
.pr-compare-dash .pr-compare-list-sheet .pr-compare-list-col-user {
  min-width: 10rem;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: #173e69;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-list-col-user {
  color: #c62828;
  background: #fdecea;
  font-weight: 800;
}

.pr-compare-dash .pr-compare-list-sheet thead .pr-compare-list-col-user {
  background: #f8d7d4;
  color: #b71c1c;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-list-col-short {
  width: 5.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #6b858f;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-list-col-short.is-short {
  color: #b91c1c;
  font-weight: 800;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-list-col-pr {
  min-width: 8.5rem;
  max-width: 14rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #6b858f;
  line-height: 1.25;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-list-col-pr.is-hit {
  color: #0891b2;
  font-weight: 700;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-pr-hit {
  display: block;
  font-weight: 800;
  color: #0891b2;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-pr-nos {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78em;
  font-weight: 700;
  color: #115e59;
  word-break: break-word;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-pr-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0.35rem;
  padding: 0.1rem 0.15rem;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-pr-link:hover,
.pr-compare-dash .pr-compare-list-sheet .pr-compare-pr-link:focus-visible {
  background: #e0f7fa;
  outline: none;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-pr-link:hover .pr-compare-pr-nos,
.pr-compare-dash .pr-compare-list-sheet .pr-compare-pr-link:focus-visible .pr-compare-pr-nos {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-list-col-from {
  color: #0e7490;
  font-weight: 800;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-list-col-main {
  color: #6d28d9;
  font-weight: 800;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-pr-miss {
  color: #b91c1c;
  font-weight: 800;
}

.pr-compare-dash .pr-compare-sheet .pr-compare-sheet-pr {
  min-width: 7rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: #6b858f;
}

.pr-compare-dash .pr-compare-sheet .pr-compare-sheet-pr.is-hit {
  color: #0891b2;
  font-weight: 800;
}

.pr-compare-dash .pr-compare-sheet .pr-compare-pr-doc-link {
  color: #0891b2;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  white-space: nowrap;
}

.pr-compare-dash .pr-compare-sheet .pr-compare-pr-doc-link:hover,
.pr-compare-dash .pr-compare-sheet .pr-compare-pr-doc-link:focus-visible {
  color: #115e59;
}

.pr-compare-dash .pr-match-sheet .pr-compare-sheet-pr-list {
  min-width: 12rem;
  text-align: start;
}

.pr-compare-dash .pr-match-sheet .pr-compare-sheet-pr-list.is-hit {
  color: #0891b2;
}

.pr-compare-dash .pr-match-sheet .pr-compare-sheet-pr-list.is-miss {
  color: #b45309;
}

.pr-compare-dash .pr-match-pr-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.pr-compare-dash .pr-match-pr-list li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.pr-compare-dash .pr-match-pr-day {
  font-size: 0.78em;
  color: #6b858f;
  font-weight: 600;
}

.pr-compare-dash .pr-match-none {
  color: #b45309;
  font-weight: 700;
  font-size: 0.92em;
}

.pr-compare-dash .pr-match-sheet tr.is-pr-miss {
  background: #fffbeb;
}

.pr-compare-dash .pr-match-sheet tr.is-pr-hit {
  background: #ecfeff;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-short-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-short-link:hover,
.pr-compare-dash .pr-compare-list-sheet .pr-compare-short-link:focus-visible {
  color: #7f1d1d;
}

.pr-compare-dash .pr-compare-short-only-note {
  margin: 0 0.85rem 0.65rem;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-list-col-items {
  min-width: 4.2rem;
  text-align: center;
  font-weight: 800;
  color: #b45309;
}

.pr-compare-dash .pr-compare-list-sheet .pr-compare-list-col-action {
  min-width: 5.5rem;
  text-align: center;
}

.pr-compare-dash .pr-compare-sheet-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.7rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid #c62828;
  border-radius: 6px;
  background: #c62828;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
}

.pr-compare-dash .pr-compare-sheet-link:hover {
  background: #a51f1f;
  border-color: #a51f1f;
  color: #fff;
}

.pr-compare-dash .pr-compare-list-sheet tbody tr:nth-child(even) td {
  background: #f8fbff;
}

.pr-compare-dash .pr-compare-list-sheet tbody tr:nth-child(even) .pr-compare-list-col-req {
  background: #dff3e7;
}

.pr-compare-dash .pr-compare-list-sheet tbody tr:nth-child(even) .pr-compare-list-col-user {
  background: #f9e0dd;
}

.pr-compare-dash .pr-compare-list-sheet tbody tr:hover td {
  background: #eef5ff;
}

.pr-compare-dash .pr-compare-list-sheet tbody tr:hover .pr-compare-list-col-req {
  background: #d9f5e3;
}

.pr-compare-dash .pr-compare-list-sheet tbody tr:hover .pr-compare-list-col-user {
  background: #f8d7d4;
}

.pr-compare-dash .pr-compare-req-id small,
.pr-compare-dash .pr-compare-item-sub {
  color: #6a829e;
  font-weight: 600;
}

.pr-compare-dash .pr-compare-vendor {
  max-width: 12rem;
  overflow: hidden;
  color: #173e69;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pr-compare-dash .pr-compare-qty {
  color: #c62828;
  font-weight: 800;
}

.pr-compare-dash .pr-compare-open {
  display: inline-flex;
  text-decoration: none;
  white-space: nowrap;
}

.pr-compare-dash .dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.pr-compare-dash .pr-compare-back {
  flex-shrink: 0;
  text-decoration: none;
}

.pr-compare-dash .pr-compare-meta {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
}

.pr-compare-dash .pr-compare-meta-label {
  display: block;
  color: #6a829e;
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.pr-compare-dash .pr-compare-items {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pr-compare-dash .pr-compare-item-card.is-empty {
  border-color: rgba(198, 40, 40, 0.22);
}

.pr-compare-dash .pr-compare-pill-empty {
  background: #fdecea;
  color: #c62828;
}

.pr-compare-dash .pr-compare-item-empty {
  margin: 0.35rem 0 0;
}

.pr-compare-dash .pr-compare-sheet-panel {
  padding-bottom: 0.75rem;
}

.pr-compare-dash .pr-compare-sheet-panel,
.pr-compare-dash .pr-compare-sheet-panel th,
.pr-compare-dash .pr-compare-sheet-panel td {
  font-weight: 700;
}

.pr-compare-dash .pr-compare-sheet-panel th,
.pr-compare-dash .pr-compare-sheet-panel .pr-compare-sheet-name,
.pr-compare-dash .pr-compare-sheet-panel .pr-compare-sheet-name strong {
  font-weight: 800;
}

.pr-compare-dash .pr-compare-sheet-panel .dash-panel-head {
  background: #fff;
}

.pr-compare-dash .pr-compare-sheet-panel .dash-panel-head-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.pr-compare-dash .pr-compare-excel-btn {
  min-height: 2.05rem;
  min-width: 2.05rem;
  padding: 0.35rem 0.7rem;
  gap: 0.35rem;
  font-weight: 800;
  border: 1px solid #86efac;
  background: #ecfdf5;
  color: #166534;
  text-decoration: none;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pr-compare-dash .pr-compare-excel-btn:hover {
  background: #dcfce7;
  border-color: #4ade80;
  color: #14532d;
}
.pr-compare-dash .pr-compare-excel-ico {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pr-compare-dash .pr-compare-excel-label {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.pr-compare-dash .pr-compare-sheet-panel .dash-panel-head h3 {
  color: #c62828;
  font-weight: 800;
}

.pr-compare-dash .pr-compare-sheet-wrap {
  max-height: min(70vh, 42rem);
  overflow: auto;
  border: 1px solid #d7e2ef;
  border-radius: 10px;
  background: #fff;
}

.pr-compare-dash .pr-compare-sheet {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.74rem;
}

.pr-compare-dash .pr-compare-sheet th,
.pr-compare-dash .pr-compare-sheet td {
  border-inline-end: 1px solid #e3ebf5;
  border-bottom: 1px solid #e3ebf5;
  padding: 0.42rem 0.55rem;
  vertical-align: middle;
  white-space: nowrap;
}

.pr-compare-dash .pr-compare-sheet thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #edf3fa;
  color: #173e69;
  font-weight: 800;
  box-shadow: 0 1px 0 #d7e2ef;
}

.pr-compare-dash .pr-compare-sheet-sticky {
  position: sticky;
  z-index: 2;
  background: #fff;
}

.pr-compare-dash .pr-compare-sheet thead .pr-compare-sheet-sticky {
  z-index: 4;
  background: #edf3fa;
}

.pr-compare-dash .pr-compare-sheet-num {
  inset-inline-start: 0;
  min-width: 2.4rem;
  text-align: center;
}

.pr-compare-dash .pr-compare-sheet-name {
  inset-inline-start: 2.4rem;
  min-width: 12rem;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 800;
  color: #173e69;
}

.pr-compare-dash .pr-compare-sheet-name,
.pr-compare-dash .pr-compare-sheet-name strong {
  font-weight: 800;
  font-family: var(--font);
}

.pr-compare-dash .pr-compare-sheet-code {
  inset-inline-start: 14.4rem;
  min-width: 5.5rem;
  color: #4d6788;
}

.pr-compare-dash .pr-compare-sheet-unit {
  inset-inline-start: 19.9rem;
  min-width: 4.2rem;
  text-align: center;
  color: #148f52;
  font-weight: 800;
  background: #eaf8ef;
}

.pr-compare-dash .pr-compare-sheet thead .pr-compare-sheet-unit {
  background: #d9f5e3;
  color: #0f5c22;
}

.pr-compare-dash .pr-compare-sheet-req {
  background: #eaf2ff;
  color: #0891b2;
  font-weight: 900;
  text-align: center;
  min-width: 4.5rem;
}

.pr-compare-dash .pr-compare-sheet thead .pr-compare-sheet-req {
  background: #d9e8ff;
}

.pr-compare-dash .pr-compare-sheet-wh {
  min-width: 7.5rem;
  text-align: center;
}

.pr-compare-dash .pr-compare-sheet-wh-name {
  display: block;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.pr-compare-dash .pr-compare-sheet-wh-branch {
  display: block;
  color: #6a829e;
  font-size: 0.62rem;
  font-weight: 600;
  margin-top: 0.12rem;
}

.pr-compare-dash .pr-compare-sheet-qty {
  text-align: center;
  min-width: 4.2rem;
}

.pr-compare-dash .pr-compare-sheet-qty.has-qty {
  background: #eaf8ef;
  color: #148f52;
  font-weight: 900;
}

.pr-compare-dash .pr-compare-sheet-qty.has-qty.is-expected {
  background: #fff4e5;
  color: #b06a00;
}

.pr-compare-dash .pr-compare-sheet-qty.has-qty.is-neg {
  background: #fdecea;
  color: #c62828;
}

.pr-compare-dash .pr-compare-sheet-qty.is-blank {
  background: #fafbfc;
  color: #c5d0dc;
}

.pr-compare-dash .pr-compare-sheet-total {
  text-align: center;
  min-width: 5.5rem;
  background: #fff8e8;
  color: #b06a00;
  font-weight: 900;
}

.pr-compare-dash .pr-compare-sheet thead .pr-compare-sheet-total {
  background: #ffefcc;
}

.pr-compare-dash .pr-compare-sheet-count {
  text-align: center;
  min-width: 4.8rem;
}

.pr-compare-dash .pr-compare-sheet tbody tr:nth-child(even) .pr-compare-sheet-sticky {
  background: #f8fbff;
}

.pr-compare-dash .pr-compare-sheet tbody tr:nth-child(even) .pr-compare-sheet-unit {
  background: #dff5e8;
}

.pr-compare-dash .pr-compare-sheet tbody tr:hover .pr-compare-sheet-unit {
  background: #d4f0df;
}

.pr-compare-dash .pr-compare-sheet tbody tr:hover td {
  background: #eef5ff;
}

.pr-compare-dash .pr-compare-sheet tbody tr:hover .pr-compare-sheet-req {
  background: #d9e8ff;
}

.pr-compare-dash .pr-compare-sheet tbody tr:hover .pr-compare-sheet-qty.has-qty {
  background: #d9f5e3;
}

.pr-compare-dash .pr-compare-sheet tbody tr:hover .pr-compare-sheet-total {
  background: #ffefcc;
}

.pr-compare-dash .pr-compare-sheet tbody tr.is-empty td {
  opacity: 0.78;
}

.pr-compare-dash .pr-compare-sheet-note {
  margin: 0.65rem 0.2rem 0;
  color: #6a829e;
  font-size: 0.7rem;
  font-weight: 600;
}

.tr-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.55rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.tr-status.is-posted {
  color: #115e59;
  background: #e0f7fa;
  border-color: #a5f3fc;
}

.tr-status.is-approved {
  color: #0e7490;
  background: #d6ebf8;
  border-color: #7eb6d9;
}

.tr-status.is-open {
  color: #9a3412;
  background: #ffedd5;
  border-color: #fdba74;
}

.pr-compare-dash .pr-compare-vbar-chart {
  --bar-max: 12rem;
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  min-height: var(--bar-max);
  height: calc(var(--bar-max) + 3.4rem);
  overflow-x: auto;
  padding: 0.35rem 0.15rem 0.2rem;
}

.pr-compare-dash .pr-compare-vbar-col {
  flex: 1 0 2.4rem;
  min-width: 2.2rem;
  max-width: 3.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
}

.pr-compare-dash .pr-compare-vbar-pct {
  color: #111;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
}

.pr-compare-dash .pr-compare-vbar-track {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 0.55rem;
}

.pr-compare-dash .pr-compare-vbar-fill {
  position: relative;
  width: 100%;
  max-width: 2.1rem;
  height: 0;
  background: linear-gradient(90deg, #147a2e 0%, #2db84a 22%, #6ee88a 48%, #2db84a 78%, #0f5c22 100%);
  border-radius: 0 0 10px 10px;
  box-shadow:
    inset 4px 0 8px rgba(255, 255, 255, 0.22),
    inset -5px 0 10px rgba(0, 0, 0, 0.28),
    0 8px 14px rgba(45, 184, 74, 0.22);
  animation: pr-compare-vbar-grow 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--i) * 35ms + 60ms);
}

.pr-compare-dash .pr-compare-vbar-col.is-request .pr-compare-vbar-fill {
  background: linear-gradient(90deg, #163a9c 0%, #2b5fd4 22%, #6a93ff 48%, #2b5fd4 78%, #122e7a 100%);
  box-shadow:
    inset 4px 0 8px rgba(255, 255, 255, 0.22),
    inset -5px 0 10px rgba(0, 0, 0, 0.28),
    0 8px 14px rgba(43, 95, 212, 0.22);
}

.pr-compare-dash .pr-compare-vbar-col.is-request .pr-compare-vbar-cap {
  background: radial-gradient(ellipse at 50% 40%, #9ab6ff 0%, #2b5fd4 55%, #163a9c 100%);
}

.pr-compare-dash .pr-compare-vbar-cap {
  position: absolute;
  top: -0.5rem;
  left: 0;
  right: 0;
  height: 1rem;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #a8f0b8 0%, #2db84a 55%, #147a2e 100%);
  box-shadow:
    inset 0 -2px 4px rgba(0, 0, 0, 0.18),
    inset 0 2px 4px rgba(255, 255, 255, 0.45);
}

@keyframes pr-compare-vbar-grow {
  from { height: 0; }
  to { height: calc(var(--bar-pct) * 1%); }
}

.pr-compare-dash .pr-compare-vbar-label {
  width: 100%;
  max-height: 2.2rem;
  overflow: hidden;
  color: #173e69;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  word-break: break-word;
}

.pr-compare-dash .pr-compare-vbar-sub {
  color: #6a829e;
  font-size: 0.52rem;
  font-weight: 700;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .pr-compare-dash .pr-compare-filter-grid,
  .pr-compare-dash .pr-compare-meta {
    grid-template-columns: 1fr 1fr;
  }

  .pr-compare-dash .pr-compare-filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .pr-compare-dash .pr-compare-filter-grid,
  .pr-compare-dash .pr-compare-meta {
    grid-template-columns: 1fr;
  }

  .pr-compare-dash .dash-head {
    flex-direction: column;
  }
}

.purchase-dash .purchase-branch-donut.branch-donut {
  grid-template-columns: minmax(7.5rem, 10.5rem) minmax(0, 1fr);
  gap: 0.65rem 0.85rem;
  align-items: start;
  padding: 0.35rem 0.25rem 0.45rem;
  flex: 1;
  min-height: 0;
}

.purchase-dash .purchase-branch-donut .branch-donut-visual {
  max-width: 10.5rem;
  margin-inline: auto;
}

.purchase-dash .purchase-branch-donut .branch-donut-legend {
  max-height: 18rem;
  overflow-y: auto;
  gap: 0.28rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.purchase-dash .purchase-branch-donut .branch-donut-legend-item {
  padding: 0.22rem 0.28rem;
  font-size: 0.7rem;
}

.purchase-dash .purchase-branch-donut .branch-donut-legend-meta {
  font-size: 0.64rem;
  color: #c62828;
  font-weight: 700;
  opacity: 1;
}

.purchase-dash .purchase-branch-donut .branch-donut-pct {
  color: #1b8a4a;
  font-weight: 800;
}

@media (max-width: 720px) {
  .purchase-dash .purchase-branch-donut.branch-donut {
    grid-template-columns: 1fr;
  }
}

.purchase-dash .purchase-request-count {
  color: #c62828;
  font-weight: 900;
}

.purchase-dash .purchase-table-scroll {
  max-height: 27rem;
  overflow: auto;
}

.purchase-dash .purchase-table {
  min-width: 36rem;
}

.purchase-dash .purchase-table th,
.purchase-dash .purchase-table td {
  padding: 0.48rem 0.58rem;
  font-size: 0.72rem;
}

.purchase-dash .purchase-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.purchase-dash .purchase-name {
  max-width: 13rem;
  overflow: hidden;
  color: #173e69;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-dash .purchase-name small {
  color: #8a9bb0;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.purchase-dash .purchase-amount {
  color: #047857 !important;
  font-weight: 800;
  white-space: nowrap;
}

.purchase-dash .purchase-share {
  color: #1765a3;
  font-weight: 800;
}

.purchase-dash .purchase-qty {
  color: #13804b;
  font-weight: 800;
}

@media (max-width: 1250px) {
  .purchase-dash .purchase-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .purchase-dash .purchase-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .purchase-dash .purchase-grid {
    grid-template-columns: 1fr;
  }

  .purchase-dash .purchase-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .purchase-dash .purchase-filter,
  .purchase-dash .purchase-kpis {
    grid-template-columns: 1fr;
  }
}

.inv-dash .inv-stagnant-donut {
  padding: 0.35rem 0.45rem 0.55rem;
}

.inv-dash .inv-branch-stagnant-stack .inv-stagnant-donut.branch-donut,
.inv-dash .inv-rank-stack .inv-stagnant-donut.branch-donut {
  grid-template-columns: minmax(7.5rem, 10rem) minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}

.inv-dash .inv-branch-stagnant-stack .branch-donut-visual,
.inv-dash .inv-rank-stack .branch-donut-visual {
  max-width: 10rem;
  margin-inline: auto;
}

.inv-dash .inv-branch-stagnant-stack .branch-donut-legend,
.inv-dash .inv-rank-stack .branch-donut-legend {
  max-height: 14rem;
  overflow-y: auto;
  gap: 0.25rem;
}

.inv-dash .inv-stagnant-panel,
.inv-dash .inv-group-sales-panel {
  min-height: 28rem;
}

.inv-dash .inv-scope-head {
  align-items: flex-start;
  gap: 0.45rem;
}

.inv-dash .inv-scope-head-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.inv-dash .inv-scope-meta {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: #5a7394;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.inv-dash .inv-scope-sep {
  opacity: 0.7;
}

.inv-dash .inv-stagnant-panel .inv-stagnant-donut.branch-donut,
.inv-dash .inv-group-sales-panel .inv-stagnant-donut.branch-donut {
  min-height: 22rem;
}

/* Stacked (single-column) layout no longer needs tall equal-height panels */
@media (max-width: 1100px) {
  .inv-dash .inv-stagnant-panel,
  .inv-dash .inv-group-sales-panel {
    min-height: 0;
  }

  .inv-dash .inv-stagnant-panel .inv-stagnant-donut.branch-donut,
  .inv-dash .inv-group-sales-panel .inv-stagnant-donut.branch-donut {
    min-height: min(22rem, 60vh);
  }
}

@media (max-width: 480px) {
  .inv-dash .inv-stagnant-panel .inv-stagnant-donut.branch-donut,
  .inv-dash .inv-group-sales-panel .inv-stagnant-donut.branch-donut {
    min-height: min(18rem, 56vh);
  }

  .inv-dash .inv-branch-stagnant-stack .inv-stagnant-donut.branch-donut,
  .inv-dash .inv-rank-stack .inv-stagnant-donut.branch-donut {
    grid-template-columns: 1fr;
  }

  .inv-dash .inv-branch-stagnant-stack .branch-donut-visual,
  .inv-dash .inv-rank-stack .branch-donut-visual {
    max-width: 12rem;
  }
}

.inv-dash .inv-stagnant-panel .branch-donut-legend,
.inv-dash .inv-group-sales-panel .branch-donut-legend {
  max-height: min(52vh, 26rem);
  overflow-y: auto;
}

.inv-dash .inv-group-sales-panel .branch-donut-legend-meta {
  white-space: nowrap;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-dash .inv-branch-stagnant-stack .branch-donut-legend-item,
.inv-dash .inv-rank-stack .branch-donut-legend-item {
  padding: 0.2rem 0.25rem;
  font-size: 0.68rem;
}

@media (max-width: 900px) {
  .inv-dash .inv-filter {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .inv-dash .inv-filter .perf-filter-actions {
    justify-content: stretch;
  }

  .inv-dash .inv-filter .btn-primary {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .inv-dash .inv-filter .perf-filter-grid {
    grid-template-columns: 1fr;
  }
}

/* Phone: comfortable touch targets without hurting desktop density */
@media (max-width: 480px) {
  .inv-dash .inv-filter select,
  .inv-dash .inv-select-trigger {
    min-height: 2.75rem;
  }

  .inv-dash .inv-filter .btn-primary {
    min-height: 2.75rem;
    padding-inline: 0.9rem;
  }

  .inv-dash .inv-select-option {
    padding: 0.6rem 0.6rem;
  }
}

.inv-dash .inv-kpi-value {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 220, 220, 0.35)),
    linear-gradient(160deg, rgba(201, 72, 72, 0.28), rgba(156, 40, 40, 0.14));
  border-color: rgba(220, 150, 150, 0.65);
}

.inv-dash .inv-kpi-value .dash-kpi-value {
  color: #9c2828;
}

.inv-dash .inv-kpi-qty {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(210, 245, 228, 0.38)),
    linear-gradient(160deg, rgba(35, 178, 104, 0.28), rgba(20, 143, 82, 0.14));
  border-color: rgba(140, 210, 170, 0.7);
}

.inv-dash .inv-kpi-qty .dash-kpi-value {
  color: #0f7a45;
}

.inv-dash .inv-kpi-rows {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(210, 230, 255, 0.38)),
    linear-gradient(160deg, rgba(8, 145, 178, 0.28), rgba(8, 145, 178, 0.14));
  border-color: rgba(160, 190, 230, 0.7);
}

.inv-dash .inv-kpi-rows .dash-kpi-value {
  color: #0891b2;
}

.inv-dash .inv-kpi-scope {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 232, 200, 0.4)),
    linear-gradient(160deg, rgba(224, 161, 74, 0.3), rgba(192, 122, 34, 0.14));
  border-color: rgba(230, 190, 130, 0.7);
}

.inv-dash .inv-kpi-scope .dash-kpi-value {
  color: #9a5b12;
}

.inv-dash .inv-kpi-ico-value {
  background: linear-gradient(145deg, #d45f5f, #9c2828);
  box-shadow: 0 4px 12px rgba(156, 40, 40, 0.28);
}

.inv-dash .inv-kpi-ico-qty {
  background: linear-gradient(145deg, #23b268, #148f52);
  box-shadow: 0 4px 12px rgba(20, 143, 82, 0.25);
}

.inv-dash .inv-kpi-ico-rows {
  background: linear-gradient(145deg, #22d3ee, #0891b2);
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.25);
}

.inv-dash .inv-kpi-ico-scope {
  background: linear-gradient(145deg, #e0a14a, #c07a22);
  box-shadow: 0 4px 12px rgba(192, 122, 34, 0.25);
}

@media (max-width: 1100px) {
  .inv-dash .perf-kpi-grid,
  .inv-dash .inv-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .inv-dash .perf-kpi-grid,
  .inv-dash .inv-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ?? ????? ????? ?? */
.income-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.65rem 0.75rem;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(180, 205, 230, 0.85);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(232, 241, 251, 0.72));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.income-filter-bar-main {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.65rem 0.85rem;
  flex: 1 1 auto;
  min-width: 0;
}

.income-filter-period {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.income-filter-period-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #5a7394;
  letter-spacing: 0.02em;
}

.income-filter-period-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid #c9dae8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.income-filter-period-fields .income-filter-field {
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
}

.income-filter-period-fields .income-filter-field label {
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1;
}

.income-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.income-filter-field label {
  font-size: 0.66rem;
  font-weight: 700;
  color: #6a829e;
}

.income-filter-field input[type="date"],
.income-filter-field select {
  height: 2.05rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid #c5d5e8;
  border-radius: 8px;
  background: #fff;
  color: #12345f;
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 9.5rem;
}

.income-filter-posted {
  flex: 0 1 13rem;
}

.income-filter-posted select {
  min-width: 12rem;
  width: 100%;
}

.income-filter-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.05rem;
  color: #8aa0bc;
  font-size: 0.85rem;
  font-weight: 800;
  padding-inline: 0.1rem;
}

.income-filter-submit {
  height: 2.15rem;
  padding: 0 1.15rem;
  border-radius: 10px;
  font-size: 0.82rem;
  white-space: nowrap;
  flex: 0 0 auto;
}

.finance-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  align-self: end;
}

.btn-ghost.finance-excel-btn,
.finance-excel-btn,
.suppliers-dash .suppliers-excel-btn,
.assets-excel-btn,
.trial-balance-dash .tb-excel-btn {
  height: 2.15rem;
  min-height: 2.15rem;
  padding: 0 0.95rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid #86efac;
  background: #ecfdf5;
  color: #166534;
  white-space: nowrap;
}

.btn-ghost.finance-excel-btn:hover,
.finance-excel-btn:hover {
  background: #d1fae5;
  border-color: #4ade80;
  color: #14532d;
}

.income-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.55rem 0 0.65rem;
}

.income-kpi-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .income-kpi-grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .income-kpi-grid-5 {
    grid-template-columns: 1fr;
  }
}

.income-accounts-head {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.income-scope-filter {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  margin-inline-start: auto;
  min-width: 0;
}

.income-scope-field {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  flex: 0 1 auto;
}

.income-scope-field > span {
  font-size: 0.66rem;
  font-weight: 800;
  color: #6a829e;
  white-space: nowrap;
  flex: 0 0 auto;
}

.income-scope-filter select {
  width: 8.2rem;
  min-width: 0;
  max-width: 9.5rem;
  height: 1.85rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid #c5d5e8;
  border-radius: 8px;
  background: #fff;
  color: #12345f;
  font-size: 0.72rem;
  font-weight: 700;
}

.income-scope-submit {
  height: 1.85rem;
  padding: 0 0.85rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* ?? ????? ???????: ?????? ?? ???? ???? ??? ??????? ??? ?? ?????? */
.income-analyst-duo .income-accounts-head .income-scope-filter {
  flex: 1 1 100%;
  order: 3;
  margin-inline-start: 0;
  justify-content: flex-start;
}

.income-analyst-duo .income-accounts-head .result-pill {
  margin-inline-start: auto;
}

/* خلفية قائمة الدخل — تجربة ثيم داكن */
.page.sales-dash.income-dash {
  background: transparent;
  color: #e8ecf8;
}

body.sales-dash-body:has(.page.income-dash) {
  background:
    radial-gradient(ellipse 55% 42% at 100% 0%, rgba(59, 130, 246, 0.35), transparent 55%),
    radial-gradient(ellipse 45% 38% at 85% 8%, rgba(139, 92, 246, 0.32), transparent 52%),
    #0d1123;
  color: #e8ecf8;
}

.income-dash .income-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.75rem 0.85rem 0.8rem;
  min-height: 0;
  border-radius: 18px;
  background: rgba(22, 27, 46, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.income-dash .income-kpi .dash-kpi-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  margin: 0;
  color: #94a3b8;
}

.income-dash .income-kpi .dash-kpi-value {
  font-size: 1.05rem;
  line-height: 1.2;
  margin: 0;
  font-weight: 900;
}

.income-dash .income-kpi .dash-kpi-hint {
  font-size: 0.64rem;
  opacity: 1;
  margin: 0;
}

.income-kpi-rev,
.income-kpi-cogs,
.income-kpi-exp,
.income-kpi-margin,
.income-kpi-net,
.income-kpi-margin.is-up,
.income-kpi-margin.is-down,
.income-dash .income-kpi-net.is-up,
.income-dash .income-kpi-net.is-down {
  background: rgba(22, 27, 46, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.income-kpi-ico-margin {
  background: #0891b2;
  box-shadow: 0 6px 14px rgba(8, 145, 178, 0.3);
}

.income-kpi-ico-rev {
  background: #874bee;
  box-shadow: 0 6px 14px rgba(135, 75, 238, 0.35);
}

.income-kpi-ico-cogs {
  background: #d97706;
  box-shadow: 0 6px 14px rgba(217, 119, 6, 0.3);
}

.income-kpi-ico-exp {
  background: #e11d48;
  box-shadow: 0 6px 14px rgba(225, 29, 72, 0.3);
}

.income-kpi-ico-net {
  background: #874bee;
  box-shadow: 0 6px 14px rgba(135, 75, 238, 0.35);
}

.income-dash .income-kpi-net.is-up .income-kpi-ico-net {
  background: #059669;
  box-shadow: 0 6px 14px rgba(5, 150, 105, 0.3);
}

.income-dash .income-kpi-net.is-down .income-kpi-ico-net {
  background: #e11d48;
  box-shadow: 0 6px 14px rgba(225, 29, 72, 0.3);
}

.income-dash .income-kpi-net.is-up .dash-kpi-value {
  color: #059669;
}

.income-dash .income-kpi-net.is-down .dash-kpi-value {
  color: #e11d48;
}

.income-kpi-net-meta {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.income-kpi-pct {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.income-kpi-pct.is-up {
  color: #0b7a45;
}

.income-kpi-pct.is-down {
  color: #b34040;
}

.income-kpi-formula {
  opacity: 0.8;
}

.income-accounts-panel {
  margin-bottom: 0;
  min-width: 0;
}

.income-duo {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  gap: 0.75rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
  min-width: 0;
}

.income-charts-duo {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .income-charts-duo {
    grid-template-columns: 1fr;
  }
}

/* اتجاه شهري بعرض كامل */
.income-trend-panel.income-trend-full {
  margin: 0.35rem 0 1rem;
}

.income-trend-hchart {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.25rem 0.85rem 1rem;
  max-height: min(58vh, 28rem);
  overflow-y: auto;
}

.income-trend-row {
  --i: 0;
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 0.55rem 0.7rem;
  align-items: start;
  animation: income-rank-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 30ms);
}

.income-trend-month {
  font-size: 0.78rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.35;
  padding-top: 0.15rem;
}

.income-trend-body {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
}

.income-trend-netline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
}

.income-trend-track {
  height: 0.85rem;
  border-radius: 999px;
  background: #e8eef3;
  overflow: hidden;
}

.income-trend-fill {
  display: block;
  height: 100%;
  min-width: 0.35rem;
  border-radius: inherit;
  background: #94a3b8;
}

.income-trend-fill.is-profit { background: #16a34a; }
.income-trend-fill.is-loss { background: #dc2626; }
.income-trend-fill.is-zero { background: #94a3b8; }

.income-trend-net {
  font-size: 0.8rem;
  font-weight: 900;
  color: #b45309;
  white-space: nowrap;
  min-width: 4.2rem;
  text-align: start;
}

.income-trend-row.is-profit .income-trend-net { color: #b45309; }
.income-trend-row.is-loss .income-trend-net { color: #be123c; }

.income-trend-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
}

.income-trend-metrics li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
}

.income-trend-metrics li span {
  font-weight: 600;
  opacity: 0.9;
}

.income-trend-metrics li strong {
  font-weight: 800;
  color: #1e293b;
}

.income-trend-metrics .is-rev strong { color: #0e7490; }
.income-trend-metrics .is-cogs strong { color: #b45309; }
.income-trend-metrics .is-exp strong { color: #be123c; }

/* لوحة انتباه تنفيذية */
.income-exec-board {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.25rem 0.85rem 1rem;
}

.income-exec-card {
  --i: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  border-inline-start: 3px solid #94a3b8;
  background: #f8fafc;
  animation: income-rank-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 40ms);
}

.income-exec-card.is-high {
  border-inline-start-color: #e11d48;
  background: #fff1f2;
  border-color: #fecdd3;
}

.income-exec-card.is-medium {
  border-inline-start-color: #d97706;
  background: #fffbeb;
  border-color: #fde68a;
}

.income-exec-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.55rem;
}

.income-exec-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #0f172a;
}

.income-exec-metric {
  font-size: 0.9rem;
  font-weight: 900;
  color: #334155;
  white-space: nowrap;
}

.income-exec-card.is-high .income-exec-metric { color: #be123c; }
.income-exec-card.is-medium .income-exec-metric { color: #b45309; }

.income-exec-detail {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  line-height: 1.45;
}

.income-exec-hint {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
}

.income-exec-ok {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.35rem 0.85rem 1rem;
  padding: 1rem 0.95rem;
  border-radius: 10px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
}

.income-exec-ok strong {
  font-size: 0.9rem;
  font-weight: 800;
  color: #166534;
}

.income-exec-ok span {
  font-size: 0.78rem;
  font-weight: 600;
  color: #3f6212;
  line-height: 1.45;
}

.income-compare-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.35rem 0.85rem 1rem;
}

.income-compare-row {
  --i: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  animation: income-rank-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 40ms);
}

.income-compare-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.income-compare-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: #1e293b;
}

.income-compare-delta {
  font-size: 0.78rem;
  font-weight: 900;
  color: #64748b;
}

.income-compare-delta.is-up { color: #15803d; }
.income-compare-delta.is-down { color: #b91c1c; }
.income-compare-delta.is-flat { color: #64748b; }

.income-compare-tracks {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.income-compare-track {
  height: 0.55rem;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.income-compare-fill {
  display: block;
  height: 100%;
  min-width: 0.2rem;
  border-radius: inherit;
  background: #94a3b8;
}

.income-compare-track.is-prior .income-compare-fill {
  background: #94a3b8;
  opacity: 0.85;
}

.income-compare-row.is-revenue .income-compare-track.is-current .income-compare-fill { background: #06b6d4; }
.income-compare-row.is-cogs .income-compare-track.is-current .income-compare-fill { background: #f59e0b; }
.income-compare-row.is-expense .income-compare-track.is-current .income-compare-fill { background: #e11d48; }
.income-compare-row.is-net .income-compare-track.is-current .income-compare-fill { background: #22c55e; }

.income-compare-vals {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  font-size: 0.72rem;
}

.income-compare-val {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  color: #334155;
  font-weight: 700;
}

.income-compare-val em {
  font-style: normal;
  font-weight: 600;
  color: #64748b;
  font-size: 0.68rem;
}

.income-compare-val.is-current .mono {
  font-weight: 800;
}

.income-hbar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.45rem 0.85rem 1rem;
}

.income-hbar-row {
  --bar-pct: 0%;
  --i: 0;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  animation: income-rank-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 40ms);
}

.income-hbar-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
  min-width: 0;
}

.income-hbar-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #1a3358;
  min-width: 0;
  flex: 1 1 auto;
}

.income-hbar-pct {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 900;
  color: #0e7490;
}

.income-hbar-track {
  height: 1.35rem;
  border-radius: 6px;
  background: #e8eef3;
  overflow: hidden;
  width: 100%;
}

.income-hbar-fill {
  display: block;
  height: 100%;
  width: var(--bar-pct, 0%);
  min-width: 0;
  max-width: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #22d3ee, #0891b2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.income-hbar-row.is-rev .income-hbar-fill,
.income-hbar-row.is-profit .income-hbar-fill {
  background: linear-gradient(90deg, #34d399, #059669);
}

.income-hbar-row.is-cogs .income-hbar-fill {
  background: linear-gradient(90deg, #fbbf24, #d97706);
}

.income-hbar-row.is-exp .income-hbar-fill,
.income-hbar-row.is-loss .income-hbar-fill {
  background: linear-gradient(90deg, #f87171, #dc2626);
}

.income-hbar-row.is-zero .income-hbar-fill {
  background: linear-gradient(90deg, #94a3b8, #64748b);
}

.income-hbar-val {
  font-size: 0.74rem;
  font-weight: 800;
  color: #12345f;
  white-space: nowrap;
  flex-shrink: 0;
}

.income-hbar-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.08rem;
  min-width: 4.5rem;
}

.income-hbar-meta {
  font-size: 0.62rem;
  font-weight: 700;
  color: #5a7394;
}

.income-waterfall {
  display: none;
}

.income-vchart {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem 0.95rem;
  min-height: 17rem;
  overflow-x: auto;
}

.income-vcol {
  flex: 1 1 0;
  min-width: 4.2rem;
  max-width: 7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  animation: income-rank-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 40ms);
}

.income-vpct {
  font-size: 0.72rem;
  font-weight: 900;
  color: #0891b2;
  line-height: 1;
}

.income-vtrack {
  width: 1.55rem;
  height: 10.5rem;
  border-radius: 10px;
  background: #e8eef3;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

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

.income-vcol.is-rev .income-vfill,
.income-vcol.is-profit .income-vfill {
  background: linear-gradient(180deg, #6ee7b7 0%, #059669 100%);
}

.income-vcol.is-cogs .income-vfill {
  background: linear-gradient(180deg, #fcd34d 0%, #d97706 100%);
}

.income-vcol.is-exp .income-vfill,
.income-vcol.is-loss .income-vfill {
  background: linear-gradient(180deg, #fca5a5 0%, #dc2626 100%);
}

.income-vcol.is-zero .income-vfill {
  background: linear-gradient(180deg, #cbd5e1 0%, #64748b 100%);
}

.income-vsign {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
  color: #0e7490;
  background: #ecfeff;
  line-height: 1;
}

.income-vcol.is-rev .income-vsign,
.income-vcol.is-profit .income-vsign {
  color: #047857;
  background: #ecfdf5;
}

.income-vcol.is-cogs .income-vsign {
  color: #b45309;
  background: #fffbeb;
}

.income-vcol.is-exp .income-vsign,
.income-vcol.is-loss .income-vsign {
  color: #b91c1c;
  background: #fef2f2;
}

.income-vname {
  font-size: 0.68rem;
  font-weight: 800;
  color: #1a3358;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
}

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

.income-branch-vchart {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.32rem;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0.35rem 0.55rem 0.75rem;
  overflow-x: hidden;
  overflow-y: visible;
  background-image: none;
  border-radius: 10px;
}

.income-branch-vchart .income-vcol {
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  width: 100%;
  display: grid;
  grid-template-columns: 1.45rem minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  overflow: visible;
}

.income-branch-vchart .income-vbody {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.income-branch-vchart .income-vhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.55rem;
}

.income-branch-vchart .income-vpct {
  min-width: 1.35rem;
  width: 1.35rem;
  height: 1.35rem;
  min-height: 1.35rem;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 900;
  color: #0e7490;
  background: #ecfeff;
  max-width: none;
}

.income-branch-vchart .income-vcol:nth-child(1) .income-vpct {
  color: #b45309;
  background: #fffbeb;
}

.income-branch-vchart .income-vcol:nth-child(2) .income-vpct {
  color: #475569;
  background: #f1f5f9;
}

.income-branch-vchart .income-vcol:nth-child(3) .income-vpct {
  color: #9a3412;
  background: #fff7ed;
}

.income-branch-vchart .income-vcol.is-loss .income-vpct {
  color: #b91c1c;
  background: #fef2f2;
}

.income-branch-vchart .income-vtrack {
  width: 100%;
  height: 0.48rem;
  border: 1px solid #c9d7e4;
  background: rgba(232, 238, 243, 0.7);
  box-sizing: border-box;
  border-radius: 999px;
  direction: ltr;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: stretch;
  overflow: hidden;
}

.income-branch-vchart .income-vfill {
  width: 0;
  height: 100%;
  min-width: 0.25rem;
  min-height: 0;
  max-height: none;
  background-image: none;
  border-radius: inherit;
}

.income-branch-vchart .income-vcol.is-profit .income-vfill {
  background: #059669;
}

.income-branch-vchart .income-vcol.is-loss .income-vfill {
  background: #dc2626;
}

.income-branch-vchart .income-vcol.is-zero .income-vfill {
  background: #94a3b8;
}

.income-branch-vchart .income-vname {
  text-align: start;
  font-size: 0.78rem;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.income-branch-vchart .income-vmeta {
  text-align: end;
  font-size: 0.74rem;
  flex-shrink: 0;
  max-width: none;
  overflow: visible;
  text-overflow: unset;
}

.income-branch-vchart .income-vcol.is-loss .income-vmeta {
  color: #b34040;
}

.income-branch-vchart .income-vcol.is-profit .income-vmeta {
  color: #0b7a45;
}

/* مخطط أشرطة أفقية بمحور وخط مرجعي (مكوّنات + مصروفات) */
.income-axis-hbar {
  gap: 0.35rem;
  padding: 0.55rem 0.75rem 0.7rem;
  --axis-label-w: 5.6rem;
  --axis-val-w: 7.2rem;
  --bar-blue: #4f7fd8;
  --grid-line: rgba(148, 163, 184, 0.45);
  --ref-line: #e11d48;
  direction: ltr;
}

.income-expense-hbar.income-axis-hbar {
  --axis-label-w: 8.5rem;
  --axis-val-w: 6.8rem;
  --bar-blue: #e11d48;
  --ref-line: #fb7185;
  max-height: min(62vh, 34rem);
  overflow-y: auto;
  gap: 0.45rem;
  direction: rtl;
}

.income-expense-hbar.income-axis-hbar .income-hbar-track {
  direction: rtl;
  height: 0.85rem;
}

.income-expense-hbar.income-axis-hbar .income-axis-row .income-hbar-label {
  font-size: 0.72rem;
  text-align: start;
}

.income-expense-hbar.income-axis-hbar .income-axis-row .income-hbar-val {
  text-align: start;
  color: #b45309;
  font-weight: 800;
}

.income-expense-hbar.income-axis-hbar .income-axis-tick {
  transform: translateX(50%);
}

.income-expense-hbar.income-axis-hbar .income-axis-tick:first-child {
  transform: translateX(0);
}

.income-expense-hbar.income-axis-hbar .income-axis-tick:last-child {
  transform: translateX(100%);
}

.income-axis-plot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  padding-block: 0.15rem 0.35rem;
}

.income-expense-hbar.income-axis-hbar .income-axis-plot {
  gap: 0.42rem;
}

.income-axis-grid {
  position: absolute;
  inset-block: 0;
  inset-inline-start: var(--axis-label-w);
  inset-inline-end: var(--axis-val-w);
  pointer-events: none;
  z-index: 0;
}

.income-axis-grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-inline-start: 1px solid var(--grid-line);
  transform: translateX(0);
}

.income-axis-ref {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-inline-start: 2px dashed var(--ref-line);
  z-index: 2;
  pointer-events: none;
  opacity: 0.95;
}

.income-axis-rows {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
  min-width: 0;
}

.income-expense-hbar.income-axis-hbar .income-axis-rows {
  gap: 0.55rem;
}

.income-axis-hbar .income-axis-row,
.income-axis-hbar .income-hbar-row {
  display: grid;
  grid-template-columns: var(--axis-label-w) minmax(0, 1fr) var(--axis-val-w);
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
}

.income-axis-hbar .income-axis-row .income-hbar-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #334155;
  text-align: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;
  unicode-bidi: isolate;
}

.income-expense-hbar.income-axis-hbar .income-axis-row .income-hbar-label {
  font-size: 0.72rem;
}

.income-axis-hbar .income-hbar-track {
  direction: ltr;
  height: 1.05rem;
  border-radius: 2px;
  border: 0;
  background: transparent;
  overflow: visible;
  position: relative;
}

.income-axis-hbar .income-hbar-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  min-width: 0.2rem;
  background: var(--bar-blue) !important;
  background-image: none !important;
}

.income-axis-hbar .income-hbar-row.is-rev .income-hbar-fill,
.income-axis-hbar .income-hbar-row.is-profit .income-hbar-fill,
.income-axis-hbar .income-hbar-row.is-cogs .income-hbar-fill,
.income-axis-hbar .income-hbar-row.is-exp .income-hbar-fill,
.income-axis-hbar .income-hbar-row.is-loss .income-hbar-fill,
.income-axis-hbar .income-hbar-row.is-zero .income-hbar-fill {
  background: var(--bar-blue) !important;
}

.income-axis-hbar .income-axis-row .income-hbar-val {
  font-size: 0.72rem;
  font-weight: 800;
  color: #475569;
  text-align: end;
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.income-axis-scale {
  display: grid;
  grid-template-columns: var(--axis-label-w) minmax(0, 1fr) var(--axis-val-w);
  gap: 0.55rem;
  align-items: start;
  min-height: 1.35rem;
  border-top: 1px solid var(--grid-line);
  padding-top: 0.35rem;
  margin-top: 0.15rem;
}

.income-axis-scale-spacer {
  min-width: 0;
}

.income-axis-scale-track {
  position: relative;
  height: 1.15rem;
  min-width: 0;
}

.income-axis-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.58rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
}

.income-axis-tick:first-child {
  transform: translateX(0);
}

.income-axis-tick:last-child {
  transform: translateX(-100%);
}

.income-axis-hbar .income-hbar-sign,
.income-axis-hbar .income-hbar-pct,
.income-axis-hbar .income-hbar-top,
.income-axis-hbar .income-hbar-meta,
.income-axis-hbar .income-hbar-rank {
  display: none !important;
}

@media (max-width: 640px) {
  .income-axis-hbar {
    --axis-label-w: 4.4rem;
    --axis-val-w: 5.2rem;
  }
  .income-expense-hbar.income-axis-hbar {
    --axis-label-w: 6.2rem;
    --axis-val-w: 5rem;
  }
  .income-axis-hbar .income-hbar-track {
    height: 0.9rem;
  }
  .income-axis-tick {
    font-size: 0.5rem;
  }
}

.income-expense-hbar {
  gap: 0.7rem;
  max-height: 28rem;
  overflow-y: auto;
  padding-inline-end: 0.35rem;
}

.income-expense-hbar .income-hbar-top {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.4rem;
}

.income-expense-hbar .income-hbar-rank {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 900;
  color: #b91c1c;
  background: #fef2f2;
  line-height: 1;
}

.income-expense-hbar .income-hbar-row:nth-child(1) .income-hbar-rank {
  color: #991b1b;
  background: #fee2e2;
}

.income-expense-hbar .income-hbar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.income-expense-hbar .income-hbar-val {
  color: #b45309;
}

.income-expense-hbar .income-hbar-track {
  direction: ltr;
  height: 0.55rem;
  border: 1px solid #e8c4c4;
  background: #fef2f2;
  border-radius: 999px;
}

.income-expense-hbar .income-hbar-fill {
  background: #dc2626;
  background-image: none;
  border-radius: 999px;
  min-width: 0.25rem;
  margin-inline: 0;
  float: none;
}

.income-expense-hbar .income-hbar-meta {
  padding-inline-start: 1.75rem;
  color: #7a8fa8;
}

.income-branch-full {
  margin-bottom: 0.85rem;
}

.income-accounts-full {
  margin-bottom: 0.85rem;
  min-width: 0;
}

.income-branch-expense-duo {
  align-items: stretch;
}

.income-branch-expense-duo > .dash-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.income-branch-expense-duo .income-branch-vchart,
.income-branch-expense-duo .income-expense-hbar {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
  overflow-y: visible;
}

.income-branch-expense-duo .income-branch-panel {
  align-self: start;
}

/* مزيج المصروفات — توصية مراجع */
.income-exp-decision {
  margin: 0 0.85rem 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  border-inline-start: 3px solid #64748b;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.income-exp-decision strong {
  font-size: 0.72rem;
  font-weight: 800;
  color: #475569;
}

.income-exp-decision span {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.45;
}

.income-exp-decision.is-high {
  background: #fff1f2;
  border-color: #fecdd3;
  border-inline-start-color: #e11d48;
}

.income-exp-decision.is-high strong { color: #9f1239; }
.income-exp-decision.is-high span { color: #881337; }

.income-exp-decision.is-medium {
  background: #fffbeb;
  border-color: #fde68a;
  border-inline-start-color: #d97706;
}

.income-exp-decision.is-medium strong { color: #92400e; }
.income-exp-decision.is-medium span { color: #78350f; }

.income-exp-decision.is-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-inline-start-color: #16a34a;
}

.income-exp-decision.is-ok strong { color: #166534; }
.income-exp-decision.is-ok span { color: #14532d; }

.income-expense-mix-board {
  padding-bottom: 0.85rem;
}

.income-exp-callout .income-comp-callout-body {
  gap: 0.18rem;
}

.income-exp-callout-kicker {
  font-size: 0.62rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.02em;
}

.income-exp-callout-name {
  color: var(--c, #1e293b) !important;
  font-size: 0.86rem !important;
  font-weight: 900 !important;
  line-height: 1.3;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  display: block;
}

.income-expense-mix-board .income-comp-callout-meta .money,
.income-expense-mix-board .income-comp-center-val.money,
.income-expense-mix-board .income-comp-center-val .money {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-weight: 800;
}

.income-expense-mix-board .sar-symbol {
  width: 0.72em;
  height: 0.82em;
  flex-shrink: 0;
}

.income-exp-callout-code {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
}

.income-vcode {
  font-size: 0.52rem;
  font-weight: 700;
  color: #7a8fa8;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.income-margin-hbar .income-hbar-track {
  direction: rtl;
  height: 0.55rem;
  border-radius: 999px;
  border: 1px solid #c9d7e4;
  background: #eef3f7;
}

.income-margin-hbar .income-hbar-fill {
  border-radius: 999px;
  min-width: 0.25rem;
  background-image: none;
}

/* هيكل قائمة الدخل — حلقة + مفتاح callout مرن */
.income-comp-board {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  padding: 0.85rem 1rem 1.15rem;
  direction: ltr;
  min-width: 0;
}

.income-comp-visual {
  position: relative;
  flex: 1 1 11rem;
  width: min(100%, 15rem);
  max-width: 15rem;
  margin-inline: auto;
  aspect-ratio: 1;
  min-width: 0;
}

.income-comp-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.income-comp-ring {
  pointer-events: none;
}

.income-comp-anchor {
  pointer-events: none;
}

.income-comp-wedge {
  stroke: #ffffff;
  stroke-width: 1.5;
  paint-order: stroke fill;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.income-comp-visual:hover .income-comp-wedge {
  opacity: 0.88;
}

.income-comp-visual:hover .income-comp-wedge:hover {
  opacity: 1;
  filter: brightness(1.05);
}

.income-comp-wedge-pct {
  font-size: 4px;
  font-weight: 900;
  fill: #ffffff;
  stroke: none;
  letter-spacing: -0.02em;
  pointer-events: none;
  direction: ltr;
}

.income-comp-center {
  position: absolute;
  inset: 28.5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.18rem;
  background: #f3f4f6;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #e5e7eb;
  padding: 0.35rem;
  direction: rtl;
}

.income-comp-center-ico {
  width: 1.65rem;
  height: 1.65rem;
  color: #4b5563;
  flex-shrink: 0;
}

.income-comp-center-lbl {
  font-size: 0.62rem;
  font-weight: 800;
  color: #4b5563;
  line-height: 1;
}

.income-comp-center-val {
  font-size: 0.5rem;
  font-weight: 800;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  direction: ltr;
  unicode-bidi: isolate;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.income-comp-callouts {
  list-style: none;
  margin: 0;
  padding: 0.2rem 0.35rem 0.2rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.75rem, 2.2vw, 1.15rem);
  flex: 1 1 13rem;
  min-width: min(100%, 11.5rem);
  max-width: 100%;
  min-height: 0;
}

.income-comp-callout {
  --c: #94a3b8;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.65rem;
  position: relative;
  padding-right: 1.25rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  animation: income-rank-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 45ms);
}

.income-comp-callout::after {
  content: "";
  position: absolute;
  right: 0;
  top: 1rem;
  width: 1.1rem;
  height: 1px;
  background: #cbd5e1;
  pointer-events: none;
}

.income-comp-callout::before {
  content: "";
  position: absolute;
  right: -0.14rem;
  top: 0.82rem;
  width: 0.44rem;
  height: 0.44rem;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
  z-index: 1;
}

.income-comp-callout-bar {
  width: 0.34rem;
  flex: 0 0 0.34rem;
  border-radius: 999px;
  background: var(--c);
  align-self: stretch;
  min-height: 2.4rem;
}

.income-comp-callout-body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.12rem;
  direction: rtl;
  text-align: start;
}

.income-comp-callout-name {
  font-size: clamp(0.78rem, 0.7rem + 0.35vw, 0.92rem);
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
  width: 100%;
  text-align: start;
}

.income-comp-callout-meta {
  font-size: clamp(0.72rem, 0.62rem + 0.45vw, 0.95rem);
  font-weight: 800;
  color: #6b7280;
  width: 100%;
  line-height: 1.25;
  text-align: start;
}

.income-comp-callout-meta .mono,
.income-comp-callout-sub .mono {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
  max-width: 100%;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.income-comp-callout-sub {
  font-size: clamp(0.62rem, 0.55rem + 0.3vw, 0.72rem);
  font-weight: 700;
  color: #9ca3af;
  width: 100%;
  line-height: 1.25;
  text-align: start;
}

.income-comp-callout-pct {
  display: none;
}

@media (max-width: 820px) {
  .income-comp-board {
    flex-direction: column;
    align-items: stretch;
  }
  .income-comp-visual {
    order: -1;
    width: min(100%, 16rem);
    max-width: 16rem;
  }
  .income-comp-callouts {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    padding-inline-end: 0;
  }
  .income-comp-callout::before,
  .income-comp-callout::after {
    display: none;
  }
  .income-comp-callout {
    padding-inline-end: 0;
  }
}

@media (min-width: 821px) and (max-width: 1100px) {
  .income-charts-duo .income-comp-board {
    gap: 0.85rem 1rem;
  }
  .income-charts-duo .income-comp-visual {
    flex-basis: 10rem;
    width: min(100%, 12.5rem);
    max-width: 12.5rem;
  }
  .income-charts-duo .income-comp-callouts {
    flex-basis: 12rem;
    min-width: min(100%, 10.5rem);
  }
}

.income-donut-chips,
.income-donut-chip,
.income-donut-chip-txt,
.income-donut-callouts,
.income-donut-callout,
.income-comp-donut.branch-donut,
.income-comp-wedges {
  display: none !important;
}

.income-waterfall-step {
  --bar-pct: 0%;
  --i: 0;
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
  animation: income-rank-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 40ms);
}

.income-waterfall-sign {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 900;
  color: #0e7490;
  background: #ecfeff;
  margin-top: 0.15rem;
}

.income-waterfall-body {
  min-width: 0;
  display: grid;
  gap: 0.28rem;
}

.income-waterfall-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 800;
  color: #1a3358;
}

.income-waterfall-track {
  height: 1.35rem;
  border-radius: 6px;
  background: #e8eef3;
  overflow: hidden;
  width: 100%;
}

.income-waterfall-fill {
  display: block;
  height: 100%;
  width: var(--bar-pct, 0%);
  min-width: 0;
  max-width: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #22d3ee, #0891b2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.income-waterfall-step.is-rev .income-waterfall-fill,
.income-waterfall-step.is-profit .income-waterfall-fill {
  background: linear-gradient(90deg, #34d399, #059669);
}

.income-waterfall-step.is-cogs .income-waterfall-fill {
  background: linear-gradient(90deg, #fbbf24, #d97706);
}

.income-waterfall-step.is-exp .income-waterfall-fill,
.income-waterfall-step.is-loss .income-waterfall-fill {
  background: linear-gradient(90deg, #f87171, #dc2626);
}

.income-rank-meta {
  font-size: 0.64rem;
  font-weight: 700;
  color: #5a7394;
}

.income-rank-fill-expense {
  background: linear-gradient(90deg, #f87171, #dc2626) !important;
}

.income-expense-rank {
  max-height: min(52vh, 520px);
}

.income-reconcile-full {
  margin-bottom: 1.25rem;
}

.income-cash-vchart {
  gap: 0.55rem;
  min-height: 17rem;
  margin-bottom: 0.55rem;
  padding-block: 0.55rem 0.75rem;
  overflow-x: auto;
  overflow-y: visible;
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(20% - 1px),
      #d7e3ec 0,
      #d7e3ec 20%
    );
  background-size: 100% 10.5rem;
  background-position: center 2.05rem;
  background-repeat: no-repeat;
  border-radius: 12px;
}

.income-cash-vchart .income-vcol {
  min-width: 5.4rem;
  max-width: 7rem;
  overflow: visible;
}

.income-cash-vchart .income-vpct {
  min-width: 1.1rem;
  height: auto;
  min-height: 1.1rem;
  padding: 0.12rem 0.28rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 900;
  color: #0e7490;
  background: #ecfeff;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.income-cash-vchart .income-vcol.is-loss .income-vpct {
  color: #b91c1c;
  background: #fef2f2;
}

.income-cash-vchart .income-vtrack {
  width: 0.7rem;
  height: 10.5rem;
  border: 1px solid #c9d7e4;
  background: rgba(232, 238, 243, 0.7);
  box-sizing: border-box;
  border-radius: 999px;
}

.income-cash-vchart .income-vfill {
  min-height: 0.35rem;
  background-image: none;
  border-radius: inherit;
}

.income-cash-vchart .income-vcol.is-profit .income-vfill {
  background: #059669;
}

.income-cash-vchart .income-vcol.is-loss .income-vfill,
.income-cash-vchart .income-vcol.is-exp .income-vfill {
  background: #dc2626;
}

.income-cash-vchart .income-vcol.is-zero .income-vfill {
  background: #94a3b8;
  min-height: 0;
}

.income-cash-vchart .income-vname {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
}

.income-cash-vchart .income-vmeta {
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  max-width: none;
  width: 100%;
  font-size: 0.6rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.income-cash-vchart .income-vcol.is-loss .income-vmeta,
.income-cash-vchart .income-vcol.is-exp .income-vmeta {
  color: #b91c1c;
  font-weight: 800;
}

.income-cash-vchart .income-vcol.is-profit .income-vmeta {
  color: #047857;
  font-weight: 800;
}

.income-branch-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.income-branch-panel > .dash-panel-head {
  padding-block: 0.45rem;
}

.income-branch-panel .income-rank-period {
  padding: 0 0.45rem 0.2rem;
  margin: 0;
}

.income-rank-period {
  margin: 0;
  padding: 0 0.7rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #5a7394;
}

.income-rank-chart {
  padding: 0.35rem 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  max-height: min(58vh, 600px);
  flex: 1;
}

.income-rank-row {
  --bar-pct: 0%;
  --i: 0;
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  gap: 0.4rem;
  align-items: start;
  animation: income-rank-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 40ms);
}

@keyframes income-rank-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.income-rank-num {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: #0891b2;
  background: #e4eefb;
}

.income-rank-row:nth-child(1) .income-rank-num {
  background: #1fa85c;
  color: #fff;
}

.income-rank-row:nth-child(2) .income-rank-num {
  background: #06b6d4;
  color: #fff;
}

.income-rank-row:nth-child(3) .income-rank-num {
  background: #d08920;
  color: #fff;
}

.income-rank-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.income-rank-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.45rem;
}

.income-rank-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  color: #12345f;
}

.income-rank-amt {
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 800;
  color: #0b7a45;
}

.income-rank-row.is-loss .income-rank-amt {
  color: #b34040;
}

.income-rank-track {
  height: 0.42rem;
  border-radius: 999px;
  background: #e8eef6;
  overflow: hidden;
}

.income-rank-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2bc978, #1a9a55);
  animation: income-rank-bar 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--i) * 40ms + 80ms);
}

.income-rank-row.is-loss .income-rank-fill {
  background: linear-gradient(90deg, #e07474, #c04545);
}

@keyframes income-rank-bar {
  to {
    width: var(--bar-pct);
  }
}

@media (max-width: 1100px) {
  .income-duo {
    grid-template-columns: 1fr;
  }

  .income-rank-chart {
    max-height: min(42vh, 420px);
  }
}

.income-account-shell {
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #c5d5e8;
  border-radius: 10px;
  background: #fff;
}

.income-account-scroll {
  max-height: min(58vh, 600px);
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

.income-account-scroll .income-account-table tbody tr:last-child td {
  border-bottom: none;
}

.income-account-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  margin: 0;
}

.income-account-table .income-col-code { width: 5.6rem; }
.income-account-table .income-col-name { width: 9.5rem; }
.income-account-table .income-col-num { width: 7.4rem; }

.income-account-table .income-name-cell {
  max-width: 9.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.income-account-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #ecfeff !important;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 #c5d5e8;
  font-size: 0.78rem;
  white-space: nowrap;
  color: #12345f;
}

.income-account-table thead th + th {
  border-inline-start: 1px solid #d5e2f0;
}

.income-account-table tbody td + td {
  border-inline-start: 1px solid #d5e2f0;
}

.income-account-foot-table td + td {
  border-inline-start: 1px solid #9eb6d4 !important;
}

.income-account-foot {
  border-top: 2px solid #9eb6d4;
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.income-account-foot-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

.income-account-foot-table td {
  font-weight: 800;
  font-size: 0.78rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border: none !important;
  box-shadow: none !important;
}

.income-account-foot-table tr.income-tfoot-total td {
  background: #d5e4f5 !important;
}

.income-account-foot-table .income-foot-num {
  text-align: center;
  white-space: nowrap;
  padding-inline: 0.55rem !important;
  border-inline-start: 1px solid #9eb6d4 !important;
  letter-spacing: 0.01em;
}

.income-account-foot-table tr.income-tfoot-net td {
  background: #e8eef8 !important;
}

.income-account-foot-table tr.income-tfoot-net.is-up td {
  background: #dff3e8 !important;
  color: #0b7a45;
}

.income-account-foot-table tr.income-tfoot-net.is-down td {
  background: #f8e0e0 !important;
  color: #b34040;
}

.income-account-foot-table tr.income-tfoot-net.is-down td.income-foot-num,
.trial-balance-dash .income-account-foot-table tr.income-tfoot-net.is-down td.mono {
  color: #c62828 !important;
  font-weight: 800;
}

.income-tfoot-net-amt {
  text-align: center;
  white-space: nowrap;
  border-inline-start: 1px solid #9eb6d4 !important;
  padding-inline: 0.55rem !important;
}

.income-tfoot-net-label {
  display: block;
  font-size: 0.72rem;
  line-height: 1.25;
  font-weight: 800;
}

.income-tfoot-net-label + .income-tfoot-net-label {
  margin-top: 0.15rem;
  opacity: 0.9;
}

.income-tfoot-net-value {
  display: inline-block;
  margin-inline-end: 0.55rem;
}

.income-tfoot-net-pct {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.92;
}

.income-account-table tbody td {
  font-size: 0.82rem;
}

.income-kind-revenue td:nth-child(2) {
  color: #0b6b3c;
}

.income-kind-cogs td:nth-child(2) {
  color: #8a4f0c;
}

.income-kind-expense td:nth-child(2) {
  color: #8a3030;
}

.income-analyst-duo {
  margin-top: 0.15rem;
}

.income-analyst-scroll {
  max-height: min(48vh, 460px);
  overflow: auto;
  padding: 0;
  margin: 0;
}

.income-analyst-scroll::after {
  display: none !important;
  content: none !important;
}

.income-analyst-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

.income-analyst-table th,
.income-analyst-table td {
  font-size: 0.76rem;
  padding: 0.4rem 0.5rem;
}

.income-box-val {
  font-weight: 800;
  color: #12345f;
}

.income-cash-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.income-cash-link:hover strong {
  color: #0b5cab;
  text-decoration: underline;
}

.income-cash-stmt-table tr.is-selected td {
  background: rgba(18, 92, 170, 0.08);
}

.income-cash-shell {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #c5d5e8;
  border-radius: 10px;
  background: #fff;
}

.income-cash-scroll {
  max-height: min(42vh, 380px);
  margin: 0;
  padding: 0;
}

.income-cash-scroll .income-cash-stmt-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #ecfeff !important;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 #c5d5e8;
}

.income-cash-stmt-table .income-cash-col-name { width: 28%; }
.income-cash-stmt-table .income-cash-col-num { width: 14.5%; }
.income-cash-stmt-table .income-cash-col-status { width: 14%; }

.income-cash-foot {
  border-top: 2px solid #9eb6d4;
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0;
  padding: 0;
  line-height: 1;
}

.income-cash-foot-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
  table-layout: fixed;
}

.income-cash-foot-table td {
  font-weight: 800;
  font-size: 0.76rem;
  padding-top: 0.48rem;
  padding-bottom: 0.48rem;
  border: none !important;
  box-shadow: none !important;
  background: #d5e4f5 !important;
  white-space: nowrap;
}

.income-cash-foot-table td + td {
  border-inline-start: 1px solid #9eb6d4 !important;
  text-align: center;
}

.income-cash-foot-table tr.is-mismatch .income-cash-foot-diff {
  color: #b42318 !important;
  background: #fde8e6 !important;
}

.income-cash-foot-table tr.is-match .income-cash-foot-diff {
  color: #067647 !important;
}

.income-cash-detail {
  margin-top: 0.55rem;
  border-top: 1px solid rgba(30, 64, 110, 0.12);
  padding-top: 0.4rem;
}

.income-cash-detail-head {
  margin-bottom: 0.2rem;
}

.income-cash-detail-head h4 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #12345f;
}

.income-cash-detail-scroll {
  max-height: min(36vh, 320px);
}

.income-cash-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.income-cash-open-row td {
  font-weight: 700;
  background: rgba(18, 52, 95, 0.04);
}

.income-analyst-table .income-check-note {
  display: block;
  font-size: 0.64rem;
  font-weight: 600;
  color: #6a829e;
  margin-top: 0.1rem;
}

.income-check-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
}

.income-check-badge.is-ok,
.result-pill.is-ok {
  background: #dff3e8;
  color: #0b7a45;
}

.income-check-badge.is-bad,
.result-pill.is-bad {
  background: #f8e0e0;
  color: #b34040;
}

.income-top-table {
  table-layout: auto;
}

.income-top-table .income-top-col-name { width: 42%; }
.income-top-table .income-top-col-kind { width: 3.4rem; }
.income-top-table .income-top-col-num { width: 6.2rem; }

.income-top-name {
  max-width: 14rem;
  width: 1%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  font-weight: 700;
  color: #0a0a0a;
  vertical-align: middle;
}

.income-top-kind {
  width: 1%;
  padding-inline: 0.2rem !important;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.income-top-net,
.income-top-impact-cell {
  width: 1%;
  padding-inline: 0.28rem !important;
  font-size: 0.7rem !important;
  white-space: nowrap;
  vertical-align: middle;
}

.income-kind-tag {
  display: inline-flex;
  padding: 0.08rem 0.28rem;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  background: #e8eef8;
  color: #0891b2;
}

.income-kind-tag.kind-revenue {
  background: #dff3e8;
  color: #0b7a45;
}

.income-kind-tag.kind-cogs {
  background: #fff0db;
  color: #8a4f0c;
}

.income-kind-tag.kind-expense {
  background: #f8e0e0;
  color: #8a3030;
}

.income-top-net {
  font-weight: 800;
}

.income-top-table tr.is-profit .income-top-net {
  color: #0b7a45;
}

.income-top-table tr.is-loss .income-top-net {
  color: #b34040;
}

.income-top-impact {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.income-top-bar {
  display: block;
  height: 0.28rem;
  border-radius: 999px;
  background: #e8eef6;
  position: relative;
  overflow: hidden;
}

.income-top-bar::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--bar-pct);
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #1d6bb8);
}

.income-top-table tr.is-loss .income-top-bar::after {
  background: linear-gradient(90deg, #e07474, #c04545);
}

.income-top-table tr.is-profit .income-top-bar::after {
  background: linear-gradient(90deg, #2bc978, #1a9a55);
}

.income-top-shell {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #c5d5e8;
  border-radius: 10px;
  background: #fff;
  margin: 0;
  padding: 0;
}

.income-top-scroll {
  max-height: min(48vh, 460px);
  margin: 0;
  padding: 0;
}

.income-top-scroll.table-wrap::after,
.income-top-shell .table-wrap::after {
  display: none !important;
  content: none !important;
}

.income-top-scroll .income-top-table tbody tr:last-child td {
  border-bottom: none;
}

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

.income-top-foot-table {
  width: 100%;
  min-width: 0;
  margin: 0;
  border-spacing: 0;
  table-layout: fixed;
}

.income-top-foot-table tr.income-top-total td,
.income-top-table tr.income-top-total td {
  background: #d5e4f5 !important;
  color: #0e7490 !important;
  font-weight: 800;
  border: 0 !important;
  margin: 0 !important;
  padding: 0.48rem 0.5rem !important;
  font-size: 0.78rem;
}

.income-top-foot-table tr.income-top-total td + td {
  border-inline-start: 1px solid #9eb6d4 !important;
  text-align: center;
}

.income-top-table tr.income-top-total .income-top-net,
.income-top-table tr.income-top-total .mono {
  color: #991b1b !important;
  font-weight: 800 !important;
  white-space: nowrap;
}

.income-top-panel .income-analyst-scroll {
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0;
}

@media (max-width: 1100px) {
  .income-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .income-filter-bar {
    align-items: stretch;
  }

  .income-filter-bar-main,
  .income-filter-period-fields {
    width: 100%;
  }

  .income-filter-field input[type="date"],
  .income-filter-posted {
    flex: 1 1 auto;
    min-width: 0;
  }

  .income-filter-field input[type="date"],
  .income-filter-posted select {
    width: 100%;
    min-width: 0;
  }

  .income-filter-submit {
    width: 100%;
  }

  .income-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ?? Site-wide: bold text/numbers (size from html rem base) ?? */
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
) {
  font-weight: 700 !important;
}

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

body :where(input, select, textarea, button) {
  font-family: inherit;
}

body :where(.mono, td.mono, th.mono, .purchase-amount, .purchase-qty, .purchase-share) {
  font-variant-numeric: tabular-nums;
}

/* ??? ????? ?? ????????: ???? ????? + ???? ???? ??? */
.ss-page .ss-shell {
  margin: 0 0 0.85rem;
}

.ss-page .ss-head {
  margin: 0 0 0.65rem;
}

.ss-page .ss-head h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #12345f;
}

.ss-page .ss-head p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: #6b858f;
}

.ss-page .ss-toolbar {
  background: linear-gradient(180deg, #fff, #f5f8fc);
  border: 1px solid #c5d5e8;
  border-radius: 12px;
  padding: 0.75rem 0.85rem 0.7rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.ss-page .ss-toolbar-grid {
  display: grid;
  grid-template-columns: auto auto minmax(12rem, 1.2fr) 8.5rem 8.5rem minmax(14rem, 1.6fr) auto;
  gap: 0.55rem 0.65rem;
  align-items: end;
}

/* ???? ??? ?????? ????? ? ?? ????? ??? ????? */
.sales-search-page .ss-toolbar-sales {
  padding: 0.55rem 0.7rem 0.5rem;
}

.sales-search-page .ss-sales-grid {
  grid-template-columns:
    minmax(11rem, 1.8fr)
    7.6rem
    7.6rem
    minmax(9rem, 1.1fr)
    auto
    auto
    auto;
  gap: 0.4rem 0.45rem;
  align-items: end;
}

.sales-search-page .ss-sales-grid.is-compare {
  grid-template-columns:
    minmax(11rem, 1.8fr)
    7.6rem
    7.6rem
    auto
    auto
    auto;
}

.sales-search-page .ss-sales-grid > .field[hidden],
.sales-search-page .ss-sales-grid > [hidden] {
  display: none !important;
}

.sales-search-page .ss-toolbar .field label,
.sales-search-page .ss-toolbar .scope-field-label {
  margin-bottom: 0.18rem;
  font-size: 0.68rem;
}

.sales-search-page .ss-toolbar .scope-toggle {
  gap: 0.18rem;
  padding: 0.12rem;
  border-radius: 9px;
}

.sales-search-page .ss-toolbar .scope-option {
  gap: 0.22rem;
  padding: 0.28rem 0.45rem;
  border-radius: 7px;
  font-size: 0.72rem;
}

.sales-search-page .ss-toolbar .scope-option input[type="radio"] {
  width: 0.78rem !important;
  height: 0.78rem !important;
}

.sales-search-page .ss-toolbar input[type="date"],
.sales-search-page .ss-toolbar input[type="search"],
.sales-search-page .ss-toolbar .warehouse-select,
.sales-search-page .ss-wh .inv-select-trigger,
.sales-search-page .ss-actions .btn-primary {
  min-height: 2.05rem;
  font-size: 0.82rem;
}

.sales-search-page .ss-actions .btn-primary {
  padding-inline: 0.85rem;
  white-space: nowrap;
}

.sales-search-page .ss-query .query-row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  min-width: 0;
}

.sales-search-page .ss-query .btn-scan {
  width: 2.05rem;
  min-width: 2.05rem;
  min-height: 2.05rem;
  padding: 0;
  flex: 0 0 auto;
}

.sales-search-page .ss-wh .inv-select-menu[hidden] {
  display: none !important;
}

.sales-search-page .ss-hint {
  margin-top: 0.4rem;
  line-height: 1.35;
}

.ss-page .ss-toolbar .field label,
.ss-page .ss-toolbar .scope-field-label {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #47617f;
}

.ss-page .ss-toolbar .scope-toggle {
  margin: 0;
  border-color: #b7d4c2;
  background: #eef6f1;
}

.ss-page .ss-toolbar .scope-option {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  background: transparent !important;
  color: #3d6b52 !important;
  box-shadow: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}

/* ????? ??????? ??????? ????? ?????? */
.ss-page .ss-toolbar .scope-option input[type="radio"] {
  position: static !important;
  opacity: 1 !important;
  width: 1rem !important;
  height: 1rem !important;
  margin: 0 !important;
  pointer-events: auto !important;
  flex: 0 0 auto;
  accent-color: #217346;
  cursor: pointer;
}

.ss-page .ss-toolbar .scope-option::before {
  content: none !important;
  display: none !important;
}

/* ????? ??? = ??????? ?????? */
.ss-page .ss-toolbar .scope-option:has(> input[type="radio"]:checked) {
  background: #217346 !important;
  color: #fff !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset !important;
}

.ss-page .ss-toolbar .scope-option:has(> input[type="radio"]:checked) input[type="radio"] {
  accent-color: #fff;
}

.ss-page .ss-toolbar .scope-option:hover:not(:has(> input[type="radio"]:checked)) {
  background: rgba(33, 115, 70, 0.12) !important;
  color: #1a5c38 !important;
}

.ss-page .ss-toolbar input[type="date"],
.ss-page .ss-toolbar input[type="search"],
.ss-page .ss-toolbar .warehouse-select {
  width: 100%;
  min-height: 2.35rem;
  border: 1px solid #c5d5e8;
  border-radius: 9px;
  padding: 0.35rem 0.55rem;
  background: #fff;
  box-sizing: border-box;
}

.ss-page .ss-actions {
  display: flex;
  align-items: end;
}

.ss-page .ss-actions .btn-primary {
  min-height: 2.35rem;
  padding-inline: 1.1rem;
}

.ss-page .ss-wh .inv-select {
  position: relative;
  width: 100%;
  z-index: 1;
}

.ss-page .ss-wh .inv-select.is-open {
  z-index: 80;
}

.ss-page .ss-wh .inv-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.ss-page .ss-wh .inv-select-trigger {
  width: 100%;
  min-height: 2.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #c5d5e8;
  border-radius: 9px;
  background: #fff;
  font: 700 0.85rem var(--font);
  color: #143a6b;
  cursor: pointer;
  text-align: start;
  box-sizing: border-box;
}

.ss-page .ss-wh .inv-select.is-open .inv-select-trigger {
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

.ss-page .ss-wh .inv-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-page .ss-wh .inv-select-caret {
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  color: #1f4f8a;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.ss-page .ss-wh .inv-select-caret svg {
  width: 0.85rem;
  height: 0.85rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ss-page .ss-wh .inv-select.is-open .inv-select-caret {
  transform: rotate(180deg);
}

.ss-page .ss-wh .inv-select-menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 0.28rem);
  max-height: 16rem;
  overflow: auto;
  border: 1px solid #c5d5e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(18, 52, 95, 0.14);
  z-index: 90;
  padding: 0.25rem;
}

.ss-page .ss-wh .inv-select-option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: start;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font: 700 0.82rem var(--font);
  color: #143a6b;
  cursor: pointer;
}

.ss-page .ss-wh .inv-select-option:hover,
.ss-page .ss-wh .inv-select-option.is-selected {
  background: #eef5fc;
}

.ss-page .ss-hint {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: #6b858f;
}

.ss-page .ss-sheet-panel {
  background: #fff;
  border: 1px solid #9eb4ce;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(18, 52, 95, 0.06);
}

.ss-page .ss-sheet-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 1rem;
  padding: 0.55rem 0.75rem;
  background: linear-gradient(180deg, #eef5ee, #e3efe4);
  border-bottom: 1px solid #9eb4ce;
}

.ss-page .ss-sheet-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  min-width: 0;
}

.ss-page .ss-sheet-meta.is-end {
  margin-inline-start: auto;
}

.ss-page .ss-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(15, 122, 69, 0.12);
  color: #0f7a45;
  font-size: 0.66rem;
  font-weight: 900;
}

.ss-page .ss-meta-name {
  color: #12345f;
  font-weight: 800;
  font-size: 0.9rem;
}

.ss-page .ss-sheet-sub {
  color: #6b858f;
  font-size: 0.78rem;
}

.ss-page .ss-sheet-wrap {
  overflow: auto;
  max-height: min(62vh, 36rem);
}

.ss-page .ss-sheet {
  width: 100%;
  min-width: 52rem;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
}

.ss-page .ss-sheet th,
.ss-page .ss-sheet td {
  border: 1px solid #b7c9de;
  padding: 0.32rem 0.45rem;
  font-size: 0.8rem;
  line-height: 1.25;
  background: #fff;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-page .ss-sheet thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #217346;
  color: #fff;
  border-color: #1a5c38;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.ss-page .ss-sheet tbody tr:nth-child(even) td {
  background: #f3faf5;
}

.ss-page .ss-sheet tbody tr:hover td {
  background: #e7f6ec;
}

.ss-page .ss-sheet tbody tr.is-empty td {
  color: #94a3b8;
  background: #fafbfc;
}

.ss-page .ss-sheet .sticky-col {
  position: sticky;
  inset-inline-start: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 #b7c9de;
}

.ss-page .ss-sheet thead .sticky-col {
  z-index: 4;
  background: #217346;
  box-shadow: 1px 0 0 #1a5c38;
}

.ss-page .ss-sheet tbody tr:nth-child(even) .sticky-col {
  background: #f3faf5;
}

.ss-page .ss-sheet tbody tr:hover .sticky-col {
  background: #e7f6ec;
}

.ss-page .ss-sheet tbody tr.is-empty .sticky-col {
  background: #fafbfc;
}

.ss-page .ss-col-num {
  width: 2.4rem;
  text-align: center;
  color: #6b858f;
}

.ss-page .ss-col-wh-code {
  width: 4.2rem;
  text-align: center;
}

.ss-page .ss-col-wh {
  width: 12rem;
  text-align: start;
  font-weight: 800;
  color: #12345f;
}

.ss-page .ss-col-code {
  width: 7rem;
}

.ss-page .ss-col-name {
  width: auto;
  text-align: start;
}

.ss-page .ss-col-unit {
  width: 5rem;
  text-align: center;
}

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

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

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

.ss-page .ss-col-numish,
.ss-page .ss-col-money {
  width: 6.2rem;
  text-align: end;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: plaintext;
}

.ss-page .ss-sheet .is-total {
  color: #0f7a45;
  font-weight: 900;
  background: #eaf7ef;
}

.ss-page .ss-sheet thead th.is-total {
  background: #1a5c38;
  color: #fff;
}

.ss-page .ss-sheet .is-ret {
  color: #9a3412;
}

.ss-page .ss-sheet thead th.is-ret {
  background: #9a3412;
  color: #fff;
}

.ss-page .ss-total-row td {
  background: #dcefe3 !important;
  border-top: 2px solid #217346;
  font-weight: 900;
  color: #12345f;
}

.ss-page .ss-total-row .is-total {
  background: #c8e6d2 !important;
}

.ss-page .ss-sheet a {
  color: #0891b2;
  text-decoration: none;
  font-weight: 800;
}

.ss-page .ss-sheet a:hover {
  text-decoration: underline;
}

.ss-page .ss-note {
  margin: 0;
  padding: 0.45rem 0.75rem 0.55rem;
  font-size: 0.72rem;
  color: #6b858f;
  border-top: 1px solid #d5e0ec;
  background: #f8fafc;
}

.ss-page .result-pill.is-ok {
  background: rgba(15, 122, 69, 0.14);
  color: #0f7a45;
}

@media (max-width: 1100px) {
  .ss-page .ss-toolbar-grid {
    grid-template-columns: 1fr 1fr;
  }
  .ss-page .ss-scope,
  .ss-page .ss-query,
  .ss-page .ss-actions {
    grid-column: 1 / -1;
  }

  .sales-search-page .ss-sales-grid,
  .sales-search-page .ss-sales-grid.is-compare {
    grid-template-columns: 1fr 1fr;
  }
  .sales-search-page .ss-sales-grid .ss-query {
    grid-column: 1 / -1;
  }
  .sales-search-page .ss-sales-grid .ss-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .sales-search-page .ss-sales-grid .ss-actions .btn-primary {
    width: 100%;
  }
}

.ss-page .ss-toolbar-grid.is-item {
  grid-template-columns: auto repeat(2, minmax(8.5rem, 10rem)) minmax(9rem, 12rem) minmax(12rem, 1.2fr) minmax(10rem, 1fr) minmax(14rem, 1.8fr) auto auto;
  align-items: end;
}

.ss-page .ss-toolbar-grid.is-item .ss-sync {
  display: flex;
  align-items: end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.ss-page .ss-toolbar-grid.is-item .ss-sync .btn-ghost {
  min-height: 2.35rem;
}

.ss-page .ss-toolbar-grid.is-item .sync-secret-input {
  min-height: 2.35rem;
  max-width: 8.5rem;
  border: 1px solid #c5d5e8;
  border-radius: 9px;
  padding: 0.35rem 0.55rem;
  box-sizing: border-box;
}

.ss-page .ss-toolbar-grid.is-item .cache-meta {
  margin: 0;
  font-size: 0.72rem;
  white-space: nowrap;
}

/* بحث الأصناف — صفوف واضحة بلا تداخل */
.item-search-page .ss-toolbar-item {
  padding: 0.75rem 0.85rem 0.8rem;
  overflow: visible;
}

.item-search-page .ss-shell,
.item-search-page .ss-item-layout,
.item-search-page .ss-item-row-search,
.item-search-page .ss-vendor {
  overflow: visible;
}

.item-search-page .ss-item-row-search {
  position: relative;
  z-index: 5;
}

.item-search-page .ss-item-layout {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.item-search-page .ss-item-row {
  display: grid;
  gap: 0.45rem 0.55rem;
  align-items: end;
}

.item-search-page .ss-item-row-scope {
  grid-template-columns: auto;
}

.item-search-page .ss-item-row-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.item-search-page .ss-item-row-search {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto auto;
}

.item-search-page .ss-item-row .field {
  min-width: 0;
  margin: 0;
}

.item-search-page .ss-item-row .field > label,
.item-search-page .ss-item-row .scope-field-label {
  display: block;
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #47617f;
}

.item-search-page .ss-toolbar-item .ss-date input,
.item-search-page .ss-toolbar-item .ss-branch select,
.item-search-page .ss-toolbar-item .ss-wh select {
  min-height: 2.35rem;
  width: 100%;
  border: 1px solid #c5d5e8;
  border-radius: 9px;
  padding: 0.3rem 0.5rem;
  background: #fff;
  box-sizing: border-box;
}

.item-search-page .ss-vendor {
  position: relative;
  margin: 0;
}

.item-search-page .ss-vendor > label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.item-search-page .vendor-item-count {
  display: inline-flex;
  align-items: center;
  min-height: 1.2rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: #e8f5ee;
  color: #1b6b45;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.item-search-page .vendor-item-count.is-empty {
  display: none;
}

.item-search-page .vendor-item-count.is-loading {
  background: #eef3f8;
  color: #5d738c;
}

.item-search-page .ss-vendor .vendor-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.item-search-page .ss-vendor .vendor-suggest {
  position: relative;
  min-width: 0;
  width: 100%;
}

.item-search-page .ss-vendor .vendor-suggest input[type="search"],
.item-search-page .ss-query > input[type="search"] {
  min-height: 2.35rem;
  width: 100%;
  margin: 0;
  border: 1px solid #c5d5e8;
  border-radius: 9px;
  padding: 0.3rem 0.55rem;
  background: #fff;
  box-sizing: border-box;
}

.item-search-page .ss-vendor .vendor-suggest-list {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  z-index: 40;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  max-height: 16rem;
  overflow: auto;
  background: #fff;
  border: 1px solid #c5d5e8;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 35, 65, 0.14);
}

.item-search-page .ss-vendor .vendor-suggest-list[hidden] {
  display: none !important;
}

.item-search-page .ss-vendor .vendor-suggest-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.45rem 0.7rem;
  border: 0;
  background: transparent;
  text-align: start;
  cursor: pointer;
  font: inherit;
  color: #1d334d;
}

.item-search-page .ss-vendor .vendor-suggest-option:hover,
.item-search-page .ss-vendor .vendor-suggest-option.is-active {
  background: #eef5ff;
}

.item-search-page .ss-vendor .vendor-suggest-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-search-page .ss-vendor .vendor-suggest-code {
  flex: 0 0 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: #5d738c;
}

.item-search-page .ss-vendor .vendor-suggest-empty {
  padding: 0.55rem 0.7rem;
  color: #6a7f96;
  font-size: 0.85rem;
}

.item-search-page .ss-actions,
.item-search-page .ss-sync {
  display: flex;
  align-items: end;
  gap: 0.35rem;
  margin: 0;
  min-width: 0;
}

.item-search-page .ss-actions .btn-scan {
  width: 2.35rem;
  min-height: 2.35rem;
  margin: 0;
  border-radius: 9px;
  flex-shrink: 0;
}

.item-search-page .ss-actions .btn-primary,
.item-search-page .ss-sync .btn-ghost {
  min-height: 2.35rem;
  margin: 0;
  white-space: nowrap;
  padding-inline: 0.85rem;
  border-radius: 9px;
  flex-shrink: 0;
}

.item-search-page .ss-sync .sync-secret-input {
  min-height: 2.35rem;
  width: 6.5rem;
  margin: 0;
  border: 1px solid #c5d5e8;
  border-radius: 9px;
  padding: 0.3rem 0.45rem;
  box-sizing: border-box;
  flex-shrink: 0;
}

.item-search-page .ss-sync .cache-meta {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
  white-space: nowrap;
  line-height: 1;
}

@media (max-width: 1100px) {
  .item-search-page .ss-item-row-filters,
  .item-search-page .ss-item-row-search {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .item-search-page .ss-item-row-filters,
  .item-search-page .ss-item-row-search {
    grid-template-columns: 1fr;
  }
}

.ss-page .ss-vendor .inv-select {
  position: relative;
  width: 100%;
  z-index: 1;
}

.ss-page .ss-vendor .inv-select.is-open {
  z-index: 120;
}

.ss-page .ss-vendor .inv-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.ss-page .ss-vendor .inv-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(11rem, 0.85fr);
  gap: 0.45rem;
  width: 100%;
  align-items: stretch;
}

.ss-page .ss-vendor .inv-select-trigger {
  flex: none;
  width: 100%;
  min-width: 0;
  min-height: 2.35rem;
  max-height: 2.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #c5d5e8;
  border-radius: 9px;
  background: #fff;
  font: 700 0.85rem var(--font);
  color: #143a6b;
  cursor: pointer;
  text-align: start;
  box-sizing: border-box;
}

.ss-page .ss-vendor .inv-select-search-input {
  flex: none;
  width: 100%;
  min-width: 0;
  min-height: 2.35rem;
  max-height: 2.35rem;
  border: 1px solid #9eb6d3;
  border-radius: 9px;
  padding: 0.35rem 0.65rem;
  font: 700 0.85rem var(--font);
  color: #12345f;
  background: #fff;
  box-sizing: border-box;
  outline: none;
}

.ss-page .ss-vendor .inv-select.is-open .inv-select-trigger,
.ss-page .ss-vendor .inv-select.is-open .inv-select-search-input {
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

.ss-page .ss-vendor .inv-select-search-input:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.14);
}

.ss-page .ss-vendor .inv-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-page .ss-vendor .inv-select-caret {
  display: grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  color: #1f4f8a;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.ss-page .ss-vendor .inv-select-caret svg {
  width: 0.85rem;
  height: 0.85rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ss-page .ss-vendor .inv-select.is-open .inv-select-caret {
  transform: rotate(180deg);
}

.ss-page .ss-vendor .inv-select-menu {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 0.28rem);
  width: 100%;
  max-height: 22rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #b7c9de;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 40, 75, 0.18);
  z-index: 130;
  padding: 0;
}

.ss-page .ss-vendor .inv-select-meta {
  padding: 0.4rem 0.7rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #5f738c;
  background: #f7fbff;
  border-bottom: 1px solid #e2eaf4;
}

.ss-page .ss-vendor .inv-select-list {
  overflow: auto;
  max-height: 16.5rem;
  padding: 0.3rem;
}

.ss-page .ss-vendor .inv-select-option {
  display: flex;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: start;
  padding: 0.5rem 0.6rem;
  border-radius: 9px;
  font: 700 0.84rem var(--font);
  color: #143a6b;
  cursor: pointer;
  box-sizing: border-box;
}

.ss-page .ss-vendor .inv-select-opt-main {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
  width: 100%;
}

.ss-page .ss-vendor .inv-select-opt-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ss-page .ss-vendor .inv-select-opt-code {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7c93;
}

.ss-page .ss-vendor .inv-select-option:hover,
.ss-page .ss-vendor .inv-select-option.is-active {
  background: #ecfeff;
}

.ss-page .ss-vendor .inv-select-option.is-selected {
  background: #dcecfc;
  box-shadow: inset 0 0 0 1px rgba(8, 145, 178, 0.25);
}

.ss-page .ss-vendor .inv-select-mark {
  background: #ffe08a;
  color: inherit;
  border-radius: 3px;
  padding: 0 0.1rem;
}

.ss-page .ss-vendor .inv-select-empty {
  padding: 0.85rem 0.7rem;
  text-align: center;
  color: #6b7c93;
  font-size: 0.82rem;
  font-weight: 700;
}

@media (max-width: 720px) {
  .ss-page .ss-vendor .inv-select-row {
    grid-template-columns: 1fr;
  }
}

.item-search-page .ss-sales-turn {
  margin-top: 0.85rem;
  padding-top: 0.55rem;
  border-top: 1px solid #d7e2ef;
}

.item-search-page .ss-turn-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.55rem 0 0.7rem;
}

.item-search-page .ss-turn-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #d7e2ef;
  border-radius: 10px;
  background: linear-gradient(145deg, #f8fbff, #edf4fc);
}

.item-search-page .ss-turn-card.is-turn {
  border-color: rgba(15, 107, 69, 0.35);
  background: linear-gradient(145deg, #f1faf5, #d9f0e4);
}

.item-search-page .ss-turn-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #47617f;
}

.item-search-page .ss-turn-card strong {
  font-size: 1.05rem;
  color: #1f2a37;
}

.item-search-page .ss-sheet tr.is-matched td {
  background: #fff6e8;
}

@media (max-width: 1280px) {
  .ss-page .ss-toolbar-grid.is-item {
    grid-template-columns: 1fr 1fr;
  }
  .ss-page .ss-toolbar-grid.is-item .ss-query,
  .ss-page .ss-toolbar-grid.is-item .ss-sync,
  .ss-page .ss-toolbar-grid.is-item .ss-actions {
    grid-column: 1 / -1;
  }
  .item-search-page .ss-turn-kpis {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1100px) {
  .ss-page .ss-toolbar-grid.is-item {
    grid-template-columns: 1fr 1fr;
  }
  .ss-page .ss-toolbar-grid.is-item .ss-sync {
    grid-column: 1 / -1;
  }
}


/* ?? ????? ???????? (???? ??????) ?? */
.sales-overview-dash .sales-ov-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.55rem 0.7rem;
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.85rem;
}

.sales-overview-dash .sales-ov-kpis + .sales-ov-filter {
  margin-top: 0.15rem;
}

.sales-overview-dash .sales-ov-filter .field {
  min-width: 8.5rem;
}

.sales-overview-dash .sales-ov-filter label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #47617f;
}

.sales-overview-dash .sales-ov-filter input[type="date"],
.sales-overview-dash .sales-ov-filter select {
  min-height: 2.15rem;
  border: 1px solid #c5d5e8;
  border-radius: 9px;
  padding: 0.3rem 0.5rem;
  background: #fff;
  min-width: 9.5rem;
  max-width: 14rem;
}

.sales-overview-dash .sales-ov-scope {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #47617f;
}

.sales-overview-dash .sales-ov-filter .btn-primary {
  min-height: 2.15rem;
  padding-inline: 1rem;
}

.sales-overview-dash .sales-ov-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0 0 0.9rem;
  align-items: stretch;
}

.sales-overview-dash .sales-ov-rank-kpis {
  margin-top: -0.35rem;
}

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

.sales-overview-dash .sales-ov-rank-kpis .dash-kpi-value {
  font-size: clamp(0.85rem, 4.2cqi, 1.15rem) !important;
  font-weight: 900 !important;
  white-space: normal !important;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  text-align: start;
  justify-content: flex-start;
  line-height: 1.25;
}

/* ?????? ?????? ???????? ? ???? ????? ????? ???? ??????? */
.sales-overview-dash .sales-ov-kpis > .dash-kpi-card {
  container-type: inline-size;
  container-name: sales-kpi;
  box-sizing: border-box;
  height: 100%;
  min-height: 6.2rem;
  max-height: 6.2rem;
  padding: 0.5rem 0.6rem !important;
  gap: 0.18rem !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
}

.sales-overview-dash .sales-ov-kpis .dash-kpi-label {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  width: 100%;
  font-size: clamp(0.78rem, 3.8cqi, 0.95rem) !important;
  font-weight: 800 !important;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
}

.sales-overview-dash .sales-ov-kpis .dash-kpi-ico {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 9px;
  color: #fff;
}

.sales-overview-dash .sales-ov-kpis .dash-kpi-ico svg {
  width: 0.88rem;
  height: 0.88rem;
}

.sales-overview-dash .sales-ov-kpis .dash-kpi-value {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  font-size: clamp(0.95rem, 7cqi, 1.45rem) !important;
  font-weight: 900 !important;
  line-height: 1.05;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  align-self: stretch;
}

.sales-overview-dash .sales-ov-kpis .dash-kpi-value .money {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
  width: 100%;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.15em;
  overflow: hidden;
}

.sales-overview-dash .sales-ov-kpis .dash-kpi-value .money-value {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: end;
}

.sales-overview-dash .sales-ov-kpis .dash-kpi-value .sar-symbol {
  flex: 0 0 auto;
  width: 0.62em;
  height: 0.7em;
}

.sales-overview-dash .sales-ov-kpis .dash-kpi-hint {
  display: block;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  font-size: clamp(0.72rem, 3.6cqi, 0.92rem) !important;
  font-weight: 700 !important;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@container sales-kpi (max-width: 12rem) {
  .sales-overview-dash .sales-ov-kpis .dash-kpi-value,
  .dash-kpi-value {
    font-size: clamp(0.8rem, 7.5cqi, 1.15rem) !important;
  }
}

@media (max-width: 1100px) {
  .sales-overview-dash .sales-ov-kpis > .dash-kpi-card {
    min-height: 5.9rem;
    max-height: 5.9rem;
  }
}

.sales-overview-dash .sales-ov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.sales-overview-dash .sales-ov-bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  align-items: stretch;
}

.sales-overview-dash .sales-ov-returns {
  min-width: 0;
  min-height: 28rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sales-overview-dash .sales-ov-returns .sales-returns-donut,
.sales-overview-dash .sales-ov-returns #sales-returns-empty {
  flex: 1 1 auto;
  min-height: 0;
}

/* ?? ????? ??????? + ???? ?????????? ? ??? ??????? ???????? */
.sales-overview-dash .sales-ov-items-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  align-items: stretch;
  margin-top: 0.15rem;
}

.sales-overview-dash .sales-ov-bottom > .sales-ov-panel,
.sales-overview-dash .sales-ov-items-row > .sales-ov-panel {
  margin-top: 0;
  min-width: 0;
  height: 100%;
  min-height: 28rem;
  display: flex;
  flex-direction: column;
}

.sales-overview-dash .sales-ov-bottom > .sales-ov-panel > .sales-ov-scroll,
.sales-overview-dash .sales-ov-items-row > .sales-ov-panel > .sales-ov-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: 22rem;
}

.sales-overview-dash .sales-ov-items,
.sales-overview-dash .sales-ov-users,
.sales-overview-dash .sales-ov-activity {
  margin-top: 0;
  min-width: 0;
}

/* ????? ???????: ?????? ???? ? ???????/??????? ??????? ? ????? ???? */
.sales-overview-dash .sales-table th.sales-col-amt,
.sales-overview-dash .sales-table td.sales-col-amt {
  background: #eafaf0 !important;
  color: #166534 !important;
  font-weight: 800;
}

.sales-overview-dash .sales-table th.sales-col-cost,
.sales-overview-dash .sales-table td.sales-col-cost {
  background: #fef7e8 !important;
  color: #92400e !important;
  font-weight: 800;
}

.sales-overview-dash .sales-table th.sales-col-share,
.sales-overview-dash .sales-table td.sales-col-share {
  background: #eef6fd !important;
  color: #0891b2 !important;
  font-weight: 700;
}

.sales-overview-dash .sales-table tfoot td.sales-col-amt {
  background: #d7f3e3 !important;
  color: #14532d !important;
}

.sales-overview-dash .sales-table tfoot td.sales-col-cost {
  background: #fdeecd !important;
  color: #78350f !important;
}

.sales-overview-dash .sales-ov-panel .dash-panel-head {
  flex: 0 0 auto;
  align-items: start;
  background: #ffffff !important;
  border-bottom: 1px solid #e8eef5;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.sales-overview-dash .sales-ov-users .suppliers-name small,
.sales-overview-dash .sales-ov-users td small {
  color: #6b858f;
  font-weight: 600;
  margin-inline-start: 0.3rem;
}

.sales-overview-dash .sales-cont-high {
  color: #0f7a45;
  font-weight: 800;
}

.sales-overview-dash .sales-cont-mid {
  color: #0891b2;
  font-weight: 800;
}

.sales-overview-dash .sales-cont-ok {
  color: #9a5b12;
  font-weight: 700;
}

.sales-overview-dash .sales-cont-low {
  color: #8a4a5a;
  font-weight: 700;
}

.sales-overview-dash .sales-ov-returns .sales-returns-donut.branch-donut {
  display: grid;
  grid-template-columns: minmax(9rem, 11rem) minmax(0, 1fr);
  gap: 0.65rem 0.85rem;
  align-items: start;
  padding: 0.55rem 0.75rem 0.85rem;
  overflow: auto;
}

.sales-overview-dash .sales-ov-returns .branch-donut-visual {
  width: min(100%, 11rem);
  margin-inline: auto;
}

.sales-overview-dash .sales-ov-returns .branch-donut-legend {
  max-height: none;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 0;
}

.sales-overview-dash .sales-ov-sub {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #6b858f;
  font-weight: 600;
}

.sales-overview-dash .sales-groups-head-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sales-overview-dash .sales-groups-status {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
}

.sales-overview-dash .sales-groups-status.is-ready {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.sales-overview-dash .sales-groups-status.is-ready::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #16a34a;
}

.sales-overview-dash .sales-groups-status.is-warming,
.sales-overview-dash .sales-groups-status.is-loading {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.sales-overview-dash .sales-groups-status.is-warming::before,
.sales-overview-dash .sales-groups-status.is-loading::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #d97706;
  animation: sales-groups-pulse 1.1s ease-in-out infinite;
}

.sales-overview-dash .sales-groups-status.is-error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.sales-overview-dash .sales-groups-status.is-error::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #dc2626;
}

@keyframes sales-groups-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.sales-overview-dash .sales-ov-scroll {
  max-height: 22rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

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

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

.sales-overview-dash .sales-ov-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef4fb !important;
  box-shadow: 0 1px 0 #9eb4ce;
}

.sales-overview-dash .sales-ov-scroll tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 4;
  background: #eaf2fb !important;
  box-shadow: 0 -1px 0 #0891b2;
}

.sales-overview-dash .sales-ov-scroll tfoot .sales-amt {
  background: #e6f6ee !important;
}

.sales-overview-dash .sales-table tbody tr.sales-zero-row td {
  color: #b91c1c;
  background: #fef2f2 !important;
  font-weight: 800;
}

.sales-overview-dash .sales-table tbody tr.sales-zero-row .sales-amt,
.sales-overview-dash .sales-table tbody tr.sales-zero-row .money,
.sales-overview-dash .sales-table tbody tr.sales-zero-row .sar-symbol {
  color: #b91c1c !important;
}

.sales-overview-dash .sales-ov-loading {
  color: #47617f !important;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .sales-overview-dash .sales-ov-kpis {
    grid-template-columns: 1fr 1fr;
  }
  .sales-overview-dash .sales-ov-grid {
    grid-template-columns: 1fr;
  }
  .sales-overview-dash .sales-ov-bottom {
    grid-template-columns: 1fr;
  }
  .sales-overview-dash .sales-ov-items-row {
    grid-template-columns: 1fr;
  }
  .sales-overview-dash .sales-ov-returns {
    min-height: 18rem;
  }
}

@media (max-width: 640px) {
  .sales-overview-dash .sales-ov-kpis {
    grid-template-columns: 1fr;
  }
  .sales-overview-dash .sales-ov-filter {
    flex-direction: column;
    align-items: stretch;
  }
}

/* الموردون — فلتر موحّد مع income-filter-bar */
.suppliers-dash .suppliers-filter.income-filter-bar {
  margin: 0 0 0.9rem;
}

.suppliers-dash .suppliers-q-field {
  flex: 1 1 12rem;
  min-width: 11rem;
}

.suppliers-dash .suppliers-q-field input[type="search"] {
  width: 100%;
}

.suppliers-dash .suppliers-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 0.9rem;
}

.suppliers-dash .suppliers-kpis .dash-kpi-value {
  display: block;
  font-size: clamp(1.1rem, 1.6vw, 1.55rem) !important;
  font-weight: 900 !important;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1280px) {
  .suppliers-dash .suppliers-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.suppliers-dash .suppliers-panel .sales-ov-sub {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #6b858f;
  font-weight: 600;
}

.suppliers-dash .suppliers-head-actions,
.suppliers-dash .dash-panel-head-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.suppliers-dash .suppliers-excel-form {
  margin: 0;
  padding: 0;
}

.suppliers-dash .suppliers-excel-btn,
.suppliers-dash .suppliers-filter .suppliers-excel-btn {
  min-height: 2.15rem;
  padding-inline: 0.9rem;
  font-weight: 700;
  border: 1px solid #86efac;
  background: #ecfdf5;
  color: #166534;
}

.suppliers-dash .suppliers-scroll {
  max-height: min(70vh, 36rem);
  overflow: auto;
}

.suppliers-dash .suppliers-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f5f9 !important;
  box-shadow: 0 1px 0 #cbd5e1;
}

.suppliers-dash .suppliers-scroll tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 3;
}

.suppliers-dash .suppliers-name {
  max-width: 22rem;
}

.suppliers-dash .suppliers-name small {
  display: inline-block;
  margin-inline-start: 0.35rem;
  color: #6b858f;
  font-weight: 600;
}

/* ?????? ??????: ?? ???? ????? ???? ???? ????? ? ??? ????? ???? */
.suppliers-dash .suppliers-table {
  width: 100%;
  table-layout: auto;
  font-size: 0.85rem;
}

.suppliers-dash .suppliers-table th,
.suppliers-dash .suppliers-table td {
  padding: 0.4rem 0.45rem;
  white-space: nowrap;
}

/* ???? ????? ???? ??? ??????? ? ??? ???? ???? ???? ?????? */
.suppliers-dash .suppliers-table .suppliers-name {
  width: 1%;
  max-width: none;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 700;
}

/* أعمدة # والمورد تمر مع باقي الخلايا (بدون sticky أفقي) */
.page.sales-dash.suppliers-dash .suppliers-table th:nth-child(1),
.page.sales-dash.suppliers-dash .suppliers-table td:nth-child(1),
.page.sales-dash.suppliers-dash .suppliers-table th:nth-child(2),
.page.sales-dash.suppliers-dash .suppliers-table td:nth-child(2),
.page.sales-dash.suppliers-dash .suppliers-table td.suppliers-name {
  position: static;
  inset-inline-start: auto;
  box-shadow: none;
}

/* ?? ??????? ?????? ????? ???? ? ???? ???? ??? ?????? ??? ??????? */
.page.sales-dash.suppliers-dash .suppliers-table tbody td {
  background: #fff !important;
}

.page.sales-dash.suppliers-dash .suppliers-table tbody tr:nth-child(even) td {
  background: #fff !important;
}

.page.sales-dash.suppliers-dash .suppliers-scroll thead th {
  background: #fff !important;
}

/* ??????? ???????? ???? ?????? ??? ?????? */
.page.sales-dash.suppliers-dash .suppliers-table tbody td.sup-col-buy {
  background: #fef7e8 !important;
}

.page.sales-dash.suppliers-dash .suppliers-table tbody td.sup-col-pay {
  background: #eafaf0 !important;
}

.page.sales-dash.suppliers-dash .suppliers-table tbody td.sup-col-stock {
  background: #eef6fd !important;
}

.page.sales-dash.suppliers-dash .suppliers-scroll thead th.sup-col-buy {
  background: #fdeecd !important;
}

.page.sales-dash.suppliers-dash .suppliers-scroll thead th.sup-col-pay {
  background: #d7f3e3 !important;
}

.page.sales-dash.suppliers-dash .suppliers-scroll thead th.sup-col-stock {
  background: #dcedfa !important;
}

.page.sales-dash.suppliers-dash .suppliers-scroll thead th:nth-child(1),
.page.sales-dash.suppliers-dash .suppliers-scroll thead th:nth-child(2) {
  background: #fff !important;
}

.suppliers-dash .suppliers-table .suppliers-name small {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
}

/* ????? ???????: ???????/??????? ??????? ? ?????? ???? ? ??????? ???? ???? */
.suppliers-dash .suppliers-table td.sup-col-buy {
  background: #fef7e8;
  color: #92400e;
  font-weight: 700;
}

.suppliers-dash .suppliers-table th.sup-col-buy {
  background: #fdeecd !important;
  color: #92400e;
}

.suppliers-dash .suppliers-table td.sup-col-pay {
  background: #eafaf0;
  color: #166534;
  font-weight: 700;
}

.suppliers-dash .suppliers-table th.sup-col-pay {
  background: #d7f3e3 !important;
  color: #166534;
}

.suppliers-dash .suppliers-table td.sup-col-stock {
  background: #eef6fd;
  color: #0891b2;
  font-weight: 700;
}

.suppliers-dash .suppliers-table th.sup-col-stock {
  background: #dcedfa !important;
  color: #0891b2;
}

.suppliers-dash .suppliers-table tfoot td.sup-col-buy,
.suppliers-dash .suppliers-table tfoot td.sup-col-pay,
.suppliers-dash .suppliers-table tfoot td.sup-col-stock {
  font-weight: 800;
}

.page.sales-dash.suppliers-dash .suppliers-table tfoot .sales-grand-row td,
.page.sales-dash.suppliers-dash .suppliers-table tfoot .sales-grand-row td:nth-child(1),
.page.sales-dash.suppliers-dash .suppliers-table tfoot .sales-grand-row td:nth-child(2) {
  position: sticky;
  bottom: 0;
  inset-inline-start: auto;
  z-index: 6;
  background: #0e7490 !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 0.84rem !important;
  border-top: 2px solid #0891b2 !important;
  box-shadow: 0 -6px 14px rgba(30, 58, 138, 0.22);
}

.page.sales-dash.suppliers-dash .suppliers-table tfoot .sales-grand-row td:first-child {
  text-align: right;
  letter-spacing: 0.02em;
}

.page.sales-dash.suppliers-dash .suppliers-table tfoot .sales-grand-row td.sup-col-buy {
  background: #b45309 !important;
  color: #fff !important;
}

.page.sales-dash.suppliers-dash .suppliers-table tfoot .sales-grand-row td.sup-col-stock {
  background: #06b6d4 !important;
  color: #fff !important;
}

.page.sales-dash.suppliers-dash .suppliers-table tfoot .sales-grand-row td.sup-col-pay {
  background: #15803d !important;
  color: #fff !important;
}

.page.sales-dash.suppliers-dash .suppliers-table tfoot .sales-grand-row .mono,
.page.sales-dash.suppliers-dash .suppliers-table tfoot .sales-grand-row .money,
.page.sales-dash.suppliers-dash .suppliers-table tfoot .sales-grand-row .sar-symbol {
  color: #fff !important;
  font-weight: 800 !important;
}

@media (max-width: 1280px) {
  .suppliers-dash .suppliers-table {
    font-size: 0.78rem;
  }
  .suppliers-dash .suppliers-table .suppliers-name {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.82rem;
  }
}

@media (max-width: 1100px) {
  .suppliers-dash .suppliers-kpis {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .suppliers-dash .suppliers-filter {
    flex-direction: column;
    align-items: stretch;
  }
  .suppliers-dash .suppliers-kpis {
    grid-template-columns: 1fr;
  }
}

/* ?? ????? ????? ???????? ?? */
.vendor-turnover-dash .vt-kpis {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0 0 0.9rem;
}

.vendor-turnover-dash .vt-kpi {
  min-height: 5.4rem;
  gap: 0.2rem;
}

.vendor-turnover-dash .vt-kpi .dash-kpi-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #3d5560;
}

.vendor-turnover-dash .vt-kpi .dash-kpi-ico {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 8px;
  color: #fff;
}

.vendor-turnover-dash .vt-kpi .dash-kpi-ico svg {
  width: 0.8rem;
  height: 0.8rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vendor-turnover-dash .vt-ico-vendors {
  background: linear-gradient(145deg, #e0a14a, #c07a22);
  box-shadow: 0 4px 10px rgba(192, 122, 34, 0.28);
}
.vendor-turnover-dash .vt-ico-recv {
  background: linear-gradient(145deg, #22d3ee, #1d6bb8);
  box-shadow: 0 4px 10px rgba(29, 107, 184, 0.28);
}
.vendor-turnover-dash .vt-ico-sold {
  background: linear-gradient(145deg, #00897b, #00695c);
  box-shadow: 0 4px 10px rgba(0, 137, 123, 0.28);
}
.vendor-turnover-dash .vt-ico-turn {
  background: linear-gradient(145deg, #7e57c2, #5e35b1);
  box-shadow: 0 4px 10px rgba(94, 53, 177, 0.28);
}
.vendor-turnover-dash .vt-ico-settle {
  background: linear-gradient(145deg, #23b268, #12854b);
  box-shadow: 0 4px 10px rgba(18, 133, 75, 0.28);
}
.vendor-turnover-dash .vt-ico-due {
  background: linear-gradient(145deg, #5c6bc0, #3949ab);
  box-shadow: 0 4px 10px rgba(57, 73, 171, 0.28);
}
.vendor-turnover-dash .vt-ico-hold {
  background: linear-gradient(145deg, #e53935, #b71c1c);
  box-shadow: 0 4px 10px rgba(183, 28, 28, 0.28);
}

.vendor-turnover-dash .vt-kpi-vendors {
  border-color: rgba(192, 122, 34, 0.42) !important;
  background: linear-gradient(145deg, #fff8ef, #f3dfc0) !important;
  box-shadow: 0 10px 24px rgba(192, 122, 34, 0.14);
}
.vendor-turnover-dash .vt-kpi-recv {
  border-color: rgba(29, 107, 184, 0.38) !important;
  background: linear-gradient(145deg, #f3f8ff, #d7e8fb) !important;
  box-shadow: 0 10px 24px rgba(29, 107, 184, 0.12);
}
.vendor-turnover-dash .vt-kpi-sold {
  border-color: rgba(0, 105, 92, 0.38) !important;
  background: linear-gradient(145deg, #f0faf8, #cfeae5) !important;
  box-shadow: 0 10px 24px rgba(0, 105, 92, 0.12);
}
.vendor-turnover-dash .vt-kpi-turn {
  border-color: rgba(94, 53, 177, 0.36) !important;
  background: linear-gradient(145deg, #f7f3ff, #e0d4f7) !important;
  box-shadow: 0 10px 24px rgba(94, 53, 177, 0.12);
}
.vendor-turnover-dash .vt-kpi-costadj {
  border-color: rgba(201, 133, 26, 0.42) !important;
  background: linear-gradient(145deg, #fffaf0, #f6e3c0) !important;
  box-shadow: 0 10px 24px rgba(201, 133, 26, 0.14);
}
.vendor-turnover-dash .vt-kpi-settle {
  border-color: rgba(18, 133, 75, 0.4) !important;
  background: linear-gradient(145deg, #f0faf4, #cfeeda) !important;
  box-shadow: 0 10px 24px rgba(18, 133, 75, 0.12);
}
.vendor-turnover-dash .vt-kpi-due {
  border-color: rgba(57, 73, 171, 0.36) !important;
  background: linear-gradient(145deg, #f4f5ff, #d9ddf8) !important;
  box-shadow: 0 10px 24px rgba(57, 73, 171, 0.12);
}
.vendor-turnover-dash .vt-kpi-hold {
  border-color: rgba(183, 28, 28, 0.36) !important;
  background: linear-gradient(145deg, #fff5f5, #f6d4d4) !important;
  box-shadow: 0 10px 24px rgba(183, 28, 28, 0.12);
}

.vendor-turnover-dash .vt-kpi-vendors .dash-kpi-value { color: #9a6214; }
.vendor-turnover-dash .vt-kpi-recv .dash-kpi-value { color: #1d6bb8; }
.vendor-turnover-dash .vt-kpi-sold .dash-kpi-value { color: #00695c; }
.vendor-turnover-dash .vt-kpi-turn .dash-kpi-value { color: #5e35b1; }
.vendor-turnover-dash .vt-kpi-due .dash-kpi-value { color: #3949ab; }
.vendor-turnover-dash .vt-kpi-settle .dash-kpi-value { color: #0f6b45; }
.vendor-turnover-dash .vt-kpi-hold .dash-kpi-value { color: #b71c1c; }

.vendor-turnover-dash .vt-due-pos { color: #1b5e20; font-weight: 700; }
.vendor-turnover-dash .vt-due-neg { color: #b71c1c; font-weight: 700; }

.vendor-turnover-dash .vt-kpi .dash-kpi-value {
  overflow: hidden;
  font-size: clamp(0.9rem, 1.2vw, 1.18rem);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vendor-turnover-dash .vt-kpi .dash-kpi-hint {
  font-size: 0.68rem;
  color: #5f738c;
}

.vendor-turnover-dash .vt-vendor-code {
  font-size: 0.72rem;
  color: #6b7c93;
  font-weight: 700;
  white-space: nowrap;
}
.vendor-turnover-dash span.vt-vendor-code {
  display: block;
  margin-top: 0.15rem;
  font-weight: 600;
}

.vendor-turnover-dash .vt-bar-wrap {
  position: relative;
  min-width: 6.5rem;
  height: 1.35rem;
  border-radius: 6px;
  background: rgba(70, 90, 120, 0.1);
  overflow: hidden;
}

.vendor-turnover-dash .vt-bar {
  display: block;
  height: 100%;
  border-radius: 6px;
  min-width: 0;
}

.vendor-turnover-dash .vt-bar-settle { background: #1f9d6a; }
.vendor-turnover-dash .vt-bar-partial { background: #c9851a; }
.vendor-turnover-dash .vt-bar-hold { background: #b45353; }

.vendor-turnover-dash .vt-bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1a2b3c;
  text-shadow: 0 0 4px rgba(255,255,255,0.7);
}

.vendor-turnover-dash .vt-badge {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.vendor-turnover-dash .vt-badge-settle {
  background: rgba(31, 157, 106, 0.15);
  color: #0f6b45;
}

.vendor-turnover-dash .vt-badge-partial {
  background: rgba(201, 133, 26, 0.16);
  color: #8a5a0a;
}

.vendor-turnover-dash .vt-badge-hold {
  background: rgba(180, 83, 83, 0.14);
  color: #8a3030;
}

.vendor-turnover-dash .vt-table-panel .dash-panel-head {
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
}
.vendor-turnover-dash .vt-head-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 1 18rem;
  min-width: 12rem;
}
.vendor-turnover-dash .vt-q {
  flex: 1 1 auto;
  min-width: 0;
  height: 2.15rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid #c5d5e8;
  border-radius: 10px;
  background: #fff;
  color: #143a6b;
  font: 700 0.82rem var(--font, inherit);
}
.vendor-turnover-dash .vt-q:focus {
  outline: none;
  border-color: #1d6bb8;
  box-shadow: 0 0 0 3px rgba(29, 107, 184, 0.16);
}
.vendor-turnover-dash .vt-q::placeholder {
  color: #7b8da3;
  font-weight: 600;
}

@media (max-width: 1280px) {
  .vendor-turnover-dash .vt-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .vendor-turnover-dash .vt-kpis {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .vendor-turnover-dash .vt-kpis {
    grid-template-columns: 1fr;
  }
}

/* ?? ????? ????????: ???? ????? ?? */
.vendor-turnover-dash .vt-table-compact {
  font-size: 0.78rem;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.vendor-turnover-dash .vt-table-compact th,
.vendor-turnover-dash .vt-table-compact td {
  padding: 0.28rem 0.4rem !important;
  line-height: 1.25;
  vertical-align: middle;
}
.vendor-turnover-dash .vt-name-cell {
  max-width: 16rem;
  min-width: 11rem;
}
.vendor-turnover-dash .vt-name-cell strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vendor-turnover-dash .vt-vendor-code {
  font-size: 0.72rem;
  color: #6b7c93;
  font-weight: 700;
  white-space: nowrap;
}
.vendor-turnover-dash span.vt-vendor-code {
  display: block;
  margin-top: 0.05rem;
  font-size: 0.65rem;
  font-weight: 600;
}
.vendor-turnover-dash .vt-turn-cell {
  font-weight: 800;
  min-width: 3.5rem;
}
.vendor-turnover-dash .vt-badge {
  padding: 0.12rem 0.4rem;
  font-size: 0.68rem;
}
.vendor-turnover-dash .vt-row-settle { background: transparent; }
.vendor-turnover-dash .vt-row-partial { background: transparent; }
.vendor-turnover-dash .vt-row-hold { background: transparent; }
.vendor-turnover-dash .vt-excel-btn {
  min-height: 2.15rem;
  padding-inline: 0.9rem;
  font-weight: 700;
}
.page.vendor-turnover-dash .vt-table-wrap {
  max-height: min(70vh, 42rem);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #d5e0ee;
  border-radius: 8px;
  background: #ffffff;
  isolation: isolate;
}
.page.vendor-turnover-dash .vt-table-panel,
.page.vendor-turnover-dash .vt-items-panel {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 8px 20px rgba(8, 145, 178, 0.08);
}
.page.vendor-turnover-dash .vt-table-panel .table-wrap,
.page.vendor-turnover-dash .vt-table-panel .data-table,
.page.vendor-turnover-dash .vt-items-panel .table-wrap,
.page.vendor-turnover-dash .vt-items-panel .data-table,
.page.vendor-turnover-dash .vt-table-compact {
  background: #ffffff !important;
  background-color: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.page.vendor-turnover-dash .vt-table-compact {
  border-collapse: separate;
  border-spacing: 0;
}
.page.vendor-turnover-dash .vt-table-wrap thead th,
.page.vendor-turnover-dash .vt-table-compact thead th,
.page.vendor-turnover-dash .data-table.vt-table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
  background: #0e7490 !important;
  background-color: #0e7490 !important;
  background-image: none !important;
  color: #ffffff !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
  font-size: 0.72rem;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}
.page.vendor-turnover-dash .vt-table-compact thead tr:first-child th[rowspan] {
  z-index: 35 !important;
}
.page.vendor-turnover-dash .vt-table-compact thead tr.vt-subhead th {
  top: 1.85rem !important;
  z-index: 33 !important;
  background: #2a4f78 !important;
  background-color: #2a4f78 !important;
  font-size: 0.68rem;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.page.vendor-turnover-dash .vt-table-compact thead .vt-g-qty {
  background: #0e7490 !important;
  background-color: #0e7490 !important;
  letter-spacing: 0.01em;
}
.page.vendor-turnover-dash .vt-table-compact thead .vt-g-pay {
  background: #1b4332 !important;
  background-color: #1b4332 !important;
}
.page.vendor-turnover-dash .vt-table-compact .vt-sep {
  border-inline-start: 2px solid rgba(255, 255, 255, 0.28);
}
.page.vendor-turnover-dash .vt-table-compact tbody td.vt-sep,
.page.vendor-turnover-dash .vt-table-compact tfoot td.vt-sep {
  border-inline-start: 2px solid #c5d4e6;
}
.page.vendor-turnover-dash .vt-table-compact .vt-num {
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}
.page.vendor-turnover-dash .vt-table-compact col.vt-col-idx { width: 2.4rem; }
.page.vendor-turnover-dash .vt-table-compact col.vt-col-name { width: 16rem; }
.page.vendor-turnover-dash .vt-table-compact col.vt-col-code { width: 5.5rem; }
.page.vendor-turnover-dash .vt-table-compact col.vt-col-qty { width: 5.6rem; }
.page.vendor-turnover-dash .vt-table-compact col.vt-col-turn { width: 4.8rem; }
.page.vendor-turnover-dash .vt-table-compact col.vt-col-due { width: 6.4rem; }
.page.vendor-turnover-dash .vt-table-compact col.vt-col-dec { width: 6.2rem; }
.page.vendor-turnover-dash .vt-table-compact col.vt-col-items { width: 3.6rem; }
.page.vendor-turnover-dash .vt-table-compact th.vt-col-name,
.page.vendor-turnover-dash .vt-table-compact td.vt-name-cell {
  text-align: right;
}
.page.vendor-turnover-dash .vt-table-compact th.vt-col-code,
.page.vendor-turnover-dash .vt-table-compact td.vt-vendor-code {
  text-align: center;
  white-space: nowrap;
}
.page.vendor-turnover-dash .vt-table-compact td:nth-child(8) {
  text-align: center;
}
.vendor-turnover-dash .vt-name-cell {
  max-width: 16rem;
  min-width: 11rem;
}
.page.vendor-turnover-dash .vt-table-compact tbody td {
  background: #ffffff !important;
  background-color: #ffffff !important;
}
.page.vendor-turnover-dash .vt-table-compact tbody tr:nth-child(even) td {
  background: #f3f6fb !important;
  background-color: #f3f6fb !important;
}
.page.vendor-turnover-dash .vt-table-compact tbody tr:hover td {
  background: #e8f0fa !important;
  background-color: #e8f0fa !important;
}
.page.vendor-turnover-dash .vt-table-compact tbody tr.vt-row-settle td {
  background: #eaf8f1 !important;
  background-color: #eaf8f1 !important;
}
.page.vendor-turnover-dash .vt-table-compact tbody tr.vt-row-settle:nth-child(even) td {
  background: #e1f3ea !important;
  background-color: #e1f3ea !important;
}
.page.vendor-turnover-dash .vt-table-compact tbody tr.vt-row-partial td {
  background: #fff8e8 !important;
  background-color: #fff8e8 !important;
}
.page.vendor-turnover-dash .vt-table-compact tbody tr.vt-row-partial:nth-child(even) td {
  background: #fff3d9 !important;
  background-color: #fff3d9 !important;
}
.page.vendor-turnover-dash .vt-table-compact tbody tr.vt-row-hold td {
  background: #fff0f0 !important;
  background-color: #fff0f0 !important;
}
.page.vendor-turnover-dash .vt-table-compact tbody tr.vt-row-hold:nth-child(even) td {
  background: #ffe4e4 !important;
  background-color: #ffe4e4 !important;
}
.page.vendor-turnover-dash .vt-table-compact tbody tr.vt-row-settle:hover td {
  background: #d7efe3 !important;
  background-color: #d7efe3 !important;
}
.page.vendor-turnover-dash .vt-table-compact tbody tr.vt-row-partial:hover td {
  background: #ffecc2 !important;
  background-color: #ffecc2 !important;
}
.page.vendor-turnover-dash .vt-table-compact tbody tr.vt-row-hold:hover td {
  background: #ffd4d4 !important;
  background-color: #ffd4d4 !important;
}
.page.vendor-turnover-dash .vt-table-compact tfoot td,
.page.vendor-turnover-dash .vt-table-compact tfoot .sales-grand-row td {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: #0e7490 !important;
  background-color: #0e7490 !important;
  background-image: none !important;
  color: #ffffff !important;
  border-top: 2px solid #16304f !important;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.18);
  font-weight: 800;
  opacity: 1 !important;
}
.page.vendor-turnover-dash .vt-table-compact tfoot .vt-due-cell,
.page.vendor-turnover-dash .vt-table-compact tfoot .vt-due-pos,
.page.vendor-turnover-dash .vt-table-compact tfoot .vt-due-neg,
.page.vendor-turnover-dash .vt-table-compact tfoot .vt-turn-cell,
.page.vendor-turnover-dash .vt-table-compact tfoot .mono {
  color: #ffffff !important;
}
.vendor-turnover-dash .vt-row-settle,
.vendor-turnover-dash .vt-row-partial,
.vendor-turnover-dash .vt-row-hold {
  background: transparent;
}

.vendor-turnover-dash .vt-items-panel ~ .vt-kpis,
.vendor-turnover-dash .vt-kpis:has(.vt-kpi-vendors):not(:has(.vt-kpi-due)) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.vendor-turnover-dash .vt-items-link {
  color: #0891b2;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.vendor-turnover-dash .vt-items-link:hover {
  color: #0f3a6e;
}

.vendor-turnover-dash .vt-items-toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
}

.vendor-turnover-dash .vt-sheet-wrap {
  max-height: min(75vh, 46rem);
  overflow: auto;
  border: 1px solid #c5d3e4;
  border-radius: 6px;
  background: #fff;
}

.vendor-turnover-dash .vt-sheet {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.76rem;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.vendor-turnover-dash .vt-sheet th,
.vendor-turnover-dash .vt-sheet td {
  border-inline-end: 1px solid #d7e2ef;
  border-bottom: 1px solid #d7e2ef;
  padding: 0.32rem 0.5rem;
  white-space: nowrap;
  vertical-align: middle;
}

.vendor-turnover-dash .vt-sheet thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #0e7490;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 1px 0 #16304f;
}

.vendor-turnover-dash .vt-sheet tbody tr:nth-child(even) td {
  background: #f7fafc;
}

.vendor-turnover-dash .vt-sheet tbody tr:hover td {
  background: #eef5ff;
}

.vendor-turnover-dash .vt-sheet tbody tr.vt-cost-adj-row td {
  background: #fff6e8;
}

.vendor-turnover-dash .vt-sheet tbody tr.vt-cost-adj-row:nth-child(even) td {
  background: #ffefd4;
}

.vendor-turnover-dash .vt-sheet tbody tr.vt-cost-adj-row:hover td {
  background: #ffe4b8;
}

.vendor-turnover-dash .vt-cost-adj-yes {
  display: inline-block;
  padding: 0.12rem 0.42rem;
  border-radius: 6px;
  background: rgba(201, 133, 26, 0.16);
  color: #8a5a0a;
  font-weight: 800;
}

.vendor-turnover-dash .vt-cost-adj-n {
  color: #8a5a0a;
  font-weight: 700;
}

.vendor-turnover-dash .vt-cost-adj-cell {
  white-space: nowrap;
}

.vendor-turnover-dash .vt-sheet-num {
  min-width: 2.2rem;
  text-align: center;
}

.vendor-turnover-dash .vt-sheet-code {
  font-weight: 700;
  color: #0891b2;
}

.vendor-turnover-dash .vt-sheet-name {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: #1f2a37;
}

.vendor-turnover-dash .vt-share-cell {
  font-weight: 800;
  color: #0f6b45;
}

.vendor-turnover-dash .vt-sheet tfoot td {
  position: sticky;
  bottom: 0;
  background: #e8eef6;
  font-weight: 800;
}

/* Home — welcome (site palette) */
.welcome-dash .welcome-hero {
  display: grid;
  gap: 1.35rem;
  padding: 1.2rem 1.25rem 1.3rem;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(6, 182, 212, 0.07), transparent 52%),
    radial-gradient(ellipse 55% 40% at 0% 0%, rgba(8, 145, 178, 0.06), transparent 48%),
    #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.welcome-hero-copy {
  max-width: 42rem;
  animation: welcome-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.welcome-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.welcome-title {
  margin: 0 0 0.45rem;
  font-family: var(--font);
  font-size: clamp(1.55rem, 3.2vw, 2rem);
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.welcome-greeting {
  margin: 0 0 0.75rem;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.35;
}

.welcome-name {
  color: var(--brand);
  font-weight: 800;
}

.welcome-role-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.9rem;
  animation: welcome-rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.welcome-role-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.welcome-role {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid #c5dde8;
}

.welcome-role.is-staff {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-color: #b6cfe0;
}

.welcome-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.7;
  animation: welcome-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

.welcome-empty {
  margin: 0.35rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #6b858f;
  font-size: 0.9rem;
  font-weight: 600;
}

.welcome-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  animation: welcome-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.welcome-card {
  --card-accent: var(--brand-mid);
  --card-ink: var(--brand-dark);
  --card-wash: var(--brand-soft);
  position: relative;
  display: grid;
  gap: 0.35rem;
  padding: 1.05rem 1rem 0.95rem;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--card-accent) 22%, var(--line));
  border-radius: var(--radius);
  background:
    radial-gradient(120px 70px at 100% 0, color-mix(in srgb, var(--card-accent) 18%, transparent), transparent 70%),
    linear-gradient(165deg, var(--card-wash) 0%, #fff 58%);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.welcome-card--sales {
  --card-accent: #06b6d4;
  --card-ink: #0e7490;
  --card-wash: #e8f2f7;
}

.welcome-card--perf {
  --card-accent: #06b6d4;
  --card-ink: #0e7490;
  --card-wash: #e8f1fe;
}

.welcome-card--inv {
  --card-accent: #d97706;
  --card-ink: #9a3412;
  --card-wash: #fff7ed;
}

.welcome-card--purch {
  --card-accent: #0f7a6b;
  --card-ink: #115e59;
  --card-wash: #e6f5f2;
}

.welcome-card--income {
  --card-accent: #15803d;
  --card-ink: #14532d;
  --card-wash: #ecfdf5;
}

.welcome-card--assets {
  --card-accent: #7c3aed;
  --card-ink: #5b21b6;
  --card-wash: #f5f3ff;
}

.welcome-card--search {
  --card-accent: #4f46e5;
  --card-ink: #312e81;
  --card-wash: #eef2ff;
}

.welcome-card::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: var(--card-accent);
}

.welcome-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--card-accent) 45%, var(--line));
  box-shadow: var(--shadow);
}

.welcome-card-ico {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--card-accent);
  margin-bottom: 0.2rem;
}

.welcome-card-ico svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-card strong {
  font-size: 0.98rem;
  color: var(--card-ink);
}

.welcome-card > span:last-child {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.35;
}

a.sidebar-brand-lockup {
  text-decoration: none;
  color: inherit;
}

/* Welcome image slider */
.welcome-slider {
  margin-top: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b1428;
  box-shadow: var(--shadow-sm);
  animation: welcome-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.welcome-slider-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 14rem;
  max-height: min(28rem, 48vw);
  overflow: hidden;
}

.welcome-slider-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.welcome-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.55s ease, transform 0.7s ease;
  pointer-events: none;
}

.welcome-slide.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  z-index: 1;
}

.welcome-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.welcome-slide figcaption {
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: 0;
  bottom: 0;
  padding: 1.6rem 1.15rem 1rem;
  background: linear-gradient(180deg, transparent, rgba(6, 12, 28, 0.88) 55%);
  color: #e8eefc;
  display: grid;
  gap: 0.2rem;
}

.welcome-slide figcaption strong {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.welcome-slide figcaption span {
  font-size: 0.82rem;
  font-weight: 600;
  color: #b7c3e0;
  line-height: 1.4;
}

.welcome-slider-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, #0b1428 92%, #fff 8%);
}

.welcome-slider-btn {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  cursor: pointer;
}

.welcome-slider-btn svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-slider-btn:hover,
.welcome-slider-btn:focus-visible {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  outline: none;
}

.welcome-slider-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 1;
}

.welcome-slider-dots button {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.welcome-slider-dots button.is-active,
.welcome-slider-dots button[aria-selected="true"] {
  width: 1.35rem;
  background: var(--brand);
}

@keyframes welcome-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .welcome-shortcuts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .welcome-slider-viewport {
    aspect-ratio: 16 / 9;
    max-height: min(18rem, 56vw);
    min-height: 11rem;
  }
}

@media (max-width: 560px) {
  .welcome-shortcuts {
    grid-template-columns: 1fr;
  }
  .welcome-slide figcaption {
    padding: 1.25rem 0.85rem 0.75rem;
  }
  .welcome-slide figcaption strong {
    font-size: 0.92rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-hero-copy,
  .welcome-role-line,
  .welcome-sub,
  .welcome-shortcuts,
  .welcome-card,
  .welcome-slider,
  .welcome-slide {
    animation: none;
    transition: none;
  }
}


/* ????? ???????? ? ???? ??????? ????? ????? ????? */
/* ????? ???????? ? ???? ????? ????? */
.trial-balance-dash .tb-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.65rem 0.85rem;
}

.trial-balance-dash .tb-inv-check {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem 1rem;
}

.trial-balance-dash .tb-inv-check.is-ok {
  border-color: rgba(35, 178, 104, 0.35);
}

.trial-balance-dash .tb-inv-check.is-bad {
  border-color: rgba(220, 80, 80, 0.4);
}

.trial-balance-dash .tb-inv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.55rem;
}

.trial-balance-dash .tb-inv-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(201, 220, 240, 0.8);
}

.trial-balance-dash .tb-inv-card span {
  font-size: 0.72rem;
  font-weight: 800;
  color: #5d738c;
}

.trial-balance-dash .tb-inv-card strong {
  font-size: 1.05rem;
  color: #16324f;
}

.trial-balance-dash .tb-inv-card small {
  font-size: 0.72rem;
  color: #1b6b45;
  font-weight: 700;
}

.trial-balance-dash .tb-inv-note {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: #47617f;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .trial-balance-dash .tb-inv-grid {
    grid-template-columns: 1fr;
  }
}

.trial-balance-dash .tb-filter-bar .income-filter-bar-main {
  display: grid;
  grid-template-columns:
    minmax(15.5rem, 1.35fr)
    minmax(8.5rem, 1fr)
    minmax(7.5rem, 0.9fr)
    minmax(6.5rem, 0.75fr)
    minmax(5.5rem, 0.65fr);
  align-items: end;
  gap: 0.55rem 0.7rem;
  flex: unset;
}

.trial-balance-dash .tb-filter-bar .income-filter-field select,
.trial-balance-dash .tb-filter-bar .income-filter-field input[type="date"] {
  width: 100%;
  min-width: 0;
}

.trial-balance-dash .tb-filter-bar .income-filter-period-fields {
  width: 100%;
}

.trial-balance-dash .tb-filter-bar .income-filter-period-fields .income-filter-field {
  flex: 1 1 0;
}

.trial-balance-dash .tb-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.trial-balance-dash .tb-excel-btn {
  min-height: 2.35rem;
  padding-inline: 0.95rem;
  font-weight: 700;
  border: 1px solid #86efac;
  background: #ecfdf5;
  color: #166534;
  border-radius: 0.65rem;
}

@media (max-width: 1100px) {
  .trial-balance-dash .tb-filter-bar {
    grid-template-columns: 1fr;
  }

  .trial-balance-dash .tb-filter-bar .income-filter-bar-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trial-balance-dash .tb-filter-bar .income-filter-period {
    grid-column: 1 / -1;
  }

  .trial-balance-dash .tb-filter-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .trial-balance-dash .tb-filter-bar .income-filter-bar-main {
    grid-template-columns: 1fr;
  }
}

.trial-balance-dash .income-account-shell {
  overflow: hidden;
}

.trial-balance-dash .tb-main-scroll {
  max-height: min(58vh, 600px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.trial-balance-dash .tb-income-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}

.page.sales-dash.trial-balance-dash .tb-income-table thead th,
.trial-balance-dash .dash-panel-glass .tb-income-table thead th,
.trial-balance-dash .tb-income-table thead th {
  position: sticky;
  top: 0;
  z-index: 8;
  color: #12345f;
  font-weight: 800;
  opacity: 1 !important;
  background: #dbe8f8 !important;
  background-color: #dbe8f8 !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-clip: border-box !important;
  box-shadow: 0 1px 0 #9eb6d4;
}

.page.sales-dash.trial-balance-dash .tb-income-table thead th::after,
.trial-balance-dash .tb-income-table thead th::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #dbe8f8;
  pointer-events: none;
}

.trial-balance-dash .tb-income-table th,
.trial-balance-dash .tb-income-table td {
  white-space: nowrap;
}

.trial-balance-dash .tb-income-table .income-name-cell {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trial-balance-dash .tb-analytic-table {
  min-width: 58rem;
}

.trial-balance-dash .tb-detail-table {
  min-width: 72rem;
}

.trial-balance-dash .tb-analytic-table .tb-dtl-code-cell {
  color: #0891b2;
  font-weight: 800;
}

.trial-balance-dash .tb-col-branch {
  width: 8.5rem;
}

.trial-balance-dash .tb-b-code {
  display: inline-block;
  margin-inline-start: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 0.35rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: #0891b2;
  background: #e4eefb;
}

.trial-balance-dash .tb-corrupt-badge {
  display: inline-block;
  margin-inline-start: 0.3rem;
  padding: 0.08rem 0.4rem;
  border-radius: 0.35rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #8a1f1f;
  background: #f8dede;
  border: 1px solid #e7b0b0;
  white-space: nowrap;
  vertical-align: middle;
}

.trial-balance-dash .tb-row-corrupt td {
  background: #fff5f5;
}

.trial-balance-dash .tb-row-corrupt .mono {
  color: #7a1d1d;
  font-weight: 700;
}

.trial-balance-dash .tb-corrupt-banner {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  border: 1px solid #e7b0b0;
  background: #fff1f1;
  color: #7a1d1d;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.45;
}

.trial-balance-dash .income-account-foot {
  overflow-x: auto;
}

.trial-balance-dash .income-account-foot-table {
  width: max-content;
  min-width: 100%;
}

.trial-balance-dash .income-accounts-head .income-scope-filter {
  flex-wrap: wrap;
}

.trial-balance-dash .tb-panel-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  padding-bottom: 0.75rem;
}

.trial-balance-dash .tb-panel-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.trial-balance-dash .tb-panel-head-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.trial-balance-dash .tb-panel-head-copy h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.trial-balance-dash .tb-panel-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
  margin: 0.28rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #5a7394;
  line-height: 1.4;
}

.trial-balance-dash .tb-meta-sep {
  opacity: 0.55;
}

.trial-balance-dash .tb-panel-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(8.5rem, 0.9fr) auto;
  gap: 0.55rem;
  align-items: end;
  padding: 0.55rem 0.65rem;
  border: 1px solid #d5e2f0;
  border-radius: 10px;
  background: #f4f8fd;
}

.trial-balance-dash .tb-tool-field {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}

.trial-balance-dash .tb-tool-label {
  font-size: 0.66rem;
  font-weight: 800;
  color: #6a829e;
  letter-spacing: 0.02em;
}

.trial-balance-dash .tb-tool-field select {
  width: 100%;
  height: 2.05rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid #c5d5e8;
  border-radius: 8px;
  background: #fff;
  color: #12345f;
  font-size: 0.78rem;
  font-weight: 700;
}

.trial-balance-dash .tb-tool-submit {
  height: 2.05rem;
  padding: 0 1rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .trial-balance-dash .tb-panel-toolbar {
    grid-template-columns: 1fr;
  }

  .trial-balance-dash .tb-tool-submit {
    width: 100%;
  }
}

.trial-balance-dash .income-rank-row.is-debit .income-rank-amt {
  color: #9a3412;
}

.trial-balance-dash .income-rank-row.is-credit .income-rank-amt {
  color: #0b7a45;
}

.trial-balance-dash .income-rank-row.is-balanced .income-rank-amt {
  color: #0891b2;
}

.trial-balance-dash .income-rank-row.is-debit .income-rank-fill {
  background: linear-gradient(90deg, #f0a060, #c2410c);
}

.trial-balance-dash .income-rank-row.is-credit .income-rank-fill {
  background: linear-gradient(90deg, #2bc978, #1a9a55);
}

.trial-balance-dash .income-rank-row.is-balanced .income-rank-fill {
  background: linear-gradient(90deg, #7eb6ef, #06b6d4);
}

.assets-filter.income-filter-bar {
  margin-bottom: 0.9rem;
}

.assets-q-field {
  flex: 1 1 12rem;
  min-width: 11rem;
}

.assets-q-field input[type="search"] {
  width: 100%;
}

.assets-dash .assets-kpis.income-kpi-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.assets-kpi-ratio .dash-kpi-value {
  color: #0e7490;
}

.assets-kpi-ico-ratio {
  background: rgba(14, 116, 144, 0.14);
  color: #0e7490;
}

.assets-exec-duo {
  grid-template-columns: 1fr;
}

.assets-structure-branch-duo,
.assets-groups-top-duo {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

.assets-structure-panel,
.assets-group-panel,
.assets-top-panel,
.assets-branch-panel,
.assets-list-panel,
.assets-register-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.assets-structure-board .income-comp-callout-meta .money,
.assets-structure-board .income-comp-center-val.money,
.assets-structure-board .income-comp-center-val .money,
.assets-group-board .income-comp-callout-meta .money,
.assets-group-board .income-comp-center-val.money,
.assets-group-board .income-comp-center-val .money {
  color: inherit;
}

.assets-branch-vchart {
  max-height: none;
  overflow: visible;
}

.assets-dash .assets-branch-vchart .income-vfill,
.assets-dash .assets-branch-vchart .assets-bv-fill {
  width: 0 !important;
  max-width: 100% !important;
  height: 100% !important;
}

.assets-dash .assets-branch-vchart .income-vfill[data-bar-pct],
.assets-dash .assets-branch-vchart .assets-bv-fill[data-bar-pct] {
  width: var(--bar-pct, 0%) !important;
}

.assets-dash .assets-branch-vchart .income-vmeta,
.assets-dash .assets-branch-vchart .income-vmeta.mono,
.assets-dash .assets-branch-vchart .income-vmeta .money,
.assets-dash .assets-branch-vchart .income-vmeta .money-value,
.assets-dash .assets-branch-vchart .income-vmeta .sar-symbol,
.assets-dash .assets-branch-vchart .income-vcol.is-profit .income-vmeta,
.assets-dash .assets-branch-vchart .income-vcol.is-profit .income-vmeta .money,
.assets-dash .assets-branch-vchart .income-vcol.is-profit .income-vmeta .money-value,
.assets-dash .assets-branch-vchart .income-vcol.is-profit .income-vmeta .sar-symbol {
  color: #d97706;
  font-weight: 800;
}

.assets-bv-fill {
  background: linear-gradient(90deg, #34d399, #059669);
}

.assets-top-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.35rem 0.7rem 0.85rem;
}

.assets-top-row {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr);
  gap: 0.4rem 0.55rem;
  align-items: start;
  padding: 0.5rem 0.6rem 0.55rem;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(232, 240, 252, 0.7));
  border: 1px solid rgba(167, 190, 220, 0.55);
  box-shadow: inset 3px 0 0 #22d3ee;
  animation: assets-top-in 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 35ms);
}

@keyframes assets-top-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.assets-top-row:nth-child(4n+2) { box-shadow: inset 3px 0 0 #1fa85c; }
.assets-top-row:nth-child(4n+3) { box-shadow: inset 3px 0 0 #d08920; }
.assets-top-row:nth-child(4n) { box-shadow: inset 3px 0 0 #6d28d9; }

.assets-top-rank {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  background: #e8f0fa;
  color: #0891b2;
  font-size: 0.72rem;
  font-weight: 800;
}

.assets-top-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
}

.assets-top-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #12345f;
  font-size: 0.86rem;
}

.assets-top-amt {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 800;
  color: #d97706;
}

.assets-top-amt .money,
.assets-top-amt .money-value,
.assets-top-amt .sar-symbol {
  color: inherit;
}

.assets-top-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin: 0.2rem 0 0.35rem;
  font-size: 0.72rem;
  color: #64748b;
}

.assets-top-book {
  color: #6d28d9;
  font-weight: 700;
}

.assets-top-track {
  height: 0.38rem;
  border-radius: 999px;
  background: #e2eaf4;
  overflow: hidden;
}

.assets-top-fill {
  display: block;
  height: 100%;
  width: var(--bar-pct, 0%);
  border-radius: 999px;
  background: linear-gradient(90deg, #2f6fed, #8b5cf6);
}

.assets-register-panel {
  margin-top: 0.65rem;
}

.assets-list-wrap {
  max-height: min(68vh, 40rem);
  flex: 1;
  overflow: auto;
}

.assets-list-wrap.table-wrap::after {
  display: none;
  content: none;
}

.page.sales-dash.assets-dash .assets-table,
.assets-dash .assets-table {
  border-collapse: separate;
  border-spacing: 0;
}

.page.sales-dash.assets-dash .assets-table thead th,
.assets-dash .assets-table thead th {
  position: sticky;
  top: 0;
  z-index: 8;
  color: #12345f;
  font-weight: 800;
  white-space: nowrap;
  opacity: 1 !important;
  background: #dbe8f8 !important;
  background-color: #dbe8f8 !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 1px 0 #9eb6d4;
}

.page.sales-dash.assets-dash .assets-table thead th::after,
.assets-dash .assets-table thead th::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #dbe8f8;
  pointer-events: none;
}

.page.sales-dash.assets-dash .assets-table thead th.assets-th-cost,
.assets-dash .assets-table thead th.assets-th-cost {
  background: #c8f0d8 !important;
  background-color: #c8f0d8 !important;
  color: #14532d;
}

.page.sales-dash.assets-dash .assets-table thead th.assets-th-cost::after,
.assets-dash .assets-table thead th.assets-th-cost::after {
  background: #c8f0d8;
}

.page.sales-dash.assets-dash .assets-table thead th.assets-th-depr,
.assets-dash .assets-table thead th.assets-th-depr {
  background: #ffd7b8 !important;
  background-color: #ffd7b8 !important;
  color: #9a3412;
}

.page.sales-dash.assets-dash .assets-table thead th.assets-th-depr::after,
.assets-dash .assets-table thead th.assets-th-depr::after {
  background: #ffd7b8;
}

.page.sales-dash.assets-dash .assets-table thead th.assets-th-book,
.assets-dash .assets-table thead th.assets-th-book {
  background: #ddd6fe !important;
  background-color: #ddd6fe !important;
  color: #5b21b6;
}

.page.sales-dash.assets-dash .assets-table thead th.assets-th-book::after,
.assets-dash .assets-table thead th.assets-th-book::after {
  background: #ddd6fe;
}

.page.sales-dash.assets-dash .assets-table th:nth-child(2),
.page.sales-dash.assets-dash .assets-table td:nth-child(2),
.assets-dash .assets-table .pr-item {
  max-width: 16rem !important;
}

.page.sales-dash.assets-dash .assets-table tbody td.assets-td-cost,
.assets-dash .assets-table tbody .assets-td-cost {
  color: #15803d !important;
  background: #ecfdf3 !important;
  font-weight: 800;
}

.page.sales-dash.assets-dash .assets-table tbody td.assets-td-depr,
.assets-dash .assets-table tbody .assets-td-depr {
  color: #c2410c !important;
  background: #fff7ed !important;
  font-weight: 800;
}

.page.sales-dash.assets-dash .assets-table tbody td.assets-td-book,
.assets-dash .assets-table tbody .assets-td-book {
  color: #6d28d9 !important;
  font-weight: 800;
}

.page.sales-dash.assets-dash .assets-table tfoot .sales-grand-row td,
.assets-dash .assets-table tfoot .sales-grand-row td {
  position: sticky;
  bottom: 0;
  z-index: 6;
  background: #0e7490 !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 0.84rem !important;
  border-top: 2px solid #0891b2 !important;
  box-shadow: 0 -6px 14px rgba(30, 58, 138, 0.22);
}

.page.sales-dash.assets-dash .assets-table tfoot .sales-grand-row td.assets-td-cost,
.assets-dash .assets-table tfoot .sales-grand-row td.assets-td-cost {
  background: #15803d !important;
  color: #fff !important;
}

.page.sales-dash.assets-dash .assets-table tfoot .sales-grand-row td.assets-td-depr,
.assets-dash .assets-table tfoot .sales-grand-row td.assets-td-depr {
  background: #c2410c !important;
  color: #fff !important;
}

.page.sales-dash.assets-dash .assets-table tfoot .sales-grand-row td.assets-td-book,
.assets-dash .assets-table tfoot .sales-grand-row td.assets-td-book {
  background: #6d28d9 !important;
  color: #fff !important;
}

.page.sales-dash.assets-dash .assets-table tfoot .sales-grand-row .mono,
.page.sales-dash.assets-dash .assets-table tfoot .sales-grand-row .money,
.page.sales-dash.assets-dash .assets-table tfoot .sales-grand-row .sar-symbol {
  color: #fff !important;
  font-weight: 800 !important;
}

@media (max-width: 1100px) {
  .assets-dash .assets-kpis.income-kpi-grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assets-structure-branch-duo,
  .assets-groups-top-duo {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .assets-dash .assets-kpis.income-kpi-grid-5 {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assets-top-row {
    animation: none;
  }
}

.sns-dash .sns-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sns-dash .sns-duo {
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.7fr);
  align-items: start;
}

.sns-dash .pr-vendors-wrap {
  max-height: min(70vh, 42rem);
}

.sns-dash .sns-table .pr-item {
  max-width: 16rem;
}

.sns-dash .sns-loader {
  margin: 0.4rem 0.6rem 0.6rem;
}

@media (max-width: 980px) {
  .sns-dash .sns-kpis {
    grid-template-columns: 1fr 1fr;
  }
}

/* أخطاء وحدات الأصناف — ترتيب الفلاتر */
.inv-pack-err-dash .inv-pack-err-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.65rem 0.85rem;
}

.inv-pack-err-dash .inv-pack-err-main {
  display: grid;
  grid-template-columns:
    minmax(14rem, 1.1fr)
    minmax(18rem, 1.5fr)
    minmax(20rem, 1.6fr)
    minmax(5.5rem, 0.7fr);
  align-items: end;
  gap: 0.55rem 0.7rem;
  flex: unset;
}

.inv-pack-err-dash .inv-pack-err-main .income-filter-field select,
.inv-pack-err-dash .inv-pack-err-main .income-filter-field input[type="date"],
.inv-pack-err-dash .inv-pack-err-main .income-filter-field input[type="number"] {
  width: 100%;
  min-width: 0;
  height: 2.05rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid #c5d5e8;
  border-radius: 8px;
  background: #fff;
  color: #12345f;
  font-size: 0.78rem;
  font-weight: 700;
}

.inv-pack-err-dash .inv-pack-err-main .income-filter-period-fields {
  width: 100%;
}

.inv-pack-err-dash .inv-pack-err-main .income-filter-period-fields .income-filter-field {
  flex: 1 1 0;
  min-width: 0;
}

.inv-pack-err-dash .inv-pack-err-branch-pair,
.inv-pack-err-dash .inv-pack-err-wh-pair {
  min-width: 0;
}

.inv-pack-err-dash .inv-pack-err-branch-pair select,
.inv-pack-err-dash .inv-pack-err-wh-pair select {
  min-width: 0;
  max-width: none;
}

.inv-pack-err-dash .inv-pack-err-actions {
  display: flex;
  align-items: end;
}

.inv-pack-err-dash .inv-pack-err-actions .income-filter-submit {
  white-space: nowrap;
}

.inv-pack-err-dash .inv-pack-err-table td .income-name-cell {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #47617f;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-pack-err-dash .inv-pack-err-kind {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(22, 74, 133, 0.08);
  color: #164a85;
  font-size: 0.72rem;
  font-weight: 800;
}

.inv-pack-err-dash .inv-pack-err-panel {
  overflow: hidden;
}

.inv-pack-err-dash .inv-pack-err-scroll {
  max-height: min(68vh, 42rem);
  overflow: auto;
  border: 1px solid #9eb6d4;
  border-radius: 10px;
  background: #fff;
}

.inv-pack-err-dash .inv-pack-err-scroll.table-wrap::after {
  display: none;
  content: none;
}

.page.sales-dash.inv-pack-err-dash .inv-pack-err-table,
.inv-pack-err-dash .inv-pack-err-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
}

.page.sales-dash.inv-pack-err-dash .inv-pack-err-table thead th,
.inv-pack-err-dash .inv-pack-err-table thead th {
  position: sticky;
  top: 0;
  z-index: 8;
  white-space: nowrap;
  font-weight: 800;
  padding: 0.55rem 0.55rem;
  border-bottom: 1px solid #8aa3c2;
  box-shadow: 0 1px 0 #8aa3c2;
  opacity: 1 !important;
  background: #dbe8f8 !important;
  background-color: #dbe8f8 !important;
  background-image: none !important;
  color: #12345f;
}

.page.sales-dash.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-buy,
.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-buy {
  background: #c8f0d8 !important;
  background-color: #c8f0d8 !important;
  color: #14532d;
}

.page.sales-dash.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-tr,
.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-tr {
  background: #ffd7b8 !important;
  background-color: #ffd7b8 !important;
  color: #9a3412;
}

.page.sales-dash.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-trno,
.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-trno {
  background: #ffedd5 !important;
  background-color: #ffedd5 !important;
  color: #9a3412;
}

.page.sales-dash.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-packdiff,
.page.sales-dash.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-qty,
.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-packdiff,
.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-qty {
  background: #fecaca !important;
  background-color: #fecaca !important;
  color: #991b1b;
}

.page.sales-dash.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-ratio,
.page.sales-dash.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-diff,
.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-ratio,
.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-diff {
  background: #fde68a !important;
  background-color: #fde68a !important;
  color: #854d0e;
}

.page.sales-dash.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-kind,
.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-kind {
  background: #ddd6fe !important;
  background-color: #ddd6fe !important;
  color: #5b21b6;
}

.page.sales-dash.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-base,
.page.sales-dash.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-base2,
.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-base,
.inv-pack-err-dash .inv-pack-err-table thead th.pe-th-base2 {
  background: #c7e0ff !important;
  background-color: #c7e0ff !important;
  color: #0e7490;
}

.inv-pack-err-dash .inv-pack-err-table th,
.inv-pack-err-dash .inv-pack-err-table td {
  border-inline-end: 1px solid #d5e1ef;
  border-bottom: 1px solid #e2ebf5;
  padding: 0.45rem 0.5rem;
  vertical-align: middle;
  white-space: nowrap;
}

.inv-pack-err-dash .inv-pack-err-table th:last-child,
.inv-pack-err-dash .inv-pack-err-table td:last-child {
  border-inline-end: 0;
}

.inv-pack-err-dash .inv-pack-err-table .pe-td-idx {
  color: #6b858f;
  text-align: center;
  width: 2.4rem;
}

.inv-pack-err-dash .inv-pack-err-table .pe-td-item {
  white-space: normal;
  min-width: 12rem;
  max-width: 18rem;
}

.inv-pack-err-dash .inv-pack-err-table .pe-item-name {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.74rem;
  color: #47617f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-pack-err-dash .inv-pack-err-table .pe-td-wh {
  white-space: normal;
  min-width: 8rem;
}

.inv-pack-err-dash .inv-pack-err-table .pe-td-wh span {
  display: block;
  color: #35567a;
  font-size: 0.74rem;
}

.inv-pack-err-dash .inv-pack-err-table .pe-td-buy {
  background: #ecfdf3;
  color: #166534;
  font-weight: 800;
}

.inv-pack-err-dash .inv-pack-err-table .pe-td-unit {
  color: #0891b2;
  font-weight: 800;
  white-space: nowrap;
}

.inv-pack-err-dash .inv-pack-err-table .pe-td-unit2 {
  color: #0891b2;
  font-weight: 700;
  white-space: nowrap;
}

.inv-pack-err-dash .inv-pack-err-table .pe-td-trno {
  color: #9a3412;
  font-weight: 700;
  max-width: 9.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
}

.inv-pack-err-dash .inv-pack-err-table .pe-trno-link {
  color: #9a3412;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.inv-pack-err-dash .inv-pack-err-table .pe-trno-link:hover {
  color: #7c2d12;
}

.inv-pack-err-dash .inv-pack-err-table .pe-td-packdiff,
.inv-pack-err-dash .inv-pack-err-table .pe-td-qty {
  background: #fef2f2;
  color: #991b1b;
  font-weight: 800;
}

.inv-pack-err-dash .inv-pack-err-table .pe-td-tr {
  background: #fff7ed;
  color: #9a3412;
  font-weight: 800;
}

.inv-pack-err-dash .inv-pack-err-table .pe-td-ratio,
.inv-pack-err-dash .inv-pack-err-table .pe-td-diff {
  background: #fffbeb;
  color: #854d0e;
  font-weight: 800;
}

.inv-pack-err-dash .inv-pack-err-table tr.is-up .pe-td-diff {
  background: #fee2e2;
  color: #b91c1c;
}

.inv-pack-err-dash .inv-pack-err-table tr.is-down .pe-td-diff {
  background: #dcfce7;
  color: #15803d;
}

.inv-pack-err-dash .inv-pack-err-table .pe-td-base {
  background: #f7fcfd;
  color: #0891b2;
  font-weight: 800;
}

.inv-pack-err-dash .inv-pack-err-table .pe-td-base2 {
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 800;
}

.inv-pack-err-dash .inv-pack-err-table tr.is-even td {
  filter: saturate(0.96);
}

.inv-pack-err-dash .inv-pack-err-table tr.is-even .pe-td-buy {
  background: #dcfce7;
}

.inv-pack-err-dash .inv-pack-err-table tr.is-even .pe-td-tr {
  background: #ffedd5;
}

.inv-pack-err-dash .inv-pack-err-kind.is-qty {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
}

.inv-pack-err-dash .inv-pack-err-kind.is-pack {
  background: rgba(2, 132, 199, 0.12);
  color: #06b6d4;
}

@media (max-width: 1100px) {
  .inv-pack-err-dash .inv-pack-err-filter {
    grid-template-columns: 1fr;
  }

  .inv-pack-err-dash .inv-pack-err-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inv-pack-err-dash .inv-pack-err-main .income-filter-period {
    grid-column: 1 / -1;
  }

  .inv-pack-err-dash .inv-pack-err-actions {
    justify-content: stretch;
  }

  .inv-pack-err-dash .inv-pack-err-actions .income-filter-submit {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .inv-pack-err-dash .inv-pack-err-main {
    grid-template-columns: 1fr;
  }
}

.inv-pack-err-dash .inv-pack-err-print-btn {
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  html,
  body {
    background: #fff !important;
    color: #111 !important;
  }

  body.sales-dash-body .sidebar,
  body.sales-dash-body .topbar,
  body.sales-dash-body .sidebar-toggle,
  .inv-pack-err-dash .income-filter-bar,
  .inv-pack-err-dash .alert,
  .inv-pack-err-dash .inv-pack-err-print-btn {
    display: none !important;
  }

  .page.has-sidebar {
    padding: 0 !important;
    margin: 0 !important;
  }

  .page.has-sidebar main,
  .inv-pack-err-dash main {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .inv-pack-err-dash .dash-head {
    margin-bottom: 0.6rem;
    padding: 0;
  }

  .inv-pack-err-dash .dash-head h2 {
    font-size: 1.15rem;
    color: #111 !important;
  }

  .inv-pack-err-dash .dash-head p {
    color: #333 !important;
  }

  .inv-pack-err-dash .inv-pack-err-panel {
    break-inside: auto;
    box-shadow: none !important;
    border: 1px solid #c5d0de !important;
    background: #fff !important;
  }

  .inv-pack-err-dash .dash-panel-head {
    background: #f7fcfd !important;
    border-bottom: 1px solid #c5d0de !important;
    padding: 0.4rem 0.55rem;
  }

  .inv-pack-err-dash .dash-panel-head h3 {
    color: #111 !important;
  }

  .inv-pack-err-dash .inv-pack-err-scroll {
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .inv-pack-err-dash .inv-pack-err-table {
    font-size: 0.65rem;
  }

  .inv-pack-err-dash .inv-pack-err-table thead th {
    position: static !important;
    background: #dbe8f8 !important;
    color: #12345f !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .inv-pack-err-dash .inv-pack-err-table th,
  .inv-pack-err-dash .inv-pack-err-table td {
    border: 1px solid #c5d0de !important;
    padding: 0.25rem 0.3rem;
  }

  .inv-pack-err-dash .inv-pack-err-table .pe-td-buy,
  .inv-pack-err-dash .inv-pack-err-table .pe-td-tr,
  .inv-pack-err-dash .inv-pack-err-table .pe-td-diff,
  .inv-pack-err-dash .inv-pack-err-table .pe-td-base,
  .inv-pack-err-dash .inv-pack-err-table .pe-td-base2 {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* توزيع مصاريف المستودع */
.wh-exp-dash .wh-exp-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.65rem 0.85rem;
}

.wh-exp-dash .wh-exp-main {
  display: grid;
  grid-template-columns:
    minmax(14rem, 1.2fr)
    minmax(9rem, 0.9fr)
    minmax(6.5rem, 0.7fr)
    minmax(8rem, 0.85fr)
    minmax(7rem, 0.75fr);
  align-items: end;
  gap: 0.55rem 0.7rem;
  flex: unset;
}

.wh-exp-dash .wh-exp-main .income-filter-field select,
.wh-exp-dash .wh-exp-main .income-filter-field input[type="date"],
.wh-exp-dash .wh-exp-main .income-filter-field input[type="number"],
.wh-exp-dash .wh-exp-main .income-filter-field input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 2.05rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid #c5d5e8;
  border-radius: 8px;
  background: #fff;
  color: #12345f;
  font-size: 0.78rem;
  font-weight: 700;
}

.wh-exp-dash .wh-exp-main .income-filter-period-fields {
  width: 100%;
}

.wh-exp-dash .wh-exp-main .income-filter-period-fields .income-filter-field {
  flex: 1 1 0;
  min-width: 0;
}

.wh-exp-dash .wh-exp-actions {
  display: flex;
  align-items: end;
}

.wh-exp-dash .wh-exp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0 0 0.9rem;
}

.wh-exp-dash .wh-exp-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(180, 205, 230, 0.85);
  background: rgba(255, 255, 255, 0.88);
}

.wh-exp-dash .wh-exp-kpi-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #5d738c;
}

.wh-exp-dash .wh-exp-kpi-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 8px;
  flex-shrink: 0;
  color: #fff;
}

.wh-exp-dash .wh-exp-kpi-ico svg {
  width: 0.78rem;
  height: 0.78rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wh-exp-dash .wh-exp-kpi.is-count .wh-exp-kpi-ico {
  background: linear-gradient(145deg, #38bdf8, #0284c7);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.28);
}

.wh-exp-dash .wh-exp-kpi.is-amt .wh-exp-kpi-ico {
  background: linear-gradient(145deg, #4ade80, #16a34a);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.28);
}

.wh-exp-dash .wh-exp-kpi.is-qty .wh-exp-kpi-ico {
  background: linear-gradient(145deg, #fbbf24, #d97706);
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.28);
}

.wh-exp-dash .wh-exp-kpi.is-alloc .wh-exp-kpi-ico {
  background: linear-gradient(145deg, #c4b5fd, #7c3aed);
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.28);
}

.wh-exp-dash .wh-exp-kpi strong {
  font-size: 1.2rem;
  color: #16324f;
}

.wh-exp-dash .wh-exp-kpi small {
  font-size: 0.72rem;
  color: #6b858f;
}

.wh-exp-dash .wh-exp-kpi.is-count {
  border-color: rgba(14, 116, 144, 0.28);
  background: linear-gradient(145deg, #ecfeff, #f8fafc);
}

.wh-exp-dash .wh-exp-kpi.is-amt {
  border-color: rgba(22, 163, 74, 0.28);
  background: linear-gradient(145deg, #ecfdf3, #f8fafc);
}

.wh-exp-dash .wh-exp-kpi.is-qty {
  border-color: rgba(217, 119, 6, 0.28);
  background: linear-gradient(145deg, #fff7ed, #f8fafc);
}

.wh-exp-dash .wh-exp-kpi.is-alloc {
  border-color: rgba(124, 58, 237, 0.28);
  background: linear-gradient(145deg, #f5f3ff, #f8fafc);
}

.wh-exp-dash .wh-exp-kpi.is-action {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.wh-exp-dash .wh-exp-kpi.is-action:hover,
.wh-exp-dash .wh-exp-kpi.is-action:focus-visible {
  border-color: rgba(109, 40, 217, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16);
  outline: none;
}

.wh-exp-dash .wh-exp-kpi.is-action.is-open {
  border-color: rgba(91, 33, 182, 0.65);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.22);
}

.wh-exp-dash .wh-exp-accounts-panel.is-collapsed {
  display: none;
}

.wh-exp-dash .wh-exp-excel-btn {
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.wh-exp-dash .wh-exp-table .we-th-code,
.wh-exp-dash .wh-exp-table .we-td-code {
  width: 1%;
  white-space: nowrap;
  color: #5b21b6;
  font-weight: 800;
}

.wh-exp-dash .wh-exp-table tfoot .wh-exp-tfoot td {
  background: #ede9fe;
  color: #4c1d95;
  font-weight: 800;
  border-top: 2px solid #8b5cf6;
  position: sticky;
  bottom: 0;
  z-index: 6;
}

.wh-exp-dash .wh-exp-panel {
  overflow: hidden;
}

.wh-exp-dash .wh-exp-scroll {
  max-height: min(58vh, 36rem);
  overflow: auto;
  border: 1px solid #9eb6d4;
  border-radius: 10px;
  background: #fff;
}

.wh-exp-dash .wh-exp-scroll.table-wrap::after {
  display: none;
  content: none;
}

.page.sales-dash.wh-exp-dash .wh-exp-table,
.wh-exp-dash .wh-exp-table {
  width: max-content;
  min-width: 0;
  max-width: none;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
  table-layout: auto;
}

.page.sales-dash.wh-exp-dash .wh-exp-table thead th,
.wh-exp-dash .wh-exp-table thead th {
  position: sticky;
  top: 0;
  z-index: 8;
  white-space: nowrap;
  font-weight: 800;
  padding: 0.55rem 0.55rem;
  border-bottom: 1px solid #8aa3c2;
  box-shadow: 0 1px 0 #8aa3c2;
  opacity: 1 !important;
  background: #dbe8f8 !important;
  background-color: #dbe8f8 !important;
  background-image: none !important;
  color: #12345f;
}

.page.sales-dash.wh-exp-dash .wh-exp-table thead th.we-th-count,
.wh-exp-dash .wh-exp-table thead th.we-th-count {
  background: #cffafe !important;
  background-color: #cffafe !important;
  color: #155e75;
}

.page.sales-dash.wh-exp-dash .wh-exp-table thead th.we-th-amt,
.wh-exp-dash .wh-exp-table thead th.we-th-amt {
  background: #c8f0d8 !important;
  background-color: #c8f0d8 !important;
  color: #14532d;
}

.page.sales-dash.wh-exp-dash .wh-exp-table thead th.we-th-qty,
.wh-exp-dash .wh-exp-table thead th.we-th-qty {
  background: #ffd7b8 !important;
  background-color: #ffd7b8 !important;
  color: #9a3412;
}

.page.sales-dash.wh-exp-dash .wh-exp-table thead th.we-th-share,
.wh-exp-dash .wh-exp-table thead th.we-th-share {
  background: #fde68a !important;
  background-color: #fde68a !important;
  color: #854d0e;
}

.page.sales-dash.wh-exp-dash .wh-exp-table thead th.we-th-alloc,
.wh-exp-dash .wh-exp-table thead th.we-th-alloc {
  background: #ddd6fe !important;
  background-color: #ddd6fe !important;
  color: #5b21b6;
}

.page.sales-dash.wh-exp-dash .wh-exp-table thead th.we-th-from,
.wh-exp-dash .wh-exp-table thead th.we-th-from {
  background: #ffd7b8 !important;
  background-color: #ffd7b8 !important;
  color: #9a3412;
}

.page.sales-dash.wh-exp-dash .wh-exp-table thead th.we-th-to,
.wh-exp-dash .wh-exp-table thead th.we-th-to {
  background: #c8f0d8 !important;
  background-color: #c8f0d8 !important;
  color: #14532d;
}

.wh-exp-dash .wh-exp-table th,
.wh-exp-dash .wh-exp-table td {
  border-inline-end: 1px solid #d5e1ef;
  border-bottom: 1px solid #e2ebf5;
  padding: 0.45rem 0.5rem;
  vertical-align: middle;
  white-space: nowrap;
}

.wh-exp-dash .wh-exp-table th:last-child,
.wh-exp-dash .wh-exp-table td:last-child {
  border-inline-end: 0;
}

.wh-exp-dash .wh-exp-table .we-td-idx {
  color: #6b858f;
  text-align: center;
  width: 2.4rem;
}

.wh-exp-dash .wh-exp-table .we-td-branch,
.wh-exp-dash .wh-exp-table .we-th-branch {
  white-space: nowrap;
  width: 1%;
  max-width: 16rem;
  color: #12345f;
  font-weight: 800;
  font-size: 0.86rem;
  line-height: 1.35;
}

.wh-exp-dash .wh-exp-table .we-td-branch {
  white-space: normal;
  overflow-wrap: anywhere;
}

.wh-exp-dash .wh-exp-table .we-td-branch span {
  display: inline;
  margin: 0;
  font-size: inherit;
  color: inherit;
  font-weight: inherit;
}

.wh-exp-dash .wh-exp-table .we-th-idx,
.wh-exp-dash .wh-exp-table .we-td-idx,
.wh-exp-dash .wh-exp-table .we-th-count,
.wh-exp-dash .wh-exp-table .we-td-count,
.wh-exp-dash .wh-exp-table .we-th-amt,
.wh-exp-dash .wh-exp-table .we-td-amt,
.wh-exp-dash .wh-exp-table .we-th-qty,
.wh-exp-dash .wh-exp-table .we-td-qty,
.wh-exp-dash .wh-exp-table .we-th-share,
.wh-exp-dash .wh-exp-table .we-td-share,
.wh-exp-dash .wh-exp-table .we-th-alloc,
.wh-exp-dash .wh-exp-table .we-td-alloc,
.wh-exp-dash .wh-exp-table .we-th-date,
.wh-exp-dash .wh-exp-table .we-td-date,
.wh-exp-dash .wh-exp-table .we-th-ser,
.wh-exp-dash .wh-exp-table .we-td-ser,
.wh-exp-dash .wh-exp-table .we-th-from,
.wh-exp-dash .wh-exp-table .we-td-from,
.wh-exp-dash .wh-exp-table .we-th-to,
.wh-exp-dash .wh-exp-table .we-td-to {
  width: 1%;
  white-space: nowrap;
}

.wh-exp-dash .wh-exp-table .we-td-count {
  background: #ecfeff;
  color: #0e7490;
  font-weight: 800;
}

.wh-exp-dash .wh-exp-table .we-td-amt {
  background: #ecfdf3;
  color: #166534;
  font-weight: 800;
}

.wh-exp-dash .wh-exp-table .we-td-amt .money {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: inherit;
  font-weight: inherit;
}

.wh-exp-dash .wh-exp-table .we-td-amt .money-value {
  color: #166534;
}

.wh-exp-dash .wh-exp-table .we-td-amt .sar-symbol {
  width: 0.78em;
  height: 0.88em;
  color: #0ea5e9;
  flex-shrink: 0;
}

.wh-exp-dash .wh-exp-table .we-td-qty {
  background: #fff7ed;
  color: #9a3412;
  font-weight: 800;
}

.wh-exp-dash .wh-exp-table .we-td-share {
  background: #fffbeb;
  color: #854d0e;
  font-weight: 800;
}

.wh-exp-dash .wh-exp-table .we-td-alloc {
  background: #f5f3ff;
  color: #5b21b6;
  font-weight: 800;
}

.wh-exp-dash .wh-exp-table .we-td-from {
  background: #fff7ed;
  color: #9a3412;
  font-weight: 800;
}

.wh-exp-dash .wh-exp-table .we-td-to {
  background: #ecfdf3;
  color: #166534;
  font-weight: 800;
}

.wh-exp-dash .wh-exp-table tr.is-even .we-td-count {
  background: #cffafe;
}

.wh-exp-dash .wh-exp-table tr.is-even .we-td-amt {
  background: #dcfce7;
}

.wh-exp-dash .wh-exp-table tr.is-even .we-td-qty {
  background: #ffedd5;
}

.wh-exp-dash .wh-exp-table tr.is-even .we-td-share {
  background: #fef3c7;
}

.wh-exp-dash .wh-exp-table tr.is-even .we-td-alloc {
  background: #ede9fe;
}

.wh-exp-dash .wh-exp-table tr.is-even .we-td-from {
  background: #ffedd5;
}

.wh-exp-dash .wh-exp-table tr.is-even .we-td-to {
  background: #dcfce7;
}

@media (max-width: 1100px) {
  .wh-exp-dash .wh-exp-filter {
    grid-template-columns: 1fr;
  }

  .wh-exp-dash .wh-exp-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wh-exp-dash .wh-exp-main .income-filter-period {
    grid-column: 1 / -1;
  }

  .wh-exp-dash .wh-exp-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .wh-exp-dash .wh-exp-actions .income-filter-submit {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .wh-exp-dash .wh-exp-main,
  .wh-exp-dash .wh-exp-kpi-grid {
    grid-template-columns: 1fr;
  }
}

.wh-exp-dash .wh-exp-print-btn {
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.wh-exp-dash .wh-exp-src-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.wh-exp-dash .wh-exp-src-filter select {
  min-width: 11rem;
  max-width: 16rem;
  height: 2rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid #c5d5e8;
  border-radius: 8px;
  background: #fff;
  color: #12345f;
  font-size: 0.74rem;
  font-weight: 700;
}

.wh-exp-dash .wh-exp-src-filter .btn-primary {
  min-height: 2rem;
  padding: 0.2rem 0.7rem;
  font-size: 0.74rem;
  border-radius: 8px;
  white-space: nowrap;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  html,
  body {
    background: #fff !important;
    color: #111 !important;
  }

  body.sales-dash-body .sidebar,
  body.sales-dash-body .topbar,
  body.sales-dash-body .sidebar-toggle,
  .wh-exp-dash .income-filter-bar,
  .wh-exp-dash .alert,
  .wh-exp-dash .wh-exp-print-btn,
  .wh-exp-dash .wh-exp-excel-btn,
  .wh-exp-dash .wh-exp-src-filter {
    display: none !important;
  }

  .page.has-sidebar {
    padding: 0 !important;
    margin: 0 !important;
  }

  .page.has-sidebar main,
  .wh-exp-dash main {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .wh-exp-dash .dash-head {
    margin-bottom: 0.6rem;
    padding: 0;
  }

  .wh-exp-dash .dash-head h2 {
    font-size: 1.15rem;
    color: #111 !important;
  }

  .wh-exp-dash .dash-head p {
    color: #333 !important;
  }

  .wh-exp-dash .wh-exp-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.7rem;
    break-inside: avoid;
  }

  .wh-exp-dash .wh-exp-kpi {
    border: 1px solid #c5d0de !important;
    background: #fff !important;
    border-radius: 6px;
    padding: 0.45rem 0.55rem;
    box-shadow: none !important;
  }

  .wh-exp-dash .wh-exp-kpi span,
  .wh-exp-dash .wh-exp-kpi small {
    color: #444 !important;
  }

  .wh-exp-dash .wh-exp-kpi strong {
    color: #111 !important;
    font-size: 0.95rem;
  }

  .wh-exp-dash .wh-exp-panel {
    break-inside: auto;
    box-shadow: none !important;
    border: 1px solid #c5d0de !important;
    background: #fff !important;
    margin-bottom: 0.75rem;
  }

  .wh-exp-dash .dash-panel-head {
    background: #f7fcfd !important;
    border-bottom: 1px solid #c5d0de !important;
    padding: 0.4rem 0.55rem;
  }

  .wh-exp-dash .dash-panel-head h3 {
    color: #111 !important;
  }

  .wh-exp-dash .wh-exp-scroll {
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
  }

  .wh-exp-dash .wh-exp-table {
    font-size: 0.68rem;
  }

  .wh-exp-dash .wh-exp-table thead th {
    position: static !important;
    background: #dbe8f8 !important;
    color: #12345f !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .wh-exp-dash .wh-exp-table th,
  .wh-exp-dash .wh-exp-table td {
    border: 1px solid #c5d0de !important;
    padding: 0.28rem 0.35rem;
  }

  .wh-exp-dash .wh-exp-table .we-td-count,
  .wh-exp-dash .wh-exp-table .we-td-amt,
  .wh-exp-dash .wh-exp-table .we-td-qty,
  .wh-exp-dash .wh-exp-table .we-td-share,
  .wh-exp-dash .wh-exp-table .we-td-alloc,
  .wh-exp-dash .wh-exp-table .we-td-from,
  .wh-exp-dash .wh-exp-table .we-td-to {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.fit-printing[data-print-scope="wh-exp-cc"] .wh-exp-branches-panel,
  body.fit-printing[data-print-scope="wh-exp-cc"] .wh-exp-kpi-grid {
    display: none !important;
  }

  body.fit-printing[data-print-scope="wh-exp-cc"] .wh-exp-accounts-panel {
    display: block !important;
  }

  body.fit-printing[data-print-scope="wh-exp-cc"] .wh-exp-accounts-panel[hidden],
  body.fit-printing[data-print-scope="wh-exp-cc"] .wh-exp-accounts-panel.is-collapsed {
    display: block !important;
  }

  body.fit-printing[data-print-scope="wh-exp-branches"] .wh-exp-accounts-panel {
    display: none !important;
  }
}

/* أسعار بنسبة ربح منخفضة */
.low-margin-dash > main {
  max-width: 100%;
  overflow-x: clip;
}

.low-margin-dash .low-margin-filter {
  display: grid;
  grid-template-columns:
    minmax(0, 1.2fr)
    minmax(0, 1.25fr)
    minmax(0, 1.2fr)
    minmax(0, 4.2rem)
    minmax(0, 4.2rem)
    minmax(0, 4.2rem)
    minmax(0, 7rem)
    minmax(0, 1fr)
    auto;
  gap: 0.6rem 0.7rem;
  align-items: end;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
}

.low-margin-dash .low-margin-filter .field {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.low-margin-dash .low-margin-filter label {
  color: #294f78;
  font-size: 0.7rem;
  font-weight: 800;
}

.low-margin-dash .low-margin-filter input,
.low-margin-dash .low-margin-filter select {
  width: 100%;
  min-width: 0;
  min-height: 2.2rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #c9d9eb;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: #183d66;
  font-size: 0.76rem;
}

.low-margin-dash .low-margin-filter .lm-req {
  color: #b45309;
  font-weight: 800;
}

.low-margin-dash .low-margin-filter .lm-opt {
  font-weight: 400;
  opacity: 0.65;
  font-size: 0.85em;
}

.low-margin-dash .low-margin-filter .lm-field-actions {
  align-self: end;
}

.low-margin-dash .low-margin-filter .lm-field-actions .btn-primary {
  width: 100%;
  min-width: 7.5rem;
  min-height: 2.2rem;
  white-space: nowrap;
}

.low-margin-dash .low-margin-filter #lm-branch,
.low-margin-dash .low-margin-filter #lm-wh {
  text-overflow: ellipsis;
}

.low-margin-dash .low-margin-filter #lm-min,
.low-margin-dash .low-margin-filter #lm-max,
.low-margin-dash .low-margin-filter #lm-lev {
  text-align: center;
}

.low-margin-dash .lm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0 0 0.75rem;
}

.low-margin-dash .lm-kpi {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid transparent;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.low-margin-dash .lm-kpi::before {
  content: "";
  position: absolute;
  inset: -35% auto auto -18%;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, transparent 68%);
  pointer-events: none;
}

.low-margin-dash .lm-kpi-label,
.low-margin-dash .lm-kpi-value,
.low-margin-dash .lm-kpi-hint,
.low-margin-dash .lm-kpi-ico {
  position: relative;
  z-index: 1;
}

.low-margin-dash .lm-kpi-label {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.low-margin-dash .lm-kpi-ico {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.low-margin-dash .lm-kpi-ico svg {
  width: 0.92rem;
  height: 0.92rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.low-margin-dash .lm-kpi-value {
  font-size: 1.35rem;
  line-height: 1.15;
  font-weight: 700;
}

.low-margin-dash .lm-kpi-hint {
  font-size: 0.68rem;
  line-height: 1.35;
  font-weight: 500;
}

.low-margin-dash .lm-kpi.is-match {
  background: linear-gradient(135deg, #0891b2 0%, #06b6d4 55%, #06b6d4 100%);
  border-color: #0891b2;
}

.low-margin-dash .lm-kpi.is-match .lm-kpi-label { color: #ecfeff; }
.low-margin-dash .lm-kpi.is-match .lm-kpi-value { color: #fff; }
.low-margin-dash .lm-kpi.is-match .lm-kpi-hint { color: #e0f7fa; }

.low-margin-dash .lm-kpi.is-shown {
  background: linear-gradient(135deg, #047857 0%, #059669 55%, #10b981 100%);
  border-color: #059669;
}

.low-margin-dash .lm-kpi.is-shown .lm-kpi-label { color: #bbf7d0; }
.low-margin-dash .lm-kpi.is-shown .lm-kpi-value { color: #fff; }
.low-margin-dash .lm-kpi.is-shown .lm-kpi-hint { color: #86efac; }

.low-margin-dash .lm-kpi.is-limit {
  background: linear-gradient(135deg, #b45309 0%, #d97706 55%, #f59e0b 100%);
  border-color: #d97706;
}

.low-margin-dash .lm-kpi.is-limit .lm-kpi-label { color: #fde68a; }
.low-margin-dash .lm-kpi.is-limit .lm-kpi-value { color: #fff; }
.low-margin-dash .lm-kpi.is-limit .lm-kpi-hint { color: #fcd34d; }

.low-margin-dash .low-margin-filter {
  margin-top: 0;
}

.low-margin-dash .lm-sheet {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border: 1px solid #9e9e9e;
}

.low-margin-dash .lm-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.55rem;
  background: #ececec;
  border-bottom: 1px solid #9e9e9e;
}

.low-margin-dash .lm-sheet-title {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
}

.low-margin-dash .lm-sheet-head h3 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #1a2b33;
}

.low-margin-dash .lm-sheet-count {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: #475569;
}

.low-margin-dash .lm-sheet-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.low-margin-dash .lm-excel-btn,
.low-margin-dash .lm-pdf-btn {
  min-width: 4.2rem;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.2;
}

.low-margin-dash .lm-scroll {
  max-height: min(72vh, 780px);
  overflow: auto;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #6b858f #e2e8f0;
}

.low-margin-dash .lm-scroll::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.low-margin-dash .lm-scroll::-webkit-scrollbar-thumb {
  background: #6b858f;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
}

.low-margin-dash .lm-scroll::-webkit-scrollbar-track {
  background: #e2e8f0;
}

.low-margin-dash .lm-scroll.has-x-scroll,
.low-margin-dash .lm-scroll.has-y-scroll {
  box-shadow: inset -3px -3px 0 #cbd5e1;
}

.low-margin-dash .lm-scroll.table-wrap {
  border-radius: 0;
  box-shadow: none;
  border: 0;
  padding: 0;
  margin: 0;
}

.low-margin-dash .lm-scroll.table-wrap::after {
  display: none;
  content: none;
}

.low-margin-dash .lm-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: auto;
  background: #fff;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 12px;
  color: #111;
}

.low-margin-dash .lm-table col.col-idx { width: 2.4rem; }
.low-margin-dash .lm-table col.col-code { width: 5rem; }
.low-margin-dash .lm-table col.col-item { width: 14rem; }
.low-margin-dash .lm-table col.col-barcode { width: 9rem; }
.low-margin-dash .lm-table col.col-unit { width: 3.5rem; }
.low-margin-dash .lm-table col.col-wh { width: 3.5rem; }
.low-margin-dash .lm-table col.col-group { width: 8rem; }
.low-margin-dash .lm-table col.col-cost { width: 6rem; }
.low-margin-dash .lm-table col.col-price { width: 5rem; }
.low-margin-dash .lm-table col.col-prft { width: 5.5rem; }
.low-margin-dash .lm-table col.col-onixprft { width: 5.5rem; }
.low-margin-dash .lm-table col.col-lev { width: 3rem; }
.low-margin-dash .lm-table col.col-levn { width: 8rem; }

.low-margin-dash .lm-table thead th,
.low-margin-dash .lm-table tbody td {
  margin: 0;
  padding: 3px 6px;
  border: 1px solid #b0b0b0;
  vertical-align: middle;
  text-align: right;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.low-margin-dash .lm-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #d9e2f3;
  color: #1a2b33;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: inset 0 -1px 0 #9e9e9e;
}

.low-margin-dash .lm-table thead th.lm-th-cost {
  background: #c6efce;
  color: #14532d;
}

.low-margin-dash .lm-table thead th.lm-th-price {
  background: #dce8fb;
  color: #1a4b8c;
}

.low-margin-dash .lm-table thead th.lm-th-barcode {
  background: #ede9fe;
  color: #5b21b6;
}

.low-margin-dash .lm-table thead th.lm-th-prft {
  background: #fde8d8;
  color: #9a3412;
}

.low-margin-dash .lm-table tbody tr:nth-child(even) td {
  background: #f7f7f7;
}

/* —— تحديد صف الجدول + أسهم الكيبورد (كل الموقع) —— */
table tbody tr.is-selected > td {
  background: #cffafe !important;
  color: #0e7490 !important;
  outline: none;
  box-shadow: none;
  border-bottom-color: #67e8f9;
}
table tbody tr.is-selected > td:first-child {
  box-shadow: inset -3px 0 0 #0891b2;
}

table tbody tr.is-selected > td .lm-td-cost,
table tbody tr.is-selected .lm-td-cost,
table tbody tr.is-selected .wh-out-td-status.is-ok,
table tbody tr.is-selected .wh-out-td-status.is-pending,
table tbody tr.is-selected .wh-out-td-status.is-late {
  filter: brightness(0.95);
}

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

.low-margin-dash .lm-table tbody tr:hover td {
  background: #fff6d5;
}

.low-margin-dash .lm-table .lm-td-prft,
.low-margin-dash .lm-table .lm-td-onixprft,
.low-margin-dash .lm-table .lm-td-lev {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.low-margin-dash .lm-table .lm-td-idx,
.low-margin-dash .lm-table .lm-td-code,
.low-margin-dash .lm-table .lm-td-wh,
.low-margin-dash .lm-table .lm-td-cost,
.low-margin-dash .lm-table .lm-td-price {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.low-margin-dash .lm-table .lm-td-code {
  direction: ltr;
  font-weight: 600;
  color: #4338ca;
}

.low-margin-dash .lm-table .lm-td-item {
  max-width: 14rem;
  color: #1a2b33;
  font-weight: 600;
}

.low-margin-dash .lm-table .lm-td-barcode {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: #f3e8ff;
  color: #7c3aed;
}

.low-margin-dash .lm-table .lm-td-group {
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #3d5560;
}

.low-margin-dash .lm-table .lm-td-levn {
  color: #0891b2;
}

.low-margin-dash .lm-table .lm-td-cost {
  background: #e8faf5;
  color: #0891b2;
  font-weight: 700;
}

.low-margin-dash .lm-table .lm-td-price {
  background: #e8f0fe;
  color: #0891b2;
  font-weight: 700;
}

.low-margin-dash .lm-table .lm-td-prft,
.low-margin-dash .lm-table .lm-td-onixprft {
  text-align: center;
  font-weight: 700;
}

.low-margin-dash .lm-table .lm-td-onixprft {
  color: #6d28d9;
  background: #f5f3ff;
}

.low-margin-dash .lm-table .lm-td-prft {
  background: #fff4e8;
  color: #c2410c;
  font-weight: 700;
}

.low-margin-dash .lm-table tr.is-ok .lm-td-prft {
  background: #c6efce;
  color: #14532d;
}

.low-margin-dash .lm-table tr.is-mid .lm-td-prft {
  background: #ffeb9c;
  color: #854d0e;
}

.low-margin-dash .lm-table tr.is-warn .lm-td-prft {
  background: #ffc7ce;
  color: #991b1b;
}

.low-margin-dash .lm-table tr.is-loss .lm-td-prft {
  background: #f4cccc;
  color: #7f1d1d;
}

.low-margin-dash .lm-table tbody tr:nth-child(even) .lm-td-cost {
  background: #dff7f0;
}

.low-margin-dash .lm-table tbody tr:nth-child(even) .lm-td-price {
  background: #dce8fb;
}

.low-margin-dash .lm-table tbody tr:nth-child(even) .lm-td-barcode {
  background: #e9d5ff;
}

.low-margin-dash .lm-table tbody tr:nth-child(even).is-ok .lm-td-prft {
  background: #b7e1cd;
}

.low-margin-dash .lm-table tbody tr:nth-child(even).is-mid .lm-td-prft {
  background: #ffe599;
}

.low-margin-dash .lm-table tbody tr:nth-child(even).is-warn .lm-td-prft {
  background: #f8cbad;
}

.low-margin-dash .lm-table tbody tr:nth-child(even).is-loss .lm-td-prft {
  background: #e6b8b7;
}

.low-margin-dash .lm-loader {
  padding: 0.35rem 0.55rem;
  text-align: center;
  color: #475569;
  font-size: 0.78rem;
  border-top: 1px solid #b0b0b0;
  background: #f8fafc;
}

/* طباعة PDF: ضغط كل الأعمدة بعرض صفحة واحدة (ملاءمة Excel) */
@media print {
  @page {
    size: A4 landscape;
    margin: 6mm;
  }

  html,
  body {
    background: #fff !important;
    color: #111 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.sales-dash-body .sidebar,
  body.sales-dash-body .topbar,
  body.sales-dash-body .sidebar-toggle,
  .low-margin-dash .dash-head,
  .low-margin-dash .low-margin-filter,
  .low-margin-dash .lm-kpi-grid,
  .low-margin-dash .lm-sheet-actions,
  .low-margin-dash .lm-excel-btn,
  .low-margin-dash .lm-pdf-btn,
  .low-margin-dash .lm-loader,
  .low-margin-dash .alert {
    display: none !important;
  }

  .page.has-sidebar.low-margin-dash,
  .low-margin-dash.page.has-sidebar {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    overflow: visible !important;
  }

  .low-margin-dash > main {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .low-margin-dash .lm-sheet {
    box-shadow: none !important;
    border: 0 !important;
    background: #fff !important;
    break-inside: auto;
    overflow: visible !important;
    width: 100% !important;
  }

  .low-margin-dash .lm-sheet-head {
    padding: 2px 4px;
    border-bottom: 1px solid #b0b0b0 !important;
    background: #f7fcfd !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .low-margin-dash .lm-sheet-head h3 {
    color: #111 !important;
    font-size: 10pt;
    margin: 0;
  }

  .low-margin-dash .lm-sheet-count {
    color: #333 !important;
    font-size: 8pt;
  }

  .low-margin-dash .lm-scroll,
  .low-margin-dash .lm-scroll.table-wrap,
  #lm-wrap {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
  }

  .low-margin-dash .lm-scroll.table-wrap::after {
    display: none !important;
    content: none !important;
  }

  /* كل الأعمدة تُضغط ضمن عرض الصفحة */
  .low-margin-dash .lm-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 6.5px !important;
    color: #111 !important;
  }

  .low-margin-dash .lm-table col.col-idx { width: 3% !important; }
  .low-margin-dash .lm-table col.col-code { width: 7% !important; }
  .low-margin-dash .lm-table col.col-item { width: 18% !important; }
  .low-margin-dash .lm-table col.col-barcode { width: 10% !important; }
  .low-margin-dash .lm-table col.col-unit { width: 5% !important; }
  .low-margin-dash .lm-table col.col-wh { width: 5% !important; }
  .low-margin-dash .lm-table col.col-group { width: 10% !important; }
  .low-margin-dash .lm-table col.col-cost { width: 8% !important; }
  .low-margin-dash .lm-table col.col-price { width: 9% !important; }
  .low-margin-dash .lm-table col.col-prft { width: 6% !important; }
  .low-margin-dash .lm-table col.col-onixprft { width: 6% !important; }
  .low-margin-dash .lm-table col.col-lev { width: 4% !important; }
  .low-margin-dash .lm-table col.col-levn { width: 9% !important; }

  .low-margin-dash .lm-table thead {
    display: table-header-group;
  }

  .low-margin-dash .lm-table tbody {
    display: table-row-group;
  }

  .low-margin-dash .lm-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .low-margin-dash .lm-table thead th {
    position: static !important;
    background: #dbe8f8 !important;
    color: #12345f !important;
    font-weight: 700;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .low-margin-dash .lm-table thead th,
  .low-margin-dash .lm-table tbody td {
    border: 1px solid #b0b0b0 !important;
    padding: 1px 2px !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: none !important;
    line-height: 1.15 !important;
    font-size: inherit !important;
  }

  .low-margin-dash .lm-table .lm-td-item,
  .low-margin-dash .lm-table .lm-td-group,
  .low-margin-dash .lm-table .lm-td-levn,
  .low-margin-dash .lm-table .lm-td-barcode {
    white-space: nowrap !important;
  }

  .low-margin-dash .lm-table .lm-td-cost,
  .low-margin-dash .lm-table .lm-td-price,
  .low-margin-dash .lm-table .lm-td-prft,
  .low-margin-dash .lm-table .lm-td-onixprft,
  .low-margin-dash .lm-table .lm-td-barcode,
  .low-margin-dash .lm-table thead th.lm-th-cost,
  .low-margin-dash .lm-table thead th.lm-th-price,
  .low-margin-dash .lm-table thead th.lm-th-barcode,
  .low-margin-dash .lm-table thead th.lm-th-prft {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@media (max-width: 1200px) {
  .low-margin-dash .low-margin-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .low-margin-dash .low-margin-filter .lm-field-branch,
  .low-margin-dash .low-margin-filter .lm-field-wh,
  .low-margin-dash .low-margin-filter .lm-field-group {
    grid-column: 1 / -1;
  }

  .low-margin-dash .low-margin-filter .lm-field-q {
    grid-column: 1 / span 2;
  }

  .low-margin-dash .low-margin-filter .lm-field-actions {
    grid-column: 3;
  }
}

@media (max-width: 900px) {
  .low-margin-dash .lm-kpi-grid {
    grid-template-columns: 1fr;
  }

  .low-margin-dash .low-margin-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .low-margin-dash .low-margin-filter .lm-field-branch,
  .low-margin-dash .low-margin-filter .lm-field-wh,
  .low-margin-dash .low-margin-filter .lm-field-group,
  .low-margin-dash .low-margin-filter .lm-field-q,
  .low-margin-dash .low-margin-filter .lm-field-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .low-margin-dash .low-margin-filter {
    grid-template-columns: 1fr;
  }

  .low-margin-dash .low-margin-filter .lm-field-branch,
  .low-margin-dash .low-margin-filter .lm-field-wh,
  .low-margin-dash .low-margin-filter .lm-field-group,
  .low-margin-dash .low-margin-filter .lm-field-q,
  .low-margin-dash .low-margin-filter .lm-field-actions {
    grid-column: auto;
  }
}

@media print {
  .low-margin-dash .low-margin-filter,
  .low-margin-dash .lm-kpi-grid,
  .low-margin-dash .alert,
  .low-margin-dash .dash-head,
  .low-margin-dash .lm-sheet-actions,
  .sidebar,
  .sidebar-backdrop,
  .topbar {
    display: none !important;
  }

  .page.low-margin-dash > main {
    padding: 0;
  }

  .low-margin-dash .lm-sheet {
    border: 0;
  }

  .low-margin-dash .lm-scroll {
    max-height: none !important;
    overflow: visible !important;
  }

  .low-margin-dash .lm-table thead th {
    position: static !important;
  }

  .low-margin-dash .lm-table .lm-td-cost,
  .low-margin-dash .lm-table .lm-td-price,
  .low-margin-dash .lm-table .lm-td-barcode,
  .low-margin-dash .lm-table .lm-td-prft,
  .low-margin-dash .lm-table thead th.lm-th-cost,
  .low-margin-dash .lm-table thead th.lm-th-price,
  .low-margin-dash .lm-table thead th.lm-th-barcode,
  .low-margin-dash .lm-table thead th.lm-th-prft,
  .low-margin-dash .lm-table tr.is-ok .lm-td-prft,
  .low-margin-dash .lm-table tr.is-mid .lm-td-prft,
  .low-margin-dash .lm-table tr.is-warn .lm-td-prft,
  .low-margin-dash .lm-table tr.is-loss .lm-td-prft {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* —— إدارة المستودعات / تحويلات صادرة (شكل Excel) —— */
.page.wh-out-dash > main {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wh-out-dash .dash-head {
  margin-bottom: 0;
}

.wh-out-dash .dash-head-copy p {
  margin: 0.15rem 0 0;
  color: #6b858f;
  font-size: 0.88rem;
}

.wh-out-dash .wh-out-filter {
  margin: 0;
  padding: 0.65rem 0.75rem;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.wh-out-dash .wh-out-filter-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  align-items: flex-end;
  flex: 1;
}

.wh-out-dash .wh-out-filter .income-filter-field {
  min-width: 9.5rem;
}

.wh-out-dash .wh-out-filter .income-filter-field select {
  min-width: 10.5rem;
  max-width: 16rem;
}

.wh-out-dash .wh-out-branch-pair {
  min-width: min(100%, 26rem);
}

.wh-out-dash .wh-out-branch-pair .income-filter-period-fields,
.wh-out-dash .wh-out-wh-pair .income-filter-period-fields {
  flex-wrap: wrap;
}

.wh-out-dash .wh-out-branch-pair select,
.wh-out-dash .wh-out-wh-pair select {
  min-width: 11rem;
  max-width: 15rem;
}

.wh-out-dash .wh-out-wh-pair {
  min-width: min(100%, 28rem);
}

.wh-out-dash .wh-out-actions {
  display: flex;
  align-items: flex-end;
}

.wh-out-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
}

.wh-out-kpi {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid transparent;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.wh-out-kpi::before {
  content: "";
  position: absolute;
  inset: -35% auto auto -18%;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, transparent 68%);
  pointer-events: none;
}

.wh-out-kpi-label,
.wh-out-kpi-value,
.wh-out-kpi-hint,
.wh-out-kpi-ico {
  position: relative;
  z-index: 1;
}

.wh-out-kpi-label {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.wh-out-kpi-ico {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.wh-out-kpi-ico svg {
  width: 0.92rem;
  height: 0.92rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wh-out-kpi-value {
  font-size: 1.35rem;
  line-height: 1.15;
  font-weight: 700;
}

.wh-out-kpi-hint {
  font-size: 0.68rem;
  line-height: 1.35;
}

.wh-out-kpi.is-total {
  background: linear-gradient(145deg, #0e7490 0%, #06b6d4 58%, #06b6d4 100%);
  border-color: #0891b2;
  color: #f7fcfd;
}

.wh-out-kpi.is-total .wh-out-kpi-label { color: #ecfeff; }
.wh-out-kpi.is-total .wh-out-kpi-value { color: #fff; }
.wh-out-kpi.is-total .wh-out-kpi-hint { color: #e0f7fa; }

.wh-out-kpi.is-ok {
  background: linear-gradient(145deg, #14532d 0%, #15803d 58%, #22c55e 100%);
  border-color: #166534;
  color: #ecfdf5;
}

.wh-out-kpi.is-ok .wh-out-kpi-label { color: #bbf7d0; }
.wh-out-kpi.is-ok .wh-out-kpi-value { color: #fff; }
.wh-out-kpi.is-ok .wh-out-kpi-hint { color: #86efac; }

.wh-out-kpi.is-pending {
  background: linear-gradient(145deg, #92400e 0%, #d97706 58%, #f59e0b 100%);
  border-color: #b45309;
  color: #fffbeb;
}

.wh-out-kpi.is-pending .wh-out-kpi-label { color: #fde68a; }
.wh-out-kpi.is-pending .wh-out-kpi-value { color: #fff; }
.wh-out-kpi.is-pending .wh-out-kpi-hint { color: #fcd34d; }

.wh-out-kpi.is-late {
  background: linear-gradient(145deg, #7f1d1d 0%, #b91c1c 58%, #ef4444 100%);
  border-color: #991b1b;
  color: #fef2f2;
}

.wh-out-kpi.is-late .wh-out-kpi-label { color: #fecaca; }
.wh-out-kpi.is-late .wh-out-kpi-value { color: #fff; }
.wh-out-kpi.is-late .wh-out-kpi-hint { color: #fca5a5; }

.wh-out-sheet {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border: 1px solid #9e9e9e;
}

.wh-out-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.55rem;
  background: #ececec;
  border-bottom: 1px solid #9e9e9e;
}

.wh-out-sheet-title {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
}

.wh-out-sheet-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.wh-out-excel-btn,
.wh-out-pdf-btn {
  min-width: 4.2rem;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.2;
}

.wh-out-sheet-head h3 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #1a2b33;
}

.wh-out-sheet-count {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: #475569;
}

.wh-out-scroll {
  max-height: min(72vh, 780px);
  overflow: auto;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #6b858f #e2e8f0;
}

.wh-out-scroll::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.wh-out-scroll::-webkit-scrollbar-thumb {
  background: #6b858f;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
}

.wh-out-scroll::-webkit-scrollbar-track {
  background: #e2e8f0;
}

.wh-out-scroll.has-x-scroll,
.wh-out-scroll.has-y-scroll {
  box-shadow: inset -3px -3px 0 #cbd5e1;
}

.wh-out-scroll.table-wrap {
  border-radius: 0;
  box-shadow: none;
  border: 0;
  padding: 0;
  margin: 0;
}

.wh-out-table {
  width: max-content;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: auto;
  background: #fff;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 12px;
  color: #111;
}

.wh-out-table thead th,
.wh-out-table tbody td {
  margin: 0;
  padding: 1px 4px;
  border: 1px solid #b0b0b0;
  vertical-align: middle;
  text-align: right;
  line-height: 1.2;
  white-space: nowrap;
}

.wh-out-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #d9e2f3;
  color: #1a2b33;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: inset 0 -1px 0 #9e9e9e;
}

.wh-out-table tbody tr:nth-child(even) td {
  background: #f7f7f7;
}

.wh-out-table tbody tr:hover td {
  background: #fff6d5;
}

.wh-out-table .wh-out-td-status {
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.wh-out-table .wh-out-td-status.is-ok {
  color: #14532d;
  background: #c6efce !important;
}

.wh-out-table .wh-out-td-status.is-late {
  color: #7f1d1d;
  background: #ffc7ce !important;
}

.wh-out-table .wh-out-td-status.is-pending {
  color: #7a4d00;
  background: #ffeb9c !important;
}

.wh-out-table .wh-out-td-no,
.wh-out-table .wh-out-td-delay,
.wh-out-table .wh-out-td-created,
.wh-out-table .wh-out-td-qty,
.wh-out-table .wh-out-td-items {
  text-align: center;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

.wh-out-table .wh-out-td-delay.is-late {
  color: #7f1d1d;
  background: #ffc7ce !important;
  font-weight: 700;
}

.wh-out-table .wh-out-td-delay.is-ok {
  color: #14532d;
  background: #c6efce !important;
  font-weight: 700;
}

.wh-out-table .wh-out-td-group,
.wh-out-table .wh-out-td-name,
.wh-out-table .wh-out-td-branch,
.wh-out-table .wh-out-td-src-wh,
.wh-out-table .wh-out-td-dst-wh,
.wh-out-table .wh-out-td-status {
  width: max-content;
  max-width: none;
  white-space: nowrap;
}

.wh-out-table .wh-out-empty {
  text-align: center;
  color: #6b858f;
  padding: 1rem;
  white-space: normal;
}

@media (max-width: 960px) {
  .wh-out-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .wh-out-kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .wh-out-dash .wh-out-filter,
  .wh-out-dash .wh-out-kpi-grid,
  .wh-out-dash .alert,
  .wh-out-dash .dash-head,
  .wh-out-sheet-actions,
  .sidebar,
  .sidebar-backdrop,
  .topbar {
    display: none !important;
  }

  .page.wh-out-dash > main {
    padding: 0;
  }

  .wh-out-sheet {
    border: 0;
  }

  .wh-out-scroll {
    max-height: none !important;
    overflow: visible !important;
  }

  .wh-out-table thead th {
    position: static !important;
  }

  .wh-out-table .wh-out-td-status,
  .wh-out-table .wh-out-td-delay.is-late,
  .wh-out-table .wh-out-td-delay.is-ok {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}



/* أصناف غير مسعّرة */
.unpriced-dash > main {
  max-width: 100%;
  overflow-x: clip;
}

.unpriced-dash .unpriced-filter {
  display: grid;
  grid-template-columns:
    minmax(0, 1.2fr)
    minmax(0, 1.35fr)
    minmax(0, 1.2fr)
    minmax(0, 1fr)
    auto;
  gap: 0.6rem 0.7rem;
  align-items: end;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
}

.unpriced-dash .unpriced-filter .field {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.unpriced-dash .unpriced-filter label {
  color: #294f78;
  font-size: 0.7rem;
  font-weight: 800;
}

.unpriced-dash .unpriced-filter input,
.unpriced-dash .unpriced-filter select {
  width: 100%;
  min-width: 0;
  min-height: 2.2rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #c9d9eb;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: #183d66;
  font-size: 0.76rem;
}

.unpriced-dash .unpriced-filter .up-req {
  color: #b45309;
  font-weight: 800;
}

.unpriced-dash .unpriced-filter .up-opt {
  font-weight: 400;
  opacity: 0.65;
  font-size: 0.85em;
}

.unpriced-dash .unpriced-filter .up-field-actions .btn-primary {
  min-height: 2.2rem;
  white-space: nowrap;
}

.unpriced-dash .up-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0 0 0.75rem;
}

.unpriced-dash .up-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.unpriced-dash .up-kpi-label {
  font-size: 0.74rem;
  font-weight: 600;
}

.unpriced-dash .up-kpi-label:has(.up-kpi-ico) {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.unpriced-dash .up-kpi-ico {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.unpriced-dash .up-kpi-ico svg {
  width: 0.92rem;
  height: 0.92rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.unpriced-dash .up-kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.unpriced-dash .up-kpi-hint {
  font-size: 0.68rem;
}

.unpriced-dash .up-kpi.is-match {
  background: linear-gradient(135deg, #9a3412 0%, #c2410c 55%, #ea580c 100%);
}
.unpriced-dash .up-kpi.is-match .up-kpi-label,
.unpriced-dash .up-kpi.is-match .up-kpi-hint { color: #ffedd5; }

.unpriced-dash .up-kpi.is-shown {
  background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
}
.unpriced-dash .up-kpi.is-shown .up-kpi-label,
.unpriced-dash .up-kpi.is-shown .up-kpi-hint { color: #ecfeff; }

.unpriced-dash .up-kpi.is-wh {
  background: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%);
}
.unpriced-dash .up-kpi.is-wh .up-kpi-label,
.unpriced-dash .up-kpi.is-wh .up-kpi-hint { color: #e0f7fa; }

.unpriced-dash .up-sheet {
  background: #fff;
  border: 1px solid #9e9e9e;
}

.unpriced-dash .up-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.55rem;
  background: #ececec;
  border-bottom: 1px solid #9e9e9e;
}

.unpriced-dash .up-sheet-title {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

.unpriced-dash .up-sheet-head h3 {
  margin: 0;
  font-size: 0.92rem;
  color: #1a2b33;
}

.unpriced-dash .up-sheet-count {
  font-size: 0.75rem;
  color: #6b858f;
}

.unpriced-dash .up-sheet-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.unpriced-dash .up-excel-btn,
.unpriced-dash .up-pdf-btn {
  min-width: 4.2rem;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.2;
}

.unpriced-dash .up-scroll {
  max-height: min(70vh, 42rem);
  overflow: auto;
}

.unpriced-dash .up-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.unpriced-dash .up-table th,
.unpriced-dash .up-table td {
  border: 1px solid #b0b0b0;
  padding: 2px 6px;
  white-space: nowrap;
}

.unpriced-dash .up-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #d9e2f3;
  color: #1a2b33;
  font-weight: 700;
}

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

.unpriced-dash .up-table td.up-unpriced-mark {
  color: #b45309;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .unpriced-dash .unpriced-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .unpriced-dash .unpriced-filter .up-field-branch,
  .unpriced-dash .unpriced-filter .up-field-wh,
  .unpriced-dash .unpriced-filter .up-field-group,
  .unpriced-dash .unpriced-filter .up-field-q,
  .unpriced-dash .unpriced-filter .up-field-actions {
    grid-column: 1 / -1;
  }
}

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

@media (max-width: 640px) {
  .unpriced-dash .unpriced-filter {
    grid-template-columns: 1fr;
  }
}

@media print {
  .unpriced-dash .unpriced-filter,
  .unpriced-dash .up-kpi-grid,
  .unpriced-dash .alert,
  .unpriced-dash .dash-head,
  .unpriced-dash .up-sheet-actions,
  .sidebar,
  .sidebar-backdrop,
  .sidebar-open,
  .app-hard-refresh,
  .topbar {
    display: none !important;
  }

  .page.unpriced-dash > main {
    padding: 0;
  }

  .unpriced-dash .up-sheet {
    border: none;
  }

  .unpriced-dash .up-scroll {
    max-height: none !important;
    overflow: visible !important;
  }

  .unpriced-dash .up-table thead th {
    position: static !important;
  }
}

/* تسعير أقل من التكلفة — تمييز الفرق */
.below-cost-dash .up-table td.bc-unit-avg {
  color: #9a3412;
  font-weight: 700;
  background: #fff7ed;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

.below-cost-dash .up-table td.bc-price {
  color: #15803d;
  font-weight: 700;
  background: #f0fdf4;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

.below-cost-dash .up-table td.bc-gap {
  color: #b91c1c;
  font-weight: 700;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
}

/* —— اسم مشابه · باركود مختلف —— */
.name-barcode-dash .up-table.nbc-table {
  width: max-content;
  max-width: 100%;
  table-layout: auto;
}

.name-barcode-dash .nbc-table col.col-idx { width: 0; }
.name-barcode-dash .nbc-table col.col-code { width: 0; }
.name-barcode-dash .nbc-table col.col-item { width: 0; }
.name-barcode-dash .nbc-table col.col-barcode { width: 0; }
.name-barcode-dash .nbc-table col.col-grp { width: 0; }
.name-barcode-dash .nbc-table col.col-type { width: 0; }
.name-barcode-dash .nbc-table col.col-unit { width: 0; }
.name-barcode-dash .nbc-table col.col-gname { width: auto; }

.name-barcode-dash .nbc-table .nbc-th-idx,
.name-barcode-dash .nbc-table .nbc-idx,
.name-barcode-dash .nbc-table .nbc-th-code,
.name-barcode-dash .nbc-table .nbc-code,
.name-barcode-dash .nbc-table .nbc-th-item,
.name-barcode-dash .nbc-table .nbc-name,
.name-barcode-dash .nbc-table .nbc-th-barcode,
.name-barcode-dash .nbc-table .nbc-barcode,
.name-barcode-dash .nbc-table .nbc-th-grp,
.name-barcode-dash .nbc-table .nbc-group-id,
.name-barcode-dash .nbc-table .nbc-th-type,
.name-barcode-dash .nbc-table .nbc-match-exact,
.name-barcode-dash .nbc-table .nbc-match-similar,
.name-barcode-dash .nbc-table .nbc-th-unit,
.name-barcode-dash .nbc-table .nbc-unit {
  width: 0;
  max-width: max-content;
  white-space: nowrap;
}

.name-barcode-dash .nbc-table .nbc-th-unit,
.name-barcode-dash .nbc-table .nbc-unit {
  text-align: center;
}

.name-barcode-dash .nbc-table .nbc-th-gname,
.name-barcode-dash .nbc-table .nbc-gname {
  width: auto;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-barcode-dash .nbc-table thead th.nbc-th-barcode {
  background: #ede9fe;
  color: #5b21b6;
}

.name-barcode-dash .nbc-table thead th.nbc-th-item {
  background: #f1f5f9;
  color: #1a2b33;
}

.name-barcode-dash .nbc-filter {
  display: grid;
  grid-template-columns: minmax(10rem, 1.2fr) minmax(10rem, 1.4fr) minmax(9rem, 1fr) minmax(5rem, 0.55fr) auto;
  gap: 0.75rem 1rem;
  align-items: end;
}

.name-barcode-dash .nbc-table td.nbc-group-id {
  text-align: center;
  font-weight: 700;
  background: #f5f3ff;
  color: #5b21b6;
}

.name-barcode-dash .nbc-table td.nbc-match-exact {
  text-align: center;
  font-size: 0.82rem;
  white-space: nowrap;
  font-weight: 700;
  background: #dcfce7;
  color: #14532d;
}

.name-barcode-dash .nbc-table td.nbc-match-similar {
  text-align: center;
  font-size: 0.82rem;
  white-space: nowrap;
  font-weight: 700;
  background: #ffedd5;
  color: #9a3412;
}

.name-barcode-dash .nbc-table td.nbc-code {
  text-align: center;
  font-weight: 700;
  color: #4338ca;
}

.name-barcode-dash .nbc-table td.nbc-name {
  font-weight: 600;
  color: #1a2b33;
  text-align: right;
}

.name-barcode-dash .nbc-table td.nbc-barcode {
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  font-weight: 700;
  color: #7c3aed;
  background: #f3e8ff;
  direction: ltr;
  unicode-bidi: isolate;
}

.name-barcode-dash .nbc-table tr.nbc-stripe-b td:not(.nbc-barcode):not(.nbc-group-id):not(.nbc-match-exact):not(.nbc-match-similar) {
  background: #f8fafc;
}

.name-barcode-dash .nbc-table tr.nbc-stripe-b td.nbc-barcode {
  background: #e9d5ff;
}

.name-barcode-dash .nbc-table tbody tr:hover td {
  background: #fff6d5;
}

.name-barcode-dash .nbc-table tbody tr:hover td.nbc-barcode {
  background: #ddd6fe;
}

.name-barcode-dash .nbc-table tbody tr:hover td.nbc-group-id {
  background: #ede9fe;
}

.name-barcode-dash .nbc-table tbody tr:hover td.nbc-match-exact {
  background: #bbf7d0;
}

.name-barcode-dash .nbc-table tbody tr:hover td.nbc-match-similar {
  background: #fed7aa;
}

@media (max-width: 960px) {
  .name-barcode-dash .nbc-filter {
    grid-template-columns: 1fr 1fr;
  }
  .name-barcode-dash .nbc-filter .up-field-actions {
    grid-column: 1 / -1;
  }
}

@media print {
  .name-barcode-dash .nbc-filter,
  .name-barcode-dash .up-kpi-grid,
  .name-barcode-dash .alert,
  .name-barcode-dash .dash-head,
  .name-barcode-dash .up-sheet-actions,
  #app-sidebar,
  .app-topbar {
    display: none !important;
  }
}

/* قياس عرض كل الأعمدة قبل الطباعة — خارج @media حتى يُحسب العرض الكامل */
body.fit-printing.fit-measuring .table-wrap,
body.fit-printing.fit-measuring [class*="-scroll"] {
  overflow: visible !important;
  max-height: none !important;
  max-width: none !important;
  width: max-content !important;
}

body.fit-printing.fit-measuring table {
  width: max-content !important;
  max-width: none !important;
  table-layout: auto !important;
}

body.fit-printing.fit-measuring table th,
body.fit-printing.fit-measuring table td {
  white-space: nowrap !important;
  max-width: none !important;
  width: auto !important;
  overflow: visible !important;
}

/* —— طباعة PDF موحّدة: كل الأعمدة في عرض الصفحة مع ألوان الجدول —— */
@media print {
  @page {
    size: A4 landscape;
    margin: 6mm;
  }

  body.fit-printing {
    background: #fff !important;
    color: #111 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.fit-printing .page,
  body.fit-printing main,
  body.fit-printing .page.has-sidebar,
  body.fit-printing .page.has-sidebar > main {
    background: #fff !important;
    background-image: none !important;
    color: #111 !important;
  }

  body.fit-printing .sidebar,
  body.fit-printing #app-sidebar,
  body.fit-printing .sidebar-backdrop,
  body.fit-printing .sidebar-toggle,
  body.fit-printing .topbar,
  body.fit-printing .app-topbar,
  body.fit-printing .app-hard-refresh,
  body.fit-printing .scroll-edge-btn,
  body.fit-printing .js-fit-print,
  body.fit-printing .lm-pdf-btn,
  body.fit-printing .up-pdf-btn,
  body.fit-printing .wh-out-pdf-btn,
  body.fit-printing .wh-exp-print-btn,
  body.fit-printing .inv-pack-err-print-btn,
  body.fit-printing .wqc-pdf-btn,
  body.fit-printing .wqc-excel-btn,
  body.fit-printing .lm-excel-btn,
  body.fit-printing .lm-loader {
    display: none !important;
  }

  /* كل تصدير PDF: الجدول فقط */
  body.fit-printing.fit-table-only .is-print-ancestor {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    gap: 0 !important;
    min-height: 0 !important;
  }

  body.fit-printing.fit-table-only .is-print-ancestor > *:not(.is-print-ancestor):not(.is-print-target) {
    display: none !important;
  }

  body.fit-printing.fit-table-only .is-print-target:not(table) {
    display: block !important;
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  body.fit-printing .page.has-sidebar,
  body.fit-printing .page.has-sidebar > main {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.fit-printing .table-wrap,
  body.fit-printing [class*="-scroll"],
  body.fit-printing #lm-wrap {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    border: 0 !important;
    box-shadow: none !important;
    width: max-content !important;
    max-width: none !important;
  }

  body.fit-printing .table-wrap::after {
    display: none !important;
    content: none !important;
  }

  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.data-table,
  body.fit-printing table.sales-table,
  body.fit-printing table.vt-sheet,
  body.fit-printing table.vt-table,
  body.fit-printing table.perf-compare-table,
  body.fit-printing table.purchase-table,
  body.fit-printing table.income-table,
  body.fit-printing table.suppliers-table,
  body.fit-printing table.assets-table {
    width: max-content !important;
    min-width: 0 !important;
    max-width: none !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
  }

  body.fit-printing table[data-fit-scale] {
    zoom: var(--fit-print-scale, 1);
  }

  body.fit-printing table.lm-table thead,
  body.fit-printing table.up-table thead,
  body.fit-printing table.nbc-table thead,
  body.fit-printing table.wh-out-table thead,
  body.fit-printing table.wh-exp-table thead,
  body.fit-printing table.inv-pack-err-table thead,
  body.fit-printing table.wqc-table thead,
  body.fit-printing table.data-table thead,
  body.fit-printing table.sales-table thead,
  body.fit-printing table.vt-sheet thead,
  body.fit-printing table.vt-table thead {
    display: table-header-group;
  }

  body.fit-printing table.lm-table tr,
  body.fit-printing table.up-table tr,
  body.fit-printing table.nbc-table tr,
  body.fit-printing table.wh-out-table tr,
  body.fit-printing table.wh-exp-table tr,
  body.fit-printing table.inv-pack-err-table tr,
  body.fit-printing table.wqc-table tr,
  body.fit-printing table.data-table tr,
  body.fit-printing table.sales-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.fit-printing table.lm-table thead th,
  body.fit-printing table.up-table thead th,
  body.fit-printing table.nbc-table thead th,
  body.fit-printing table.wh-out-table thead th,
  body.fit-printing table.wh-exp-table thead th,
  body.fit-printing table.inv-pack-err-table thead th,
  body.fit-printing table.wqc-table thead th,
  body.fit-printing table.data-table thead th {
    position: static !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.fit-printing table.lm-table th,
  body.fit-printing table.lm-table td,
  body.fit-printing table.up-table th,
  body.fit-printing table.up-table td,
  body.fit-printing table.nbc-table th,
  body.fit-printing table.nbc-table td,
  body.fit-printing table.wh-out-table th,
  body.fit-printing table.wh-out-table td,
  body.fit-printing table.wh-exp-table th,
  body.fit-printing table.wh-exp-table td,
  body.fit-printing table.inv-pack-err-table th,
  body.fit-printing table.inv-pack-err-table td,
  body.fit-printing table.wqc-table th,
  body.fit-printing table.wqc-table td,
  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,
  body.fit-printing table.vt-sheet th,
  body.fit-printing table.vt-sheet td,
  body.fit-printing table.vt-table th,
  body.fit-printing table.vt-table td,
  body.fit-printing table.perf-compare-table th,
  body.fit-printing table.perf-compare-table td {
    border: 1px solid #b0b0b0 !important;
    padding: 0.18em 0.35em !important;
    vertical-align: middle !important;
    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;
    line-height: 1.25 !important;
    font-size: inherit !important;
    width: 1% !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;
  }

  body.fit-printing .inv-cell-clip,
  body.fit-printing .inv-col-sticky {
    max-width: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
    width: 1% !important;
  }

  body.fit-printing table thead th {
    background: #d9e2f3 !important;
    color: #1a2b33 !important;
  }

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

  body.fit-printing table tfoot td {
    background: #d9e2f3 !important;
    color: #1a2b33 !important;
    font-weight: 800 !important;
  }
}

/* مقارنة أسعار الموردين */
.vpc-dash .vpc-filter {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
}

.vpc-dash .vpc-filter-row {
  display: grid;
  gap: 0.65rem 0.75rem;
  align-items: end;
  min-width: 0;
}

.vpc-dash .vpc-filter-row-scope {
  grid-template-columns:
    minmax(15rem, 1.35fr)
    minmax(9rem, 1fr)
    minmax(10rem, 1.1fr);
}

.vpc-dash .vpc-filter-row-vendor {
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.vpc-dash .vpc-filter .field {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

.vpc-dash .vpc-filter label,
.vpc-dash .vpc-period-label {
  color: #294f78;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.vpc-dash .vpc-filter input:not([type="checkbox"]):not([type="hidden"]):not([type="radio"]),
.vpc-dash .vpc-filter select {
  width: 100%;
  min-width: 0;
  min-height: 2.35rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid #c9d9eb;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #183d66;
  font-size: 0.78rem;
}

.vpc-dash .vpc-period-fields {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.35rem;
  align-items: end;
}

.vpc-dash .vpc-period-item {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.vpc-dash .vpc-period-item label {
  font-size: 0.62rem;
  color: #6b858f;
}

.vpc-dash .vpc-period-sep {
  padding-bottom: 0.45rem;
  color: #94a3b8;
  font-weight: 700;
}

.vpc-dash .vpc-req { color: #b45309; font-weight: 800; }

.vpc-dash .vpc-field-diffs,
.vpc-dash .vpc-field-actions {
  align-self: end;
}

.vpc-dash .vpc-actions-spacer {
  display: block;
  visibility: hidden;
  user-select: none;
}

.vpc-dash .vpc-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.35rem;
  padding: 0 0.8rem;
  border: 1px solid #c9d9eb;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #294f78;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
}

.vpc-dash .vpc-check-label input[type="checkbox"] {
  width: 1rem;
  min-width: 1rem;
  height: 1rem;
  min-height: 1rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  accent-color: #166534;
  flex: 0 0 auto;
  cursor: pointer;
}

.vpc-dash .vpc-check-label:has(input[type="checkbox"]:checked) {
  border-color: #86efac;
  background: #ecfdf3;
  color: #14532d;
}

.vpc-dash .vpc-field-actions .btn-primary {
  min-height: 2.35rem;
  padding: 0.35rem 1.15rem;
  white-space: nowrap;
  font-weight: 800;
}

.vpc-dash .vpc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 0.85rem;
}

.vpc-dash .vpc-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(180, 205, 230, 0.85);
  background: #fff;
}

.vpc-dash .vpc-kpi span { font-size: 0.72rem; font-weight: 800; color: #5d738c; }
.vpc-dash .vpc-kpi strong { font-size: 1.1rem; color: #16324f; }
.vpc-dash .vpc-kpi small { font-size: 0.7rem; color: #6b858f; }
.vpc-dash .vpc-kpi.is-flag { border-color: rgba(154, 52, 18, 0.3); background: linear-gradient(145deg, #fff7ed, #fff); }
.vpc-dash .vpc-kpi.is-max { border-color: rgba(91, 33, 182, 0.28); background: linear-gradient(145deg, #f5f3ff, #fff); }

.vpc-dash .vpc-scroll {
  max-height: min(48vh, 28rem);
  overflow: auto;
  border: 1px solid #9eb6d4;
  border-radius: 10px;
  background: #fff;
}

.vpc-dash .vpc-scroll.table-wrap::after { display: none; content: none; }

.vpc-dash .vpc-excel-btn,
.vpc-dash .vpc-print-btn {
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.vpc-dash .vpc-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}

.vpc-dash .vpc-table thead th {
  position: sticky;
  top: 0;
  z-index: 8;
  white-space: nowrap;
  font-weight: 800;
  padding: 0.5rem;
  border-bottom: 1px solid #8aa3c2;
  background: #dbe8f8 !important;
  color: #12345f;
}

.vpc-dash .vpc-table thead th.vpc-th-price { background: #c8f0d8 !important; color: #14532d; }
.vpc-dash .vpc-table thead th.vpc-th-spread { background: #ffedd5 !important; color: #9a3412; }

.vpc-dash .vpc-table th,
.vpc-dash .vpc-table td {
  border-inline-end: 1px solid #d5e1ef;
  border-bottom: 1px solid #e2ebf5;
  padding: 0.4rem 0.45rem;
  white-space: nowrap;
  vertical-align: middle;
}

.vpc-dash .vpc-table thead th.vpc-th-name,
.vpc-dash .vpc-table .vpc-td-name {
  white-space: normal !important;
  min-width: 8rem;
  max-width: 12rem;
  width: 10rem;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.3;
  font-weight: 700;
  color: #12345f;
  vertical-align: middle;
  background: #fff;
  position: relative;
  z-index: 1;
}
.vpc-dash .vpc-table tr.is-even .vpc-td-name {
  background: #f8fafc;
}

.vpc-dash .vpc-table .vpc-td-code { color: #5b21b6; font-weight: 800; }
.vpc-dash .vpc-table .vpc-td-price { background: #ecfdf3; color: #166534; font-weight: 800; }
.vpc-dash .vpc-table .vpc-td-spread { background: #fff7ed; color: #9a3412; font-weight: 800; }
.vpc-dash .vpc-table tr.is-flag .vpc-td-spread { background: #fed7aa; }
.vpc-dash .vpc-table tr.is-even .vpc-td-price { background: #dcfce7; }
.vpc-dash .vpc-table .vpc-td-loc { max-width: 11rem; white-space: normal; overflow-wrap: anywhere; font-size: 0.74rem; }

.vpc-dash .vpc-pivot-wrap { max-height: min(70vh, 42rem); }

/* عرض الجدول بعرض اللوحة مع تمرير أفقي عند زيادة الأعمدة */
.vpc-dash .vpc-pivot-wrap .vpc-pivot-table {
  width: max-content !important;
  min-width: 100% !important;
  table-layout: fixed;
}

.vpc-dash .vpc-pivot-table .vpc-td-price.is-min { background: #bbf7d0 !important; color: #14532d; }
.vpc-dash .vpc-pivot-table .vpc-td-price.is-max { background: #fed7aa !important; color: #9a3412; }
.vpc-dash .vpc-pivot-table .vpc-td-price.is-empty { background: #f8fafc !important; color: #94a3b8; font-weight: 600; }

.vpc-dash .vpc-pivot-table .vpc-th-price,
.vpc-dash .vpc-pivot-table td.vpc-td-price {
  width: 5.5rem !important;
  min-width: 5.5rem !important;
  max-width: 5.5rem !important;
}
.vpc-dash .vpc-pivot-table .vpc-th-bdate,
.vpc-dash .vpc-pivot-table td.vpc-td-bdate {
  width: 5.6rem !important;
  min-width: 5.6rem !important;
  max-width: 5.6rem !important;
  font-size: 0.7rem;
  color: #475569;
  background: #f8fafc;
  white-space: nowrap;
  text-align: center;
}
.vpc-dash .vpc-pivot-table thead th.vpc-th-bdate {
  background: #e2e8f0 !important;
  color: #3d5560;
  font-size: 0.68rem;
}
.vpc-dash .vpc-pivot-table td.vpc-td-bdate.is-empty {
  color: #94a3b8;
}
.vpc-dash .vpc-pivot-table tr.is-even td.vpc-td-bdate {
  background: #f1f5f9;
}
.vpc-dash .vpc-pivot-table .vpc-th-bno,
.vpc-dash .vpc-pivot-table td.vpc-td-bno {
  width: 4.75rem !important;
  min-width: 4.75rem !important;
  max-width: 4.75rem !important;
  font-size: 0.7rem;
  color: #5b21b6;
  background: #faf5ff;
  white-space: nowrap;
  text-align: center;
  font-weight: 700;
}
.vpc-dash .vpc-pivot-table thead th.vpc-th-bno {
  background: #ede9fe !important;
  color: #5b21b6;
  font-size: 0.66rem;
}
.vpc-dash .vpc-pivot-table td.vpc-td-bno.is-empty {
  color: #94a3b8;
  font-weight: 600;
}
.vpc-dash .vpc-pivot-table tr.is-even td.vpc-td-bno {
  background: #f3e8ff;
}
.vpc-dash .vpc-pivot-table .vpc-th-spread,
.vpc-dash .vpc-pivot-table .vpc-td-spread {
  width: 4.25rem !important;
  min-width: 4.25rem !important;
  max-width: 4.25rem !important;
}

/* أعمدة ثابتة متلاصقة: # | رقم | اسم | وحدة */
.vpc-dash .vpc-pivot-table .vpc-sticky-col {
  position: sticky;
  z-index: 6;
  background: #fff;
  overflow: hidden;
  box-sizing: border-box;
}
.vpc-dash .vpc-pivot-table thead .vpc-sticky-col {
  z-index: 12;
  background: #dbe8f8 !important;
}
.vpc-dash .vpc-pivot-table .vpc-th-idx.vpc-sticky-col,
.vpc-dash .vpc-pivot-table .vpc-td-idx.vpc-sticky-col {
  inset-inline-start: 0;
  width: 2.25rem !important;
  min-width: 2.25rem !important;
  max-width: 2.25rem !important;
}
.vpc-dash .vpc-pivot-table .vpc-sticky-code {
  inset-inline-start: 2.25rem;
  width: 6.5rem !important;
  min-width: 6.5rem !important;
  max-width: 6.5rem !important;
}
.vpc-dash .vpc-pivot-table .vpc-sticky-name,
.vpc-dash .vpc-pivot-table thead th.vpc-sticky-name,
.vpc-dash .vpc-pivot-table td.vpc-sticky-name {
  inset-inline-start: 8.75rem;
  width: 10rem !important;
  min-width: 10rem !important;
  max-width: 10rem !important;
  white-space: normal !important;
  line-height: 1.25;
  position: sticky;
  z-index: 6;
  background: #fff;
}
.vpc-dash .vpc-pivot-table thead th.vpc-sticky-name {
  z-index: 12;
  background: #dbe8f8 !important;
}
.vpc-dash .vpc-pivot-table .vpc-sticky-unit,
.vpc-dash .vpc-pivot-table thead th.vpc-sticky-unit,
.vpc-dash .vpc-pivot-table td.vpc-sticky-unit {
  inset-inline-start: 18.75rem;
  width: 3.5rem !important;
  min-width: 3.5rem !important;
  max-width: 3.5rem !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  font-weight: 800;
  color: #0e7490;
  background: #fff;
  box-shadow: -2px 0 0 #c5d5e8;
  z-index: 7;
  padding-inline: 0.2rem;
}
.vpc-dash .vpc-pivot-table thead th.vpc-sticky-unit {
  z-index: 13;
  background: #dbe8f8 !important;
}
.vpc-dash .vpc-pivot-table tr.is-even .vpc-sticky-col,
.vpc-dash .vpc-pivot-table tr.is-even td.vpc-sticky-name,
.vpc-dash .vpc-pivot-table tr.is-even td.vpc-sticky-unit {
  background: #f8fafc;
}

.vpc-dash .vpc-panel { margin-bottom: 0.85rem; }

@media (max-width: 1100px) {
  .vpc-dash .vpc-filter-row-scope {
    grid-template-columns: 1fr 1fr;
  }
  .vpc-dash .vpc-field-period { grid-column: 1 / -1; }
  .vpc-dash .vpc-filter-row-vendor {
    grid-template-columns: 1fr auto;
  }
  .vpc-dash .vpc-field-actions { justify-self: end; }
  .vpc-dash .vpc-kpi-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .vpc-dash .vpc-filter-row-scope,
  .vpc-dash .vpc-filter-row-vendor {
    grid-template-columns: 1fr;
  }
  .vpc-dash .vpc-field-actions .btn-primary { width: 100%; }
  .vpc-dash .vpc-kpi-grid { grid-template-columns: 1fr; }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 5mm;
  }

  .vpc-dash .vpc-filter,
  .vpc-dash .alert,
  .vpc-dash .vpc-excel-btn,
  .vpc-dash .vpc-print-btn { display: none !important; }
  .vpc-dash .vpc-scroll { max-height: none !important; overflow: visible !important; border: 0 !important; }
  .vpc-dash .vpc-table thead th,
  .vpc-dash .vpc-pivot-table .vpc-sticky-col {
    position: static !important;
    inset-inline-start: auto !important;
    box-shadow: none !important;
  }

  body.fit-printing[data-print-scope="vpc-pivot"] .dash-head,
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-kpi-grid,
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-summary-panel {
    display: none !important;
  }
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-panel {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-panel .dash-panel-head {
    margin-bottom: 0.35rem !important;
  }
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-wrap {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 6.2px !important;
    transform: none !important;
    color: #111 !important;
  }
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table col,
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table th,
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table td {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0.1rem 0.08rem !important;
    font-size: inherit !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    overflow: hidden !important;
    word-break: break-word !important;
    vertical-align: middle !important;
    box-shadow: none !important;
    position: static !important;
    inset-inline-start: auto !important;
  }
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table .vpc-th-idx,
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table .vpc-td-idx {
    width: 2.2% !important;
  }
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table .vpc-th-code,
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table .vpc-td-code {
    width: 6.5% !important;
  }
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table .vpc-th-name,
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table .vpc-td-name {
    width: 11% !important;
  }
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table .vpc-th-unit,
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table .vpc-td-unit {
    width: 3.5% !important;
  }
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table .vpc-th-spread,
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table .vpc-td-spread {
    width: 3.8% !important;
  }
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table .vpc-td-price,
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table .vpc-td-bdate,
  body.fit-printing[data-print-scope="vpc-pivot"] .vpc-pivot-table .vpc-td-bno {
    white-space: nowrap !important;
  }

  body.fit-printing[data-print-scope="vpc-summary"] .dash-head,
  body.fit-printing[data-print-scope="vpc-summary"] .vpc-kpi-grid,
  body.fit-printing[data-print-scope="vpc-summary"] .vpc-pivot-panel {
    display: none !important;
  }
  body.fit-printing[data-print-scope="vpc-summary"] .vpc-summary-panel {
    display: block !important;
  }
}

.vpc-dash .vpc-field-vendor {
  position: relative;
  z-index: 4;
}

.vpc-dash .vpc-vendor-suggest {
  position: relative;
}

.vpc-dash .vpc-vendor-suggest input[type="search"] {
  width: 100%;
}

.vpc-dash .vpc-vendor-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.vpc-dash .vendor-suggest-list {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 0.2rem);
  z-index: 30;
  max-height: 14rem;
  overflow: auto;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  border: 1px solid #c5d5e8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.vpc-dash .vendor-suggest-list[hidden] {
  display: none !important;
}

.vpc-dash .vendor-suggest-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #183d66;
  text-align: start;
  cursor: pointer;
  font: inherit;
}

.vpc-dash .vendor-suggest-option:hover,
.vpc-dash .vendor-suggest-option.is-active {
  background: #eef5ff;
}

.vpc-dash .vendor-suggest-name {
  font-size: 0.78rem;
  font-weight: 700;
}

.vpc-dash .vendor-suggest-code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  color: #5b21b6;
  direction: ltr;
}

.vpc-dash .vendor-suggest-empty {
  padding: 0.55rem;
  color: #6b858f;
  font-size: 0.74rem;
}

/* مقارنة كميات المستودعات */
.wqc-dash .wqc-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 0.55rem 0.65rem;
  align-items: end;
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.85rem;
}

.wqc-dash .wqc-pair {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.wqc-dash .wqc-pair-branches {
  grid-column: 1 / 3;
  grid-row: 1;
}

.wqc-dash .wqc-pair-warehouses {
  grid-column: 3 / 6;
  grid-row: 1;
}

.wqc-dash .wqc-pair-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0e7490;
}

.wqc-dash .wqc-pair-fields {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.4rem;
  align-items: end;
  min-width: 0;
}

.wqc-dash .wqc-pair-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0 0.15rem;
  color: #0891b2;
  font-weight: 900;
  font-size: 1rem;
}

.wqc-dash .wqc-pair .field {
  min-width: 0;
}

.wqc-dash .wqc-field-group { grid-column: 1; grid-row: 2; }
.wqc-dash .wqc-field-item { grid-column: 2; grid-row: 2; }
.wqc-dash .wqc-field-qty { grid-column: 3; grid-row: 2; }
.wqc-dash .wqc-field-mode { grid-column: 4; grid-row: 2; }
.wqc-dash .wqc-field-actions { grid-column: 5; grid-row: 2; }

.wnt-dash .wnt-filter {
  grid-template-columns:
    minmax(16rem, 1.3fr)
    minmax(9rem, 1fr)
    minmax(12rem, 1.2fr)
    minmax(9rem, 1fr)
    minmax(8rem, 0.9fr)
    auto;
}

.wnt-dash .wnt-period-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.35rem;
}

.wnt-dash .wnt-period-fields {
  display: flex;
  align-items: end;
  gap: 0.4rem;
  min-width: 0;
}

.wnt-dash .wnt-period-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.wnt-dash .wnt-period-item label {
  font-size: 0.72rem;
}

.wnt-dash .wnt-period-sep {
  color: #94a3b8;
  padding-bottom: 0.55rem;
  font-weight: 700;
}

.wnt-dash .wnt-td-last {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.wnt-dash .wnt-td-cost {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.wnt-dash .wnt-gcode {
  font-weight: 700;
  color: #3d5560;
}

.wqc-dash .wqc-filter .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.wqc-dash .wqc-filter label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}

.wqc-dash .wqc-req {
  color: #dc2626;
}

.wqc-dash .wqc-filter input,
.wqc-dash .wqc-filter select {
  width: 100%;
  min-height: 2.4rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  background: #fff;
  color: #1a2b33;
}

.wqc-dash .wqc-field-actions .btn-primary {
  min-height: 2.4rem;
  min-width: 4.6rem;
  width: 100%;
  font-weight: 700;
  padding: 0 0.9rem;
}

.wqc-dash .wqc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}

.wqc-dash .wqc-kpi {
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.wqc-dash .wqc-kpi .dash-kpi-label,
.wqc-dash .wqc-kpi span.dash-kpi-label {
  font-size: 0.78rem;
  color: #6b858f;
  font-weight: 700;
}

.wqc-dash .wqc-kpi .dash-kpi-value,
.wqc-dash .wqc-kpi strong.dash-kpi-value {
  font-size: 1.35rem;
  color: #1a2b33;
  font-weight: 800;
  line-height: 1.2;
}

.wqc-dash .wqc-kpi .dash-kpi-hint {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wqc-dash .wqc-kpi.is-count .dash-kpi-hint {
  color: #4338ca;
  font-weight: 700;
}

.wqc-dash .wqc-kpi.is-count {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #eef2ff, #fff);
}

.wqc-dash .wqc-kpi.is-gap {
  border-color: #fca5a5;
  background: linear-gradient(180deg, #fef2f2, #fff);
}

.wqc-dash .wqc-kpi.is-gap .dash-kpi-value {
  color: #b91c1c;
}

.wqc-dash .wqc-kpi.is-a {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #ecfdf5, #fff);
}

.wqc-dash .wqc-kpi.is-a .dash-kpi-value {
  color: #15803d;
}

.wqc-dash .wqc-kpi.is-b {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed, #fff);
}

.wqc-dash .wqc-kpi.is-b .dash-kpi-value {
  color: #c2410c;
}

.wqc-sheet {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border: 1px solid #9e9e9e;
}

.wqc-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  background: linear-gradient(90deg, #ecfeff 0%, #e0f2fe 55%, #f0f9ff 100%);
  border-bottom: 1px solid #7dd3fc;
  box-shadow: inset 3px 0 0 #0891b2;
}

.wqc-sheet-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.55rem;
  min-width: 0;
}

.wqc-sheet-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.wqc-excel-btn,
.wqc-pdf-btn {
  min-width: 4.2rem;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.2;
}

.wqc-sheet-head h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: #0e7490;
}

.wqc-sheet-count {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #0369a1;
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
}

.wqc-scroll {
  max-height: min(72vh, 780px);
  overflow: auto;
  background: #fff;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #6b858f #e2e8f0;
}

.wqc-scroll::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.wqc-scroll::-webkit-scrollbar-thumb {
  background: #6b858f;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
}

.wqc-scroll::-webkit-scrollbar-track {
  background: #e2e8f0;
}

.wqc-scroll.has-x-scroll,
.wqc-scroll.has-y-scroll {
  box-shadow: inset -3px -3px 0 #cbd5e1;
}

.wqc-scroll.table-wrap {
  border-radius: 0;
  box-shadow: none;
  border: 0;
  padding: 0;
  margin: 0;
}

.wqc-scroll.table-wrap::after {
  display: none;
  content: none;
}

.page.sales-dash.wqc-dash .wqc-table,
.wqc-dash .wqc-table,
.wqc-table {
  width: max-content;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: auto;
  background: #fff;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 12px;
  color: #111;
}

.wqc-table thead th,
.wqc-table tbody td,
.wqc-table tfoot td {
  margin: 0;
  padding: 1px 4px;
  border: 1px solid #b0b0b0;
  vertical-align: middle;
  text-align: right;
  line-height: 1.2;
  white-space: nowrap;
}

.wqc-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #d9e2f3;
  color: #1a2b33;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: inset 0 -1px 0 #9e9e9e;
  text-align: center;
}

.wqc-table tbody tr:nth-child(even) td {
  background: #f7f7f7;
}

.wqc-table tbody tr:hover td {
  background: #fff6d5;
}

.wqc-table .wqc-td-idx,
.wqc-table .wqc-td-code,
.wqc-table .wqc-td-a,
.wqc-table .wqc-td-b,
.wqc-table .wqc-td-gap {
  text-align: center;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

.wqc-table .wqc-td-name,
.wqc-table .wqc-td-group,
.wqc-table .wqc-td-unit,
.wqc-table .wqc-td-status {
  width: max-content;
  max-width: none;
  white-space: nowrap;
}

.wqc-table .wqc-td-status {
  text-align: center;
  font-weight: 700;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.wqc-table .wqc-td-status.is-zero_b {
  color: #7a4d00;
}

.wqc-table .wqc-td-status.is-diff {
  color: #7f1d1d;
}

.wqc-table .wqc-td-status.is-both {
  color: #14532d;
}

.wqc-table .wqc-td-a {
  color: #ca8a04;
  font-weight: 800;
}

.wqc-table .wqc-td-b {
  color: #15803d;
  font-weight: 800;
}

.wqc-table .wqc-td-gap {
  color: #7f1d1d;
  font-weight: 800;
}

.wqc-table .wqc-empty {
  text-align: center;
  color: #6b858f;
  padding: 1rem;
  white-space: normal;
}

.wqc-dash .wqc-empty-kpi {
  margin: 0 0 0.75rem;
}

.wqc-dash .wqc-clear-group {
  margin-inline-start: 0.35rem;
  font-weight: 800;
  text-decoration: underline;
}

.wqc-table tfoot .wqc-tfoot td {
  background: #d9e2f3;
  color: #1a2b33;
  font-weight: 800;
  position: sticky;
  bottom: 0;
  z-index: 2;
  box-shadow: inset 0 1px 0 #9e9e9e;
}

@media (max-width: 1100px) {
  .wqc-dash .wqc-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .wqc-dash .wqc-filter {
    grid-template-columns: 1fr 1fr;
  }

  .wqc-dash .wqc-pair-branches,
  .wqc-dash .wqc-pair-warehouses {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .wqc-dash .wqc-field-group,
  .wqc-dash .wqc-field-item,
  .wqc-dash .wqc-field-qty,
  .wqc-dash .wqc-field-mode {
    grid-column: auto;
    grid-row: auto;
  }

  .wqc-dash .wqc-field-actions {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .wqc-dash .wqc-filter,
  .wqc-dash .wqc-kpi-grid {
    grid-template-columns: 1fr;
  }

  .wqc-dash .wqc-pair-fields {
    grid-template-columns: 1fr;
  }

  .wqc-dash .wqc-pair-sep {
    min-height: auto;
    padding: 0.1rem 0;
  }
}

@media print {
  .wqc-dash .wqc-filter,
  .wqc-dash .wqc-kpi-grid,
  .wqc-dash .alert,
  .wqc-dash .dash-head,
  .wqc-sheet-actions,
  .sidebar,
  .sidebar-backdrop,
  .topbar {
    display: none !important;
  }

  .wqc-sheet {
    border: 0 !important;
  }

  .wqc-scroll {
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .wqc-table thead th {
    position: static !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
/* تعديل أسعار اليوم — مستوى 1 */
.price-changes-dash .unpriced-filter {
  grid-template-columns:
    minmax(7.2rem, 0.85fr)
    minmax(0, 1.15fr)
    minmax(0, 1.25fr)
    minmax(0, 1fr)
    minmax(0, 1fr)
    auto
    auto;
}

.price-changes-dash .pc-filter-label {
  color: #294f78;
  font-size: 0.7rem;
  font-weight: 800;
}

.price-changes-dash .pc-kpi-up {
  background: linear-gradient(135deg, #166534 0%, #16a34a 100%);
}
.price-changes-dash .pc-kpi-up .up-kpi-label,
.price-changes-dash .pc-kpi-up .up-kpi-hint {
  color: #dcfce7;
}

.price-changes-dash .pc-kpi-down {
  background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%);
}
.price-changes-dash .pc-kpi-down .up-kpi-label,
.price-changes-dash .pc-kpi-down .up-kpi-hint {
  color: #fee2e2;
}

.price-changes-dash .pc-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.2rem;
  padding: 0 0.7rem;
  border: 1px solid #c9d9eb;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.95);
  color: #294f78;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
}

.price-changes-dash .pc-check-label input[type="checkbox"] {
  width: 1rem;
  min-width: 1rem;
  height: 1rem;
  min-height: 1rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  accent-color: #166534;
  flex: 0 0 auto;
  cursor: pointer;
}

.price-changes-dash .pc-check-label:has(input[type="checkbox"]:checked) {
  border-color: #86efac;
  background: #ecfdf3;
  color: #14532d;
}

.price-changes-dash .pc-dir {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
}
.price-changes-dash .pc-dir-up {
  background: #ecfdf5;
  color: #15803d;
}
.price-changes-dash .pc-dir-down {
  background: #fef2f2;
  color: #b91c1c;
}
.price-changes-dash .pc-dir-same {
  background: #f1f5f9;
  color: #6b858f;
}
.price-changes-dash .up-table tbody tr.pc-row-up td {
  background: #f0fdf4;
}
.price-changes-dash .up-table tbody tr.pc-row-down td {
  background: #fef2f2;
}
.price-changes-dash .pc-table td.num {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .price-changes-dash .unpriced-filter .pc-day-field,
  .price-changes-dash .unpriced-filter .pc-changed-field {
    grid-column: 1 / -1;
  }
}

/* تسوية التكاليف — تجميع حسب المستند */
.cost-adj-dash .unpriced-filter {
  grid-template-columns:
    minmax(7rem, 0.9fr)
    minmax(7rem, 0.9fr)
    minmax(0, 1.1fr)
    minmax(0, 1.2fr)
    minmax(0, 1fr)
    minmax(0, 1fr)
    minmax(0, 1fr)
    auto;
}

.cost-adj-dash .cadj-table,
.cost-adjustments-dash .ca-table {
  min-width: 72rem;
}

.cost-adj-dash .cadj-table td.num,
.cost-adjustments-dash .ca-table td.num {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cost-adj-dash .cadj-doc-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent, #0891b2);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  padding: 0;
}

.cost-adj-dash .cadj-doc-btn:hover,
.cost-adj-dash .cadj-doc-btn:focus-visible {
  color: var(--accent-strong, #115e59);
}

.cost-adj-dash tr.cadj-doc-row.is-open > td {
  background: color-mix(in srgb, #0891b2 8%, transparent);
}

.cost-adj-dash tr.cadj-lines-row > td {
  padding: 0.55rem 0.65rem 0.85rem;
  background: color-mix(in srgb, #1a2b33 3%, #fff);
  border-top: 0;
}

.cost-adj-dash .cadj-lines-wrap {
  overflow-x: auto;
}

.cost-adj-dash .cadj-lines-table {
  min-width: 48rem;
  width: 100%;
  margin: 0;
}

.cost-adj-dash .cadj-lines-table thead th {
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .cost-adj-dash .unpriced-filter .up-field-actions {
    grid-column: 1 / -1;
  }
}

.turn-dash .turn-rule {
  margin: 0.35rem 0 0.85rem;
}

.turn-dash .turn-band-dead { color: #e11d48; font-weight: 700; }
.turn-dash .turn-band-slow { color: #b45309; font-weight: 700; }
.turn-dash .turn-band-ok { color: #047857; font-weight: 700; }
.turn-dash .turn-band-fast { color: #0e7490; font-weight: 700; }
.turn-dash .turn-band-out { color: #6d28d9; font-weight: 700; }
.turn-dash .turn-age-fresh { color: #047857; font-weight: 700; }
.turn-dash .turn-age-mid { color: #a16207; font-weight: 700; }
.turn-dash .turn-age-warm { color: #c2410c; font-weight: 700; }
.turn-dash .turn-age-hot { color: #dc2626; font-weight: 700; }
.turn-dash .turn-age-stale { color: #7f1d1d; font-weight: 800; }
.turn-dash .turn-age-out { color: #6d28d9; font-weight: 700; }
.turn-dash .turn-motion-great { color: #047857; font-weight: 700; }
.turn-dash .turn-motion-good { color: #1d4ed8; font-weight: 700; }
.turn-dash .turn-motion-watch { color: #a16207; font-weight: 700; }
.turn-dash .turn-motion-risk { color: #c2410c; font-weight: 700; }
.turn-dash .turn-motion-danger { color: #dc2626; font-weight: 700; }
.turn-dash .turn-motion-stopped { color: #7f1d1d; font-weight: 800; }
.turn-dash .turn-alerts {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
}
.turn-dash .turn-alert {
  display: block;
  border-radius: 0.5rem;
  padding: 0.45rem 0.7rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.turn-dash a.turn-alert.is-on {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}
.turn-dash .turn-alert-watch { background: #fef3c7; color: #92400e; }
.turn-dash .turn-alert-risk { background: #ffedd5; color: #9a3412; }
.turn-dash .turn-alert-danger { background: #fee2e2; color: #991b1b; }
.turn-dash .turn-alert-stopped { background: #ffe4e6; color: #881337; }
.turn-dash .turn-alert-great { background: #dcfce7; color: #166534; }
.turn-dash .turn-alert-good { background: #dbeafe; color: #1e40af; }
.turn-dash .turn-alert-neutral { background: #f1f5f9; color: #334155; }
.turn-dash .turn-status-chips {
  display: flex;
  flex-wrap: wrap;
}
.turn-dash .turn-status-chips .turn-alert {
  display: inline-block;
}
.turn-dash .turn-sub {
  display: block;
  font-size: 0.78em;
  font-weight: 400;
  opacity: 0.72;
  white-space: nowrap;
}
.turn-dash .turn-bar {
  display: block;
  width: 4.5rem;
  height: 0.3rem;
  margin-top: 0.2rem;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.22);
  overflow: hidden;
}
.turn-dash .turn-bar > span {
  display: block;
  height: 100%;
  background: #0ea5e9;
}
.turn-dash .turn-pages {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.6rem;
  margin-bottom: 0.25rem;
  padding-inline-end: 4.75rem;
}

.turn-dash .turn-insight-pages button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: #60a5fa;
  cursor: pointer;
}

.page.turn-dash {
  padding-bottom: 5rem;
}

.page.turn-dash .table-wrap {
  overflow-x: auto;
  overflow-y: clip;
  overscroll-behavior: auto;
}

.turn-dash .turn-group-link {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.is-pannable,
.is-pannable th,
.is-pannable td {
  cursor: grab;
  touch-action: pan-y;
}
.is-pannable a,
.is-pannable button,
.is-pannable input,
.is-pannable select,
.is-pannable textarea,
.is-pannable label {
  cursor: pointer;
  touch-action: auto;
}
.is-panning,
.is-panning th,
.is-panning td,
.is-panning a {
  cursor: grabbing;
  user-select: none;
}
