/* سامانه ارتباط با مشتریان هگزان — هویت بصری HEAXON */
:root {
  --bg: #f3f0f8;
  --bg-soft: #eae6f4;
  --surface: #ffffff;
  --surface-2: #f7f5fb;
  --border: rgba(45, 40, 105, 0.12);
  --text: #1c1833;
  --muted: #6e6788;
  --accent: #814392;
  --accent-2: #2d2869;
  --accent-soft: rgba(129, 67, 146, 0.12);
  --brand-navy: #1d1b63;
  --brand-indigo: #2d2869;
  --brand-purple: #814392;
  --warn: #d97706;
  --danger: #dc2626;
  --ok: #16a34a;
  --info: #6d28d9;
  --urgent: #dc2626;
  --high: #d97706;
  --medium: #6d28d9;
  --low: #64748b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 14px 32px rgba(29, 27, 99, .1);
  --sidebar: 260px;
  --font: 'Vazirmatn', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(129, 67, 146, .1), transparent 52%),
    radial-gradient(ellipse 60% 40% at -10% 100%, rgba(45, 40, 105, .08), transparent 48%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #5c2f75; }
img, video { max-width: 100%; }

/* Auth — Dark cinematic theme */
.auth-body.auth-dark {
  min-height: 100vh;
  background: #05040c;
  color: #f0ecfa;
  overflow-x: hidden;
}
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
#authCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .55;
}
.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(192,132,252,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(192,132,252,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 20%, transparent 75%);
  animation: authGridDrift 24s linear infinite;
}
@keyframes authGridDrift {
  from { transform: translate(0, 0); }
  to { transform: translate(48px, 48px); }
}
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .45;
  animation: authOrbFloat 12s ease-in-out infinite alternate;
}
.auth-orb-1 {
  width: 420px; height: 420px;
  top: -8%; right: 10%;
  background: radial-gradient(circle, rgba(129,67,146,.55), transparent 70%);
}
.auth-orb-2 {
  width: 360px; height: 360px;
  bottom: 5%; left: -5%;
  background: radial-gradient(circle, rgba(45,40,105,.6), transparent 70%);
  animation-delay: -4s;
}
.auth-orb-3 {
  width: 280px; height: 280px;
  top: 40%; left: 35%;
  background: radial-gradient(circle, rgba(192,132,252,.35), transparent 70%);
  animation-delay: -7s;
}
@keyframes authOrbFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(24px, -18px) scale(1.08); }
}
.auth-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { min-height: auto; order: -1; padding: 2rem 1.25rem 1rem; }
  .auth-logo-hero { width: min(118px, 28vw) !important; }
  .auth-logo-hex-frame { transform-origin: 50% 36%; }
  .auth-features { grid-template-columns: 1fr 1fr; gap: .65rem; }
}
@media (max-width: 520px) {
  .auth-features { grid-template-columns: 1fr; }
}
.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 2.5rem;
  text-align: center;
}
.auth-brand-block {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise .55s ease both;
}
.auth-logo-stage {
  position: relative;
  display: inline-block;
  padding: .35rem 0 1rem;
  margin-bottom: .15rem;
}
.auth-logo-glow {
  position: absolute;
  top: 18%;
  left: 50%;
  width: 88%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 50% 50%, rgba(142,68,173,.38) 0%, rgba(46,46,120,.18) 45%, transparent 72%);
  filter: blur(16px);
  pointer-events: none;
  animation: logoGlowBreath 5s ease-in-out infinite;
}
@keyframes logoGlowBreath {
  0%, 100% { opacity: .65; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}
.auth-logo-hex-frame {
  position: absolute;
  top: 1.5%;
  left: 50%;
  width: 78%;
  transform: translateX(-50%) scale(3);
  transform-origin: 50% 38%;
  aspect-ratio: 1;
  z-index: 3;
  pointer-events: none;
  animation: hexFrameBreathe 5s ease-in-out 2s infinite;
}
@keyframes hexFrameBreathe {
  0%, 100% { transform: translateX(-50%) scale(3); }
  50% { transform: translateX(-50%) scale(3.045); }
}
.auth-logo-hex {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.auth-hex-line {
  fill: none;
  stroke: url(#hexGrad);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  animation:
    hexDraw 1.6s cubic-bezier(.4, 0, .2, 1) .2s forwards,
    hexLinePulse 3.2s ease-in-out 1.9s infinite;
}
.auth-hex-glow {
  fill: none;
  stroke: rgba(192,132,252,.35);
  stroke-width: 5;
  stroke-linejoin: round;
  filter: blur(3px);
  opacity: 0;
  animation:
    hexGlowIn 1.2s ease 1s forwards,
    hexGlowPulse 2.8s ease-in-out 2.1s infinite;
}
.auth-hex-shimmer {
  fill: none;
  stroke: rgba(255,255,255,.9);
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 36 484;
  stroke-dashoffset: 520;
  opacity: 0;
  filter: drop-shadow(0 0 5px rgba(233,213,255,.85));
  animation: hexShimmerLoop 4.5s linear 1.9s infinite;
}
@keyframes hexDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes hexGlowIn {
  to { opacity: .5; }
}
@keyframes hexLinePulse {
  0%, 100% { opacity: .78; }
  50% { opacity: 1; }
}
@keyframes hexGlowPulse {
  0%, 100% { opacity: .32; filter: blur(3px); }
  50% { opacity: .62; filter: blur(5px); }
}
@keyframes hexShimmerLoop {
  0% { stroke-dashoffset: 520; opacity: 0; }
  4% { opacity: .95; }
  96% { opacity: .95; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
.auth-logo-hero {
  position: relative;
  z-index: 2;
  width: min(128px, 26vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 22px rgba(46,46,120,.5)) drop-shadow(0 0 18px rgba(142,68,173,.2));
  animation: logoFloat 5.5s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.auth-logo-reflect {
  position: absolute;
  bottom: .2rem;
  left: 50%;
  width: 55%;
  height: 10px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(142,68,173,.3) 0%, transparent 72%);
  filter: blur(5px);
  pointer-events: none;
  animation: logoReflect 5.5s ease-in-out infinite;
}
@keyframes logoReflect {
  0%, 100% { opacity: .45; transform: translateX(-50%) scaleX(1); }
  50% { opacity: .75; transform: translateX(-50%) scaleX(1.05); }
}
.auth-brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: brandTextIn .7s ease .35s both;
}
@keyframes brandTextIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.auth-tagline {
  margin: 1.1rem 0 0 !important;
  color: #f5f3fa !important;
  font-size: 1.08rem !important;
  font-weight: 600;
  max-width: none !important;
  letter-spacing: .01em;
}
.auth-slogan-wrap {
  position: relative;
  margin-top: .55rem;
  padding-bottom: .45rem;
}
.auth-slogan {
  margin: 0 !important;
  background: linear-gradient(90deg, #f3e8ff, #c084fc, #a855f7, #c084fc, #f3e8ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  font-size: 1.18rem !important;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  max-width: none !important;
  animation: sloganShift 6s linear infinite;
}
@keyframes sloganShift {
  to { background-position: 200% center; }
}
.auth-slogan-line {
  display: block;
  width: 48px;
  height: 2px;
  margin: .45rem auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #c084fc, #814392, transparent);
  animation: lineExpand .8s ease .9s both;
}
@keyframes lineExpand {
  from { width: 0; opacity: 0; }
  to { width: 48px; opacity: 1; }
}
.auth-slogan-fa {
  margin: .55rem 0 0 !important;
  color: rgba(245,243,250,.68) !important;
  font-size: .88rem !important;
  font-weight: 500;
  max-width: none !important;
  font-style: italic;
}
.auth-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
  width: 100%;
  max-width: 480px;
  margin-top: 2.25rem;
  animation: rise .6s ease .15s both;
}
.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  text-align: right;
  padding: .95rem 1rem;
  border-radius: 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(192,132,252,.14);
  backdrop-filter: blur(12px);
  transition: transform .25s ease, border-color .25s, box-shadow .25s, background .25s;
  cursor: default;
  position: relative;
  overflow: hidden;
}
.auth-feature::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(192,132,252,.12), transparent 55%);
  opacity: 0;
  transition: opacity .25s;
}
.auth-feature:hover {
  border-color: rgba(192,132,252,.45);
  box-shadow:
    0 8px 32px rgba(129,67,146,.22),
    inset 0 1px 0 rgba(255,255,255,.06);
  background: rgba(255,255,255,.07);
}
.auth-feature:hover::before { opacity: 1; }
.auth-feature-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(129,67,146,.4));
  transition: transform .3s ease;
}
.auth-feature:hover .auth-feature-icon {
  transform: scale(1.15) rotate(-6deg);
}
.auth-feature strong {
  display: block;
  font-size: .88rem;
  font-weight: 700;
  color: #f5f3fa;
  margin-bottom: .15rem;
}
.auth-feature span {
  display: block;
  font-size: .75rem;
  color: rgba(212,207,232,.72);
  line-height: 1.45;
}
.auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card.auth-glass {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(12, 10, 24, .72);
  border: 1px solid rgba(192,132,252,.18);
  border-radius: 24px;
  padding: 1.85rem 1.65rem 1.5rem;
  backdrop-filter: blur(24px);
  box-shadow:
    0 24px 64px rgba(0,0,0,.45),
    0 0 0 1px rgba(255,255,255,.04) inset,
    0 0 80px rgba(129,67,146,.08);
  animation: rise .5s ease .08s both;
  overflow: hidden;
}
.auth-card-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(192,132,252,.06), transparent 30%);
  animation: authCardShine 8s linear infinite;
  pointer-events: none;
}
@keyframes authCardShine {
  to { transform: rotate(360deg); }
}
.auth-card-brand {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 1.2rem;
  padding: .85rem 1rem;
  background: rgba(0,0,0,.35);
  border-radius: 14px;
  border: 1px solid rgba(129,67,146,.28);
}
.auth-logo-card {
  height: 46px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(129,67,146,.3));
}
.auth-card h1 {
  position: relative;
  font-size: 1.35rem;
  margin: 0 0 .35rem;
  font-weight: 700;
  text-align: center;
  color: #faf8ff;
}
.auth-card .sub {
  position: relative;
  color: rgba(212,207,232,.75);
  margin: 0 0 1.25rem;
  font-size: .88rem;
  text-align: center;
}
.auth-dark .auth-field-glow label {
  color: rgba(212,207,232,.85);
}
.auth-dark .auth-field-glow input {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(192,132,252,.18);
  color: #f5f3fa;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth-dark .auth-field-glow input::placeholder {
  color: rgba(212,207,232,.4);
}
.auth-dark .auth-field-glow input:focus {
  background: rgba(255,255,255,.08);
  border-color: rgba(192,132,252,.55);
  box-shadow: 0 0 0 3px rgba(129,67,146,.2), 0 0 24px rgba(129,67,146,.15);
}
.auth-dark .auth-field-glow.is-focused {
  animation: fieldGlow .4s ease;
}
@keyframes fieldGlow {
  0% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
  100% { filter: brightness(1); }
}
.auth-submit {
  width: 100%;
  margin-top: .25rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #9b4db8 0%, #814392 40%, #2d2869 100%) !important;
  border: 1px solid rgba(192,132,252,.3) !important;
  box-shadow: 0 10px 30px rgba(129,67,146,.35) !important;
}
.auth-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: authBtnShimmer 3s ease-in-out infinite;
}
@keyframes authBtnShimmer {
  0%, 70%, 100% { transform: translateX(-100%); }
  85% { transform: translateX(100%); }
}
.auth-submit:hover {
  box-shadow: 0 14px 36px rgba(129,67,146,.5) !important;
  transform: translateY(-1px);
}
.auth-dark .flash-error {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.35);
  color: #fca5a5;
}
.auth-dark .flash-success,
.auth-flash-success {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.32);
  color: #86efac;
}
.auth-dark .flash-success svg,
.auth-flash-success svg {
  flex-shrink: 0;
  margin-top: .1rem;
  color: #4ade80;
}
.auth-page-centered {
  grid-template-columns: 1fr;
  place-items: center;
  padding: 2rem 1rem;
}
.auth-page-centered .auth-panel {
  width: 100%;
  max-width: 460px;
  padding: 0;
}
.auth-recovery-card {
  text-align: center;
}
.auth-recovery-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(192,132,252,.22), rgba(45,40,105,.35));
  border: 1px solid rgba(192,132,252,.28);
  color: #e9d5ff;
  box-shadow: 0 8px 28px rgba(129,67,146,.25);
}
.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  margin: 0 0 1.35rem;
  padding: .65rem .5rem;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(192,132,252,.1);
}
.auth-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  min-width: 0;
  flex: 1;
  opacity: .45;
  transition: opacity .25s;
}
.auth-step.is-active {
  opacity: 1;
}
.auth-step-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(192,132,252,.2);
  color: rgba(212,207,232,.75);
}
.auth-step.is-active .auth-step-num {
  background: linear-gradient(135deg, #9b4db8, #814392);
  border-color: rgba(192,132,252,.45);
  color: #fff;
  box-shadow: 0 4px 14px rgba(129,67,146,.35);
}
.auth-step-label {
  font-size: .68rem;
  font-weight: 600;
  color: rgba(212,207,232,.65);
  white-space: nowrap;
}
.auth-step.is-active .auth-step-label {
  color: #f5f3fa;
}
.auth-step-line {
  flex: 0 0 18px;
  height: 2px;
  border-radius: 999px;
  background: rgba(192,132,252,.18);
  margin-bottom: 1.1rem;
}
.auth-back-link a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: rgba(212,207,232,.75);
  font-weight: 600;
  font-size: .82rem;
  transition: color .2s;
}
.auth-back-link a:hover {
  color: #c084fc;
}
.auth-recovery-card .auth-form {
  text-align: right;
}
.auth-recovery-card .auth-submit {
  text-decoration: none;
}
.auth-dark .btn-ghost {
  width: 100%;
  margin-top: .85rem;
  color: rgba(212,207,232,.85);
  border-color: rgba(192,132,252,.22);
  background: rgba(255,255,255,.03);
}
.auth-dark .btn-ghost:hover {
  background: rgba(192,132,252,.1);
  color: #fff;
  border-color: rgba(192,132,252,.4);
}
.auth-foot .slogan-en {
  color: #c084fc;
  font-weight: 700;
  letter-spacing: .06em;
}
.auth-foot {
  position: relative;
  margin: 1.15rem 0 0;
  text-align: center;
  font-size: .75rem;
  color: rgba(212,207,232,.55);
}
.auth-pwa-strip {
  width: 100%;
  max-width: 420px;
  margin-top: .85rem;
  animation: rise .45s ease .2s both;
}
.auth-pwa-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: fit-content;
  max-width: 100%;
  margin: .85rem auto 0;
  padding: .42rem .85rem .42rem .55rem;
  border-radius: 999px;
  border: 1px solid rgba(192,132,252,.28);
  background: rgba(129,67,146,.14);
  backdrop-filter: blur(10px);
  color: #ece8f7;
  cursor: pointer;
  font-family: inherit;
  text-align: right;
  overflow: hidden;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .15s, color .2s;
}
.auth-pwa-btn--mini {
  box-shadow: 0 4px 14px rgba(129,67,146,.12);
}
.auth-pwa-btn-glow { display: none; }
.auth-pwa-btn:hover {
  background: rgba(129,67,146,.24);
  border-color: rgba(192,132,252,.5);
  box-shadow: 0 6px 18px rgba(129,67,146,.2);
  transform: translateY(-1px);
  color: #fff;
}
.auth-pwa-btn:active { transform: scale(.98); }
.auth-pwa-btn.is-ready {
  border-color: rgba(167,243,208,.4);
  background: rgba(16,185,129,.12);
}
.auth-pwa-btn.is-ready .auth-pwa-btn-icon {
  background: rgba(52,211,153,.22);
  color: #bbf7d0;
}
.auth-pwa-btn-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(192,132,252,.2);
  color: #e9d5ff;
}
.auth-pwa-btn-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  min-width: 0;
  flex: 0 1 auto;
}
.auth-pwa-btn-text strong {
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: 0;
  white-space: nowrap;
}
.auth-pwa-btn-text small {
  display: none;
}
.auth-pwa-btn-chevron { display: none; }
.auth-feature-pwa.is-installable {
  border-color: rgba(192,132,252,.45);
  box-shadow: 0 0 24px rgba(129,67,146,.2);
  cursor: pointer;
}
.auth-feature-pwa.is-installable::after {
  content: 'نصب';
  position: absolute;
  top: .55rem;
  left: .65rem;
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .4rem;
  border-radius: 999px;
  background: rgba(129,67,146,.85);
  color: #fff;
}
.pwa-guide-bg {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(6,5,14,.72);
  backdrop-filter: blur(8px);
}
.pwa-guide-bg[hidden] { display: none !important; }
.pwa-guide-modal {
  position: relative;
  width: min(100%, 380px);
  padding: 1.5rem 1.25rem 1.2rem;
  border-radius: 20px;
  background: linear-gradient(160deg, #161328, #0d0c18);
  border: 1px solid rgba(192,132,252,.25);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  color: #f5f3fa;
  text-align: center;
}
.pwa-guide-close {
  position: absolute;
  top: .55rem;
  left: .65rem;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  color: #e9d5ff;
  font-size: 1.25rem;
  cursor: pointer;
}
.pwa-guide-icon {
  display: grid;
  place-items: center;
  margin: 0 auto .55rem;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(192,132,252,.25), rgba(45,40,105,.4));
  color: #e9d5ff;
}
.pwa-guide-modal h3 {
  margin: 0 0 .5rem;
  font-size: 1.1rem;
}
.pwa-guide-body {
  margin: 0 0 .85rem;
  color: rgba(212,207,232,.78);
  font-size: .88rem;
  line-height: 1.6;
}
.pwa-guide-steps {
  margin: 0 0 1.1rem;
  padding: 0 1.1rem 0 0;
  text-align: right;
  color: rgba(245,243,250,.9);
  font-size: .86rem;
  line-height: 1.75;
}
.pwa-guide-ok { width: 100%; }
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #9b4db8, #814392);
  color: #fff;
  animation: pwaBadgePulse 2s ease-in-out infinite;
}
@keyframes pwaBadgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192,132,252,.4); }
  50% { box-shadow: 0 0 0 6px rgba(192,132,252,0); }
}
.auth-visual .brand {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 0;
  line-height: 1.1;
}
.auth-visual .brand-en {
  margin: .35rem 0 0;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .28em;
  color: #d4a3e8;
}
.auth-visual p {
  color: rgba(241,245,249,.85);
  max-width: 28ch;
  font-size: 1.05rem;
  margin: .75rem 0 0;
}
@media (prefers-reduced-motion: reduce) {
  .auth-grid, .auth-orb, .auth-logo-glow, .auth-logo-reflect, .auth-logo-hex-frame,
  .auth-hex-shimmer, .auth-slogan, .auth-card-shine, .auth-submit::before {
    animation: none !important;
  }
  .auth-logo-hero { animation: none; }
  .auth-hex-line { stroke-dashoffset: 0; animation: none; opacity: 1; }
  .auth-hex-glow { opacity: .5; animation: none; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Layout */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  background: #0a0914;
  border-left: 1px solid rgba(192, 132, 252, 0.18);
  color: #f5f3fa;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .25s ease;
}
.sidebar .logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem 1.25rem;
  border-bottom: 1px solid rgba(192, 132, 252, 0.16);
  margin-bottom: 1rem;
  color: inherit;
}
.sidebar .logo:hover { color: inherit; }
.sidebar .logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  background: transparent;
  flex-shrink: 0;
}
.sidebar .logo-mark {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #9b4db8, #1d1b63);
  display: grid; place-items: center;
  font-weight: 800; color: #ffffff; font-size: 1.1rem;
  box-shadow: 0 8px 20px rgba(155,77,184,.35);
}
.sidebar .logo-text { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.sidebar .logo-sub { font-size: .72rem; color: #c4b5fd; display: block; font-weight: 500; }
.nav-list { list-style: none; padding: 0; margin: 0; flex: 1; overflow-y: auto; }
.nav-list a {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .9rem; border-radius: 12px;
  color: #d4d0e6; font-weight: 500; font-size: .92rem;
  margin-bottom: .2rem; transition: .15s ease;
}
.nav-list a:hover { background: rgba(192,132,252,.12); color: #ffffff; }
.nav-list a.active {
  background: rgba(129,67,146,.22);
  color: #ffffff;
  border-right: 3px solid #c084fc;
}
.nav-list .icon { width: 20px; text-align: center; opacity: .9; }
.sidebar-foot {
  border-top: 1px solid rgba(192, 132, 252, 0.16);
  padding-top: 1rem;
  margin-top: .5rem;
}
.user-chip {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .65rem;
  border-radius: 12px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(192, 132, 252, 0.14);
}
.avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #9b4db8, #1d1b63);
  display: grid; place-items: center;
  font-weight: 700; font-size: .85rem; color: #fff;
  flex-shrink: 0;
}
.user-chip .meta { font-size: .78rem; color: #c4b5fd; }
.user-chip .name { font-weight: 600; font-size: .88rem; color: #ffffff; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar h1 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.live-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 700;
  color: #86efac;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.25);
  border-radius: 999px;
  padding: .28rem .65rem;
}
.live-status::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,.6);
  animation: livePulse 1.6s infinite;
}
.live-status.is-offline {
  color: #fca5a5;
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.25);
}
.live-status.is-offline::before {
  background: #ef4444;
  animation: none;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); }
  70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.content { padding: 1.5rem; flex: 1; }

.menu-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: .45rem .7rem;
  cursor: pointer;
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    right: 0; top: 0;
    transform: translateX(105%);
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .menu-toggle { display: inline-flex; }
  .sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 35;
  }
  .sidebar-backdrop.show { display: block; }
}

/* Cards / panels */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  position: relative;
  overflow: hidden;
  animation: rise .45s ease both;
}
.stat:nth-child(2) { animation-delay: .05s; }
.stat:nth-child(3) { animation-delay: .1s; }
.stat:nth-child(4) { animation-delay: .15s; }
.stat::after {
  content: '';
  position: absolute;
  inset-inline-start: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}
.stat .label { color: var(--muted); font-size: .85rem; margin-bottom: .35rem; }
.stat .value { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.stat .hint { font-size: .75rem; color: var(--muted); margin-top: .25rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.panel-body { padding: 1.25rem; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid .full { grid-column: 1 / -1; }

label {
  display: block;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .35rem;
  font-weight: 500;
}
input, select, textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: .7rem .9rem;
  font-family: inherit;
  font-size: .92rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input[type="checkbox"],
input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  min-width: 1.05rem;
  padding: 0;
  margin: 0;
  accent-color: var(--accent);
  background: transparent;
  border: none;
  border-radius: 4px;
  box-shadow: none;
  cursor: pointer;
  flex-shrink: 0;
}
input[type="checkbox"]:focus,
input[type="radio"]:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: transparent;
}
textarea { min-height: 100px; resize: vertical; }
.field { margin-bottom: .25rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: .9rem;
  padding: .7rem 1.2rem;
  border-radius: 12px;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(135deg, #814392, #2d2869);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(129,67,146,.28);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(129,67,146,.4); color: #ffffff; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.sidebar .btn-ghost {
  color: #e9e4f5;
  border-color: rgba(192, 132, 252, 0.28);
}
.sidebar .btn-ghost:hover {
  background: rgba(192,132,252,.14);
  color: #fff;
}
.btn-danger { background: rgba(239,68,68,.15); color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.btn-sm { padding: .4rem .75rem; font-size: .8rem; border-radius: 8px; }
.btn-icon {
  width: 40px; height: 40px; padding: 0;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  position: relative;
}

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .85rem 1rem; text-align: right; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: .78rem; letter-spacing: .02em; }
tr:hover td { background: rgba(129,67,146,.04); }
.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
}
.badge-urgent { background: rgba(239,68,68,.12); color: #b91c1c; }
.badge-high { background: rgba(245,158,11,.14); color: #b45309; }
.badge-medium { background: rgba(129,67,146,.12); color: #6b21a8; }
.badge-low { background: rgba(100,116,139,.12); color: #475569; }
.badge-open { background: rgba(109,40,217,.1); color: #5b21b6; }
.badge-in_progress { background: rgba(245,158,11,.14); color: #b45309; }
.badge-done { background: rgba(34,197,94,.12); color: #15803d; }
.badge-cancelled { background: rgba(100,116,139,.12); color: #475569; }
.badge-active { background: rgba(34,197,94,.12); color: #15803d; }
.badge-inactive { background: rgba(100,116,139,.12); color: #475569; }
.badge-pending { background: rgba(245,158,11,.14); color: #b45309; }

/* Flash */
.flash {
  padding: .85rem 1.1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  font-size: .9rem;
  animation: rise .3s ease;
}
.flash-success { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.28); color: #166534; }
.flash-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.28); color: #991b1b; }
.flash-info { background: rgba(129,67,146,.1); border: 1px solid rgba(129,67,146,.28); color: #5b21b6; }

/* Notifications bell */
.notif-wrap { position: relative; }
.notif-dot {
  position: absolute;
  top: 6px; left: 6px;
  width: 9px; height: 9px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.notif-dropdown {
  display: none;
  position: absolute;
  left: 0; top: calc(100% + 8px);
  width: 340px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 50;
}
.notif-dropdown.open { display: block; animation: rise .2s ease; }
.notif-item {
  display: block;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.notif-item:hover { background: rgba(255,255,255,.03); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item .t { font-weight: 600; font-size: .88rem; }
.notif-item .b { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.notif-item .time { font-size: .72rem; color: var(--muted); margin-top: .3rem; }

/* Chat */
.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  height: calc(100vh - 140px);
  min-height: 480px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
@media (max-width: 800px) {
  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(140px, 32vh) minmax(0, 1fr);
    height: calc(100dvh - 130px);
    min-height: 70vh;
  }
  .chat-list { max-height: none; overflow-y: auto; }
}
.chat-list {
  border-left: 1px solid var(--border);
  overflow-y: auto;
  background: var(--bg-soft);
}
.chat-list-head {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky; top: 0;
  background: var(--bg-soft);
  z-index: 2;
}
.conv-item {
  display: block;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}
.conv-item:hover, .conv-item.active { background: var(--accent-soft); }
.conv-item.has-unread .title { color: #f8fafc; font-weight: 800; }
.conv-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.conv-item .title { font-weight: 600; font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item .meta { font-size: .75rem; color: var(--muted); margin-top: .25rem; }
.unread-badge {
  flex-shrink: 0;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #9b4db8, #814392);
  color: #ffffff;
  font-size: .72rem;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.chat-header {
  padding: .9rem 1.15rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-shrink: 0;
}
.chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  background:
    radial-gradient(circle at 10% 20%, rgba(155,77,184,.05), transparent 40%),
    var(--surface);
}
.msg {
  max-width: min(75%, 560px);
  padding: .75rem 1rem;
  border-radius: 14px;
  animation: rise .25s ease;
}
.msg.mine {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(129,67,146,.14), rgba(45,40,105,.08));
  border: 1px solid rgba(129,67,146,.22);
  border-bottom-right-radius: 4px;
}
.msg.theirs {
  align-self: flex-end;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg .sender { font-size: .75rem; color: var(--accent); font-weight: 600; margin-bottom: .25rem; }
.msg .body { white-space: pre-wrap; word-break: break-word; font-size: .92rem; line-height: 1.65; color: var(--text); }
.msg .time { font-size: .7rem; color: var(--muted); margin-top: .4rem; display: flex; align-items: center; gap: .35rem; justify-content: space-between; }
.msg-ticks {
  font-size: .72rem;
  letter-spacing: -.12em;
  font-weight: 700;
  margin-right: .15rem;
}
.msg-ticks.tick-sent { color: #94a3b8; }
.msg-ticks.tick-read { color: #814392; }
.msg-attachments { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.att {
  display: flex; align-items: center; gap: .5rem;
  background: rgba(129,67,146,.08);
  border-radius: 10px;
  padding: .45rem .65rem;
  font-size: .8rem;
  color: var(--text);
  max-width: 100%;
}
.att img, .att video {
  max-width: 220px;
  max-height: 180px;
  border-radius: 10px;
  display: block;
}
.att audio { width: min(260px, 100%); }
.att-file {
  border: 1px solid var(--border);
}
.att .ext {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: .65rem; font-weight: 800;
  background: var(--accent-soft); color: var(--accent);
}

.chat-composer {
  border-top: 1px solid var(--border);
  padding: .85rem 1rem;
  background: var(--bg-soft);
  flex-shrink: 0;
}
.composer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .6rem;
}
.tool-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: .35rem .65rem;
  font-size: .75rem;
  cursor: pointer;
  font-family: inherit;
}
.tool-btn:hover { color: var(--accent); border-color: var(--accent); }
.composer-row {
  display: flex;
  gap: .6rem;
  align-items: flex-end;
}
.composer-row textarea {
  flex: 1;
  min-height: 48px;
  max-height: 140px;
}
.file-preview {
  display: flex; flex-wrap: wrap; gap: .4rem;
  margin-bottom: .5rem;
}
.file-chip {
  font-size: .75rem;
  background: var(--accent-soft);
  color: #d4a3e8;
  padding: .25rem .55rem;
  border-radius: 8px;
  display: inline-flex; align-items: center; gap: .35rem;
}

.chat-upload-progress {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 .65rem;
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(120deg, rgba(155,77,184,.12), rgba(45,40,105,.08)),
    var(--surface);
}
.chat-upload-progress[hidden] { display: none !important; }
.chat-upload-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(155,77,184,.22);
  border-top-color: var(--accent, #9b4db8);
  flex-shrink: 0;
  animation: chat-upload-spin .7s linear infinite;
}
.chat-upload-body { flex: 1; min-width: 0; }
.chat-upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .4rem;
}
.chat-upload-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
}
.chat-upload-pct {
  font-size: .82rem;
  font-weight: 800;
  color: var(--accent, #9b4db8);
  font-variant-numeric: tabular-nums;
  min-width: 2.6rem;
  text-align: left;
}
.chat-upload-track {
  height: 8px;
  background: rgba(148,163,184,.18);
  border-radius: 999px;
  overflow: hidden;
}
.chat-upload-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #9b4db8, #2d2869);
  transition: width .15s ease;
}
.chat-upload-name {
  margin-top: .35rem;
  font-size: .72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-upload-progress.is-processing .chat-upload-fill {
  background: linear-gradient(90deg, #9b4db8, #6d5ad1, #9b4db8);
  background-size: 200% 100%;
  animation: chat-upload-shine 1.1s linear infinite;
}
@keyframes chat-upload-spin {
  to { transform: rotate(360deg); }
}
@keyframes chat-upload-shine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Customer profile */
.profile-hero {
  background:
    linear-gradient(120deg, rgba(155,77,184,.2), rgba(29,27,99,.12)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  animation: rise .4s ease;
}
.profile-hero h1 { margin: 0 0 .35rem; font-size: 1.4rem; }
.profile-hero .meta-row {
  display: flex; flex-wrap: wrap; gap: .75rem 1.25rem;
  color: var(--muted); font-size: .88rem; margin-top: .75rem;
}
.tabs {
  display: flex; gap: .35rem; flex-wrap: wrap;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .5rem;
}
.tab {
  padding: .5rem 1rem;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: .88rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.tab.active, .tab:hover { background: var(--accent-soft); color: var(--accent); }

.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sr-only { position: absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

.modal-bg {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 100;
  place-items: center;
  padding: 1rem;
}
.modal-bg.open { display: grid; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  animation: rise .25s ease;
}
.modal h3 { margin: 0 0 1rem; }

.search-box { max-width: 280px; }

.priority-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-left: .35rem;
}
.priority-dot.urgent { background: var(--urgent); }
.priority-dot.high { background: var(--high); }
.priority-dot.medium { background: var(--medium); }
.priority-dot.low { background: var(--low); }

/* Progress */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-top: .55rem;
}
.progress-track {
  flex: 1;
  height: 8px;
  background: rgba(148,163,184,.18);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #9b4db8, #2d2869);
  border-radius: 999px;
  transition: width .25s ease;
}
.progress-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 2.5rem;
}
.progress-edit { min-width: 150px; }
.progress-edit-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .45rem;
  flex-wrap: wrap;
}
.progress-edit-row input[type=number] {
  width: 72px;
  padding: .35rem .5rem;
  font-size: .85rem;
}
.progress-hero {
  margin-top: 1rem;
  max-width: 420px;
}
.progress-hero .progress-wrap { margin-top: .25rem; }

/* جدول کارها */
.tasks-table {
  width: 100%;
  min-width: 980px;
  table-layout: fixed;
}
.tasks-table th,
.tasks-table td {
  vertical-align: middle;
  padding: .75rem .7rem;
}
.tasks-table thead th {
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.tasks-table .col-title { width: 22%; }
.tasks-table .col-customer { width: 13%; }
.tasks-table .col-cat { width: 10%; }
.tasks-table .col-priority { width: 7%; }
.tasks-table .col-due { width: 8%; }
.tasks-table .col-assignee { width: 10%; }
.tasks-table .col-progress { width: 14%; }
.tasks-table .col-status { width: 8%; }
.tasks-table .col-actions { width: 8%; }
.task-title-cell {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
}
.task-title-body { min-width: 0; }
.task-title-body a { color: var(--text); }
.task-title-body a:hover { color: var(--accent); }
.task-code {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-top: .15rem;
}
.task-excerpt {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .25rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.progress-edit--table { min-width: 0; width: 100%; }
.progress-edit--table .progress-wrap { margin-top: 0; gap: .4rem; }
.progress-edit--table .progress-track { height: 7px; }
.progress-edit--table .progress-label {
  min-width: 2.1rem;
  font-size: .72rem;
}
.progress-edit--table .progress-edit-row {
  margin-top: .4rem;
  flex-wrap: nowrap;
}
.progress-edit--table .progress-edit-row input[type=number] {
  width: 54px;
  padding: .28rem .35rem;
  font-size: .78rem;
}
.status-edit { margin: 0; }
.status-select {
  width: 100%;
  max-width: 120px;
  padding: .4rem .5rem;
  font-size: .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.task-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .35rem;
  flex-wrap: wrap;
}
.task-row-actions form { margin: 0; }
.btn-danger-text { color: #b91c1c !important; }
.btn-danger-text:hover { background: rgba(185, 28, 28, .08) !important; }

/* نوار صفحه جزئیات کار */
.task-bar {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: .85rem;
}
.task-bar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem 1rem;
}
.task-bar-main {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  min-width: 0;
  flex: 1;
}
.task-bar-info { min-width: 0; }
.task-bar-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}
.task-bar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  margin-top: .45rem;
}
.task-bar-meta .badge { font-size: .72rem; padding: .15rem .5rem; }
.task-bar-company {
  font-size: .78rem;
  color: var(--muted);
}
.task-bar-company:hover { color: var(--accent); }
.task-bar-delete { margin: 0; flex-shrink: 0; }
.task-bar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.task-ctrl {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0;
  padding: .45rem .65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 42px;
}
.task-ctrl-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.task-ctrl-progress {
  flex: 1 1 280px;
  min-width: min(100%, 280px);
}
.task-bar-progress {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  min-width: 100px;
}
.task-bar-progress .progress-wrap { margin: 0; flex: 1; width: 100%; }
.task-bar-progress .progress-track { height: 7px; }
.task-bar-progress .progress-label { font-size: .72rem; min-width: 2rem; }
.task-ctrl-progress input[type=number] {
  width: 58px;
  padding: .3rem .4rem;
  font-size: .8rem;
}
.task-ctrl .status-select { max-width: 130px; }
.due-input {
  padding: .35rem .5rem;
  font-size: .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  min-width: 9.5rem;
}
.task-bar-desc {
  margin: 0 0 .85rem;
  font-size: .86rem;
  color: var(--muted);
  line-height: 1.6;
  padding: 0 .15rem;
}
.panel.task-chat-wrap {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.task-chat-wrap { margin-top: 0; }
.task-chat {
  min-height: 380px;
  height: min(62vh, 600px);
  display: flex;
  flex-direction: column;
}
.task-chat .chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.task-chat .msg {
  max-width: min(88%, 640px);
}
.task-chat .chat-composer {
  flex-shrink: 0;
}

/* Customer workspace */
.crumb {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: .85rem;
}
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); }

.cust-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  background:
    linear-gradient(125deg, rgba(155,77,184,.22), rgba(29,27,99,.08) 45%, transparent),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: .85rem;
}
.cust-hero-main { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.cust-avatar {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, #9b4db8, #1d1b63);
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.35rem; color: #fff;
  flex-shrink: 0;
}
.cust-hero h1 { margin: 0 0 .4rem; font-size: 1.35rem; }
.cust-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.cust-hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.cust-contact-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: 1rem;
}
@media (max-width: 1100px) {
  .cust-contact-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cust-contact-strip { grid-template-columns: 1fr; }
}
.cci {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .7rem .85rem;
}
.cci-l {
  display: block;
  font-size: .72rem;
  color: var(--muted);
  margin-bottom: .2rem;
}
.cci strong { font-size: .9rem; word-break: break-word; }

.cust-tabs .tab em {
  display: inline-grid;
  place-items: center;
  min-width: 1.3rem;
  padding: 0 .35rem;
  margin-right: .25rem;
  border-radius: 999px;
  background: rgba(155,77,184,.18);
  color: #d4a3e8;
  font-style: normal;
  font-size: .72rem;
}
.cust-stats { margin-bottom: 1rem; }

.work-row {
  display: block;
  padding: .95rem 1.15rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background .15s;
}
.work-row:hover { background: rgba(155,77,184,.06); }
.work-row.static:hover { background: transparent; }
.work-row-top {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}
.work-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .75rem;
  align-items: center;
  margin-top: .4rem;
  font-size: .82rem;
}
.note-text { margin: 0; line-height: 1.8; color: var(--muted); }
.cust-split {
  display: grid;
  grid-template-columns: 1.35fr .9fr;
  gap: 1.15rem;
  align-items: start;
}
@media (max-width: 980px) {
  .cust-split { grid-template-columns: 1fr; }
}
.user-mini {
  display: flex;
  align-items: center;
  gap: .55rem;
}
code {
  background: var(--bg-soft);
  padding: .15rem .4rem;
  border-radius: 6px;
  font-size: .85rem;
}
.sms-opts {
  margin-top: .85rem;
  padding: .75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  gap: .45rem;
}
.sms-opts-title {
  font-size: .88rem;
  font-weight: 600;
  margin: .15rem .35rem .35rem;
}
.check-line {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .86rem;
  line-height: 1.45;
  margin: 0;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
  padding: .7rem .8rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255,255,255,.02);
  transition: background .15s, border-color .15s;
}
.check-line:hover {
  background: rgba(155,77,184,.08);
  border-color: rgba(155,77,184,.2);
}
.check-line input {
  margin: 0;
  flex-shrink: 0;
}
.sms-opts-modal {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: none;
  display: grid;
  gap: .45rem;
}
.check-line-box {
  margin-top: .15rem;
  padding: .7rem .85rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* Portal access tab */
.access-panel .panel-head { align-items: flex-start; }
.access-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  padding: 1rem 1.15rem 1.25rem;
}
.access-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent), var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color .15s, transform .12s;
}
.access-card:hover { border-color: rgba(155,77,184,.35); }
.access-card.is-off { opacity: .72; }
.access-card-main {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  min-width: 0;
  flex: 1;
}
.access-avatar {
  width: 44px;
  height: 44px;
  font-size: 1rem;
  flex-shrink: 0;
}
.access-meta { min-width: 0; flex: 1; }
.access-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .65rem;
  margin-bottom: .35rem;
}
.access-creds {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: .45rem;
}
.access-sms {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  flex-shrink: 0;
}
.access-empty {
  text-align: center;
  padding: 2.75rem 1.25rem 2.5rem;
}
.access-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto .9rem;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(155,77,184,.25), rgba(45,40,105,.08)),
    var(--bg-soft);
  border: 1px solid rgba(155,77,184,.25);
  position: relative;
}
.access-empty-icon::before,
.access-empty-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.access-empty-icon::before {
  top: 14px;
  width: 16px;
  height: 12px;
  border: 2px solid #9b4db8;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}
.access-empty-icon::after {
  top: 24px;
  width: 22px;
  height: 16px;
  background: #9b4db8;
  border-radius: 4px;
}
.access-empty h3 {
  margin: 0 0 .4rem;
  font-size: 1.05rem;
}
.access-empty .btn { margin-top: 1rem; }
.modal-access {
  max-width: 560px;
  width: min(560px, 94vw);
  max-height: min(90vh, 90dvh);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.access-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(155,77,184,.08), transparent);
  flex-shrink: 0;
}
.access-modal-head h3 { margin: 0; font-size: 1.05rem; }
.access-form {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.access-form-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.access-form-section {
  padding: 1rem 1.25rem .25rem;
}
.access-form-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--accent);
  margin-bottom: .7rem;
}
.access-form-footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .55rem;
  padding: 1rem 1.25rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  margin-top: 0;
  flex-shrink: 0;
  background: var(--surface);
}
@media (max-width: 720px) {
  .access-card {
    flex-direction: column;
    align-items: stretch;
  }
  .access-actions { justify-content: flex-end; }
}

/* Brand slogan */
.slogan-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .55rem .85rem;
  margin: 0 0 1.25rem;
  padding: .85rem 1.15rem;
  border-radius: 14px;
  background:
    linear-gradient(120deg, rgba(129,67,146,.1), rgba(45,40,105,.06));
  border: 1px solid rgba(129,67,146,.16);
  animation: rise .45s ease both;
}
.slogan-banner .slogan-en {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.slogan-banner .slogan-fa {
  font-size: .9rem;
  color: var(--muted);
  font-weight: 500;
}
.slogan-banner .slogan-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
}
.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .4rem 1.25rem;
  margin-top: auto;
  font-size: .72rem;
  line-height: 1.2;
  color: var(--muted);
}
.app-footer .slogan-en {
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ========== Mobile / responsive ========== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  overflow-x: hidden;
}
body.menu-open {
  overflow: hidden;
  touch-action: none;
}
img, video, svg, canvas {
  max-width: 100%;
  height: auto;
}
.table-wrap {
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
table {
  min-width: 520px;
}

@media (max-width: 900px) {
  .sidebar {
    width: min(300px, 86vw);
    padding-top: max(1.25rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .content {
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .topbar {
    padding: .75rem .9rem;
    padding-top: max(.75rem, env(safe-area-inset-top));
    gap: .5rem;
  }
  .topbar h1 {
    font-size: 1rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 52vw;
  }
  .live-status {
    display: none;
  }
  .menu-toggle {
    min-width: 42px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
  }
  .btn-icon {
    width: 42px;
    height: 42px;
  }
  .notif-dropdown {
    position: fixed;
    left: .75rem;
    right: .75rem;
    top: calc(56px + env(safe-area-inset-top, 0px));
    width: auto;
    max-height: min(70vh, 420px);
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
    margin-bottom: 1rem;
  }
  .stat {
    padding: .95rem 1rem;
  }
  .stat .value {
    font-size: 1.4rem;
  }
  .panel-head {
    padding: .85rem 1rem;
    flex-wrap: wrap;
  }
  .panel-body {
    padding: 1rem;
  }
  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(120px, 28vh) minmax(0, 1fr);
    height: calc(100dvh - 130px);
    min-height: 70vh;
  }
  .chat-list {
    max-height: none;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }
  .chat-main {
    min-height: 0;
    height: 100%;
  }
  .chat-messages {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
  }
  .chat-composer {
    flex-wrap: wrap;
    padding: .75rem;
    gap: .55rem;
    position: sticky;
    bottom: 0;
  }
  .chat-composer textarea {
    min-height: 44px;
    font-size: 16px;
  }
  .composer-tools {
    width: 100%;
    justify-content: space-between;
  }
  .task-chat {
    min-height: 48vh;
    height: calc(100dvh - 280px);
  }
  .task-bar-top {
    flex-direction: column;
    align-items: stretch;
  }
  .task-bar-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .task-ctrl,
  .task-ctrl-progress {
    width: 100%;
    flex: none;
    min-width: 0;
  }
  .task-bar-title {
    white-space: normal;
  }
  .task-bar-progress {
    max-width: none;
    flex: 1 1 auto;
  }
  .status-select {
    max-width: none;
  }
  .modal {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 92dvh;
  }
  .modal-bg {
    align-items: end;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .modal-access {
    width: 100%;
    max-width: 100%;
  }
  .profile-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: .85rem;
  }
  .profile-hero .actions,
  .cust-hero-actions {
    width: 100%;
  }
  .profile-hero .actions .btn,
  .cust-hero-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .cust-hero {
    padding: 1rem;
  }
  .cust-hero h1 {
    font-size: 1.15rem;
  }
  .search-box {
    max-width: none;
    width: 100%;
  }
  .flex-between {
    gap: .65rem;
  }
  .slogan-banner {
    padding: .7rem .85rem;
    gap: .35rem .55rem;
  }
  .slogan-banner .slogan-en {
    font-size: .92rem;
    letter-spacing: .1em;
  }
  .slogan-banner .slogan-fa {
    font-size: .8rem;
  }
  .app-footer {
    padding: .35rem 1rem max(.45rem, env(safe-area-inset-bottom));
    font-size: .7rem;
  }
  .tabs {
    gap: .35rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .15rem;
  }
  .tab {
    white-space: nowrap;
    flex: 0 0 auto;
  }
  th, td {
    padding: .7rem .65rem;
    font-size: .84rem;
  }
  .btn {
    min-height: 42px;
  }
  .btn-sm {
    min-height: 36px;
  }
  input, select, textarea {
    font-size: 16px;
  }
}

@media (max-width: 600px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    min-height: auto;
    padding: 1.5rem 1rem .5rem;
  }
  .auth-logo-hero {
    width: min(112px, 27vw) !important;
  }
  .auth-logo-hex-frame { transform-origin: 50% 35%; }
  .auth-features {
    margin-top: 1.5rem;
    max-width: none;
  }
  .auth-panel {
    padding: 1rem .85rem 1.75rem;
  }
  .auth-card.auth-glass {
    padding: 1.35rem 1.1rem 1.2rem;
    border-radius: 20px;
  }
  .auth-card h1 {
    font-size: 1.15rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .cust-contact-strip {
    grid-template-columns: 1fr;
  }
  .actions {
    width: 100%;
  }
  .actions .btn {
    flex: 1 1 calc(50% - .35rem);
  }
  .progress-edit {
    min-width: 0;
    width: 100%;
  }
  .access-form-footer {
    flex-direction: column-reverse;
  }
  .access-form-footer .btn {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .topbar h1 {
    max-width: 42vw;
    font-size: .92rem;
  }
  .stat .value {
    font-size: 1.25rem;
  }
  .auth-slogan {
    font-size: .95rem !important;
    letter-spacing: .08em;
  }
}

@supports (padding: max(0px)) {
  .content {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}

/* Activity timeline */
.activity-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-right: 2px solid var(--border);
}
.activity-item {
  position: relative;
  padding: 0 1.25rem 1.25rem 0;
  margin-right: .5rem;
}
.activity-item.internal .activity-body {
  background: rgba(129, 67, 146, .06);
  border: 1px dashed rgba(129, 67, 146, .25);
}
.activity-dot {
  position: absolute;
  right: -.55rem;
  top: .35rem;
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--card);
}
.activity-head {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: .35rem;
}
.activity-body {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem 1rem;
}
.activity-body p {
  margin: 0 0 .35rem;
}

/* Customer dashboard compact strip */
.cust-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1rem;
  width: 100%;
}
.cust-mini-side {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .7rem .9rem;
  min-width: 0;
  position: relative;
}
.cust-mini-account {
  border-right: 3px solid var(--accent);
}
.cust-mini-org {
  border-right: 3px solid #0e7490;
}
.cust-mini-avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 11px;
  background: linear-gradient(145deg, #814392, #2d2869);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .95rem;
  flex: 0 0 auto;
}
.cust-mini-info {
  min-width: 0;
  flex: 1;
}
.cust-mini-title {
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: .1rem;
  letter-spacing: .02em;
}
.cust-mini-info strong {
  display: block;
  font-size: .95rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cust-mini-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .55rem;
  margin-top: .15rem;
  font-size: .75rem;
  color: var(--muted);
}
.cust-mini-meta span:not(:last-child)::after {
  content: "·";
  margin-right: .55rem;
  opacity: .55;
}
.cust-mini-pw {
  position: relative;
  flex: 0 0 auto;
}
.cust-mini-pw summary {
  list-style: none;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: .35rem .55rem;
  white-space: nowrap;
}
.cust-mini-pw summary::-webkit-details-marker { display: none; }
.cust-mini-pw-form {
  position: absolute;
  top: calc(100% + .4rem);
  left: 0;
  z-index: 20;
  width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(28, 24, 51, .14);
  padding: .7rem;
  display: grid;
  gap: .45rem;
}
.cust-mini-pw-form input {
  width: 100%;
  padding: .45rem .55rem;
  font-size: .82rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
}

@media (max-width: 900px) {
  .cust-mini {
    grid-template-columns: 1fr;
  }
}

/* keep old class names harmless if cached HTML appears */
.customer-top-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1rem;
}
.customer-top-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .7rem .9rem;
}
.customer-top-head {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .45rem;
}
.customer-top-head h2 {
  margin: 0;
  font-size: .85rem;
}
.customer-top-icon { display: none; }
.customer-top-user {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.customer-top-avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  background: linear-gradient(145deg, #814392, #2d2869);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}
.customer-top-name { font-size: .95rem; }
.customer-top-meta { font-size: .75rem; color: var(--muted); }
.customer-org-name { font-size: .95rem; }
.customer-org-list { display: none; }
.customer-pw-details summary {
  font-size: .75rem;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}
.customer-pw-details summary::-webkit-details-marker { display: none; }
.customer-pw-form {
  margin-top: .5rem;
  max-width: 220px;
}

/* CSAT */
.csat-stars {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.csat-star {
  cursor: pointer;
  padding: .35rem .65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .85rem;
}
.csat-star input { display: none; }
.csat-star:has(input:checked) {
  border-color: var(--accent);
  background: rgba(129, 67, 146, .08);
}

/* دریافت سامانه — تب‌ها + شبکه درختی (ارتفاع تا پایین صفحه) */
.content:has(.samaneh-shell) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.samaneh-shell {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  flex: 1 1 auto;
  min-height: calc(100vh - 6.5rem);
}
.samaneh-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: .3rem;
  overflow-x: auto;
  padding: .4rem;
  background:
    linear-gradient(180deg, #ffffff 0%, #f7f5fb 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 6px 18px rgba(45, 40, 105, .04);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.samaneh-tab {
  flex: 1 1 0;
  min-width: 5.2rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .45rem .4rem;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  text-align: center;
  background: transparent;
  transition: background .18s, border-color .18s, box-shadow .18s, transform .15s;
  white-space: nowrap;
}
.samaneh-tab:hover {
  background: rgba(129, 67, 146, .07);
  border-color: rgba(129, 67, 146, .14);
}
.samaneh-tab.is-active {
  background: linear-gradient(145deg, rgba(129, 67, 146, .14), rgba(45, 40, 105, .08));
  border-color: rgba(129, 67, 146, .35);
  box-shadow: 0 4px 12px rgba(129, 67, 146, .12);
}
.samaneh-tab.is-soon:not(.is-active) {
  opacity: .68;
  cursor: not-allowed;
  pointer-events: none;
}
.samaneh-tab-num {
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 7px;
  background: #ebe7f0;
  color: #4a3f5c;
  font-size: .7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, color .18s, transform .18s;
}
.samaneh-tab.is-active .samaneh-tab-num {
  background: linear-gradient(145deg, #814392, #2d2869);
  color: #fff;
  box-shadow: 0 2px 6px rgba(45, 40, 105, .25);
  transform: scale(1.05);
}
.samaneh-tab-label {
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 6.5rem;
}
.samaneh-tab.is-busy {
  border-color: rgba(217, 119, 6, .35);
  background: rgba(251, 191, 36, .12);
}
.samaneh-tab.is-busy.is-active {
  border-color: rgba(217, 119, 6, .5);
}
.samaneh-tab-who {
  display: block;
  width: 100%;
  margin-top: .12rem;
  font-size: .62rem;
  font-weight: 600;
  color: #b45309;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.samaneh-tab-who[hidden] { display: none !important; }
.samaneh-tab-wait {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .65rem;
  padding: 2.5rem 1.25rem;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 18%, rgba(251, 191, 36, .16), transparent 58%);
}
.samaneh-tab-wait-icon {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(251, 191, 36, .2);
}
.samaneh-tab-wait h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #92400e;
}
.samaneh-tab-wait p {
  margin: 0;
  max-width: 28rem;
  line-height: 1.7;
}
.samaneh-tab-wait-actions { margin-top: .5rem; }
.samaneh-pane {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(45, 40, 105, .05);
  overflow: hidden;
}
.samaneh-pane .panel-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 1rem 1.15rem;
}
.samaneh-pane .panel-head {
  background: linear-gradient(90deg, rgba(129, 67, 146, .06), transparent 55%);
  flex-wrap: wrap;
  gap: .5rem .75rem;
}
.samaneh-pane .panel-head h2 {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.samaneh-panel-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .65rem;
  margin-inline-start: auto;
}
.samaneh-json-io {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}
.samaneh-json-dl { margin: 0; }
.samaneh-json-modal { max-width: 640px; }
.samaneh-json-form {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.samaneh-json-hint {
  margin: 0;
  font-size: .82rem;
  line-height: 1.55;
}
.samaneh-json-form textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.45;
  min-height: 180px;
  resize: vertical;
}
.samaneh-json-status {
  margin: 0;
  font-size: .82rem;
  font-weight: 600;
}
.samaneh-json-status.is-pending { color: #5b4a7a; }
.samaneh-json-status.is-ok { color: #1f7a45; }
.samaneh-json-status.is-error { color: #b42318; }
.samaneh-step-num {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: linear-gradient(145deg, #814392, #2d2869);
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(45, 40, 105, .22);
}
.samaneh-step-num.sm {
  width: 1.5rem;
  height: 1.5rem;
  font-size: .75rem;
}
.samaneh-soon {
  text-align: center;
  padding: 2.75rem 1rem;
  color: var(--muted);
  font-size: .95rem;
  background:
    radial-gradient(circle at 50% 20%, rgba(129, 67, 146, .06), transparent 55%);
  border-radius: 10px;
}

@media (min-width: 960px) {
  .samaneh-shell {
    flex-direction: row-reverse;
    align-items: stretch;
  }
  .samaneh-tabs {
    flex: 0 0 13.75rem;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: none;
    height: auto;
    align-self: stretch;
    gap: .25rem;
  }
  .samaneh-tab {
    flex: 0 0 auto;
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
    text-align: right;
    padding: .48rem .55rem;
    white-space: normal;
  }
  .samaneh-tab-label {
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    text-align: right;
    font-size: .78rem;
  }
  .samaneh-tab.is-busy {
    flex-wrap: wrap;
  }
  .samaneh-tab-who {
    flex: 1 0 100%;
    margin-top: .15rem;
    padding-right: 1.9rem;
    white-space: normal;
  }
  .samaneh-pane {
    flex: 1 1 auto;
  }
}

/* شبکه درختی — تمیز و خوانا */
.xgrid-wrap {
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.xgrid-toolbar {
  margin-bottom: .75rem;
  padding: .65rem .8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.xgrid-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}
.xgrid-toolbar-row > .muted {
  font-size: .82rem;
}
.xgrid-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}
.xlock-form { margin: 0; }
.xbtn-lock {
  border: 1px solid rgba(45, 40, 105, .18);
  background: #fff;
  color: #4a3f5c;
  font-weight: 700;
}
.xbtn-lock.is-on {
  background: linear-gradient(145deg, #814392, #2d2869);
  border-color: transparent;
  color: #fff;
}
.xbtn-lock.is-final {
  cursor: default;
  pointer-events: none;
  opacity: .95;
}

/* اطلاعات سامانه — پنل‌ها */
.sysinfo-wrap {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.sysinfo-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .9rem;
  border-radius: 12px;
  background:
    linear-gradient(125deg, rgba(15, 76, 110, .1), rgba(42, 157, 143, .08) 55%, transparent),
    #f7fbfd;
  border: 1px solid rgba(15, 76, 110, .12);
}
.sysinfo-hero-text { min-width: 0; }
.sysinfo-kicker {
  margin: 0 0 .1rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #0f766e;
}
.sysinfo-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #153246;
}
.sysinfo-lead {
  margin: .2rem 0 0;
  font-size: .8rem;
  color: #4a5d6b;
  line-height: 1.45;
}
.sysinfo-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: .85rem;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}
.sysinfo-panels {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.sysinfo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .7rem;
  height: 100%;
}
.sysinfo-card {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: .85rem .9rem;
  border-radius: 12px;
  border: 1px solid rgba(30, 60, 90, .12);
  background: #fff;
  box-shadow: 0 6px 16px rgba(20, 50, 80, .04);
  min-height: 0;
  flex: 1;
}
.sysinfo-card-top {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.sysinfo-card h4 {
  margin: 0;
  font-size: .95rem;
  font-weight: 800;
  color: #1c2f3c;
}
.sysinfo-card-desc {
  margin: .1rem 0 0;
  font-size: .76rem;
  color: #64748b;
}
.sysinfo-card-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sysinfo-card.tone-admin .sysinfo-card-icon {
  color: #0f4c6e;
  background: rgba(15, 76, 110, .1);
}
.sysinfo-card.tone-staff .sysinfo-card-icon {
  color: #0f766e;
  background: rgba(15, 118, 110, .1);
}
.sysinfo-card.tone-admin {
  border-color: rgba(15, 76, 110, .16);
  background: linear-gradient(180deg, #f4f9fc, #fff 42%);
}
.sysinfo-card.tone-staff {
  border-color: rgba(15, 118, 110, .16);
  background: linear-gradient(180deg, #f3fbf9, #fff 42%);
}
.sysinfo-url {
  margin-top: .15rem;
  padding: .5rem .6rem;
  border-radius: 9px;
  background: #f1f5f9;
  border: 1px dashed rgba(71, 85, 105, .35);
  color: #0f172a;
  font-size: .76rem;
  line-height: 1.4;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.sysinfo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: auto;
  padding-top: .35rem;
}
.sysinfo-missing {
  margin: .35rem 0 0;
  font-size: .82rem;
  color: #94a3b8;
  font-style: italic;
}
.sysinfo-empty {
  border: 1px dashed rgba(15, 76, 110, .2);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.syssync-panel {
  margin: 0;
  padding: .85rem .9rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 76, 110, .14);
  background: linear-gradient(180deg, #f8fbfd, #fff);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
}
.syssync-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .55rem;
  margin-bottom: .55rem;
}
.syssync-head h3 {
  margin: 0;
  font-size: .92rem;
  font-weight: 800;
  color: #153246;
}
.syssync-head p {
  margin: .2rem 0 0;
  font-size: .76rem;
  color: #64748b;
}
.syssync-warn {
  padding: .65rem .75rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: .8rem;
  line-height: 1.5;
}
.syssync-meta {
  margin-bottom: .4rem;
  font-size: .7rem;
  color: #64748b;
  word-break: break-all;
}
.syssync-progress { margin-bottom: .5rem; }
.syssync-bar {
  height: .4rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.syssync-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #0ea5e9);
  transition: width .25s ease;
}
.syssync-status {
  margin-top: .3rem;
  font-size: .74rem;
  color: #334155;
  font-weight: 600;
}
.syssync-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
}
.syssync-steps li {
  display: grid;
  grid-template-columns: .7rem minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: .4rem;
  row-gap: .05rem;
  align-items: center;
  padding: .38rem .45rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: .74rem;
}
.syssync-dot {
  width: .5rem;
  height: .5rem;
  border-radius: 999px;
  background: #cbd5e1;
  grid-row: 1 / span 2;
}
.syssync-steps li.is-run .syssync-dot { background: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.2); }
.syssync-steps li.is-ok .syssync-dot { background: #16a34a; }
.syssync-steps li.is-err .syssync-dot { background: #dc2626; }
.syssync-steps li.is-ok { border-color: #bbf7d0; background: #f0fdf4; }
.syssync-steps li.is-err { border-color: #fecaca; background: #fef2f2; }
.syssync-steps li.is-run { border-color: #bae6fd; background: #f0f9ff; }
.syssync-label { font-weight: 650; color: #1e293b; }
.syssync-msg {
  grid-column: 2;
  color: #64748b;
  font-size: .68rem;
  line-height: 1.3;
}

@media (min-width: 1280px) {
  .syssync-steps {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
@media (max-width: 980px) {
  .sysinfo-main {
    grid-template-columns: 1fr;
  }
  .sysinfo-grid {
    grid-template-columns: 1fr 1fr;
  }
  .syssync-panel {
    min-height: 18rem;
  }
}
@media (max-width: 720px) {
  .sysinfo-grid,
  .syssync-steps {
    grid-template-columns: 1fr;
  }
}

.xgrid-lockset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.xgrid-lockset:disabled {
  opacity: .92;
}
.xgrid-wrap.is-locked .xgrid {
  position: relative;
}
.xgrid-wrap.is-locked .xgrid::after {
  content: "قفل";
  position: absolute;
  top: .55rem;
  left: .75rem;
  font-size: .7rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #814392, #2d2869);
  padding: .2rem .5rem;
  border-radius: 6px;
  pointer-events: none;
  z-index: 3;
}

.xgrid {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  background: #fff;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: 100%;
}

.xgrid-head,
.xgrid-row {
  display: grid;
  grid-template-columns: 200px repeat(6, minmax(100px, 1fr)) 40px;
  min-width: 980px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  align-items: center;
  box-sizing: border-box;
}

.xgrid-row > input[type="hidden"] {
  display: none !important;
}

.xgrid-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3eff8;
  border-bottom: 1px solid var(--border);
  font-size: .72rem;
  font-weight: 700;
  color: #4a3f5c;
}
.xgrid-head .xcol {
  padding: .55rem .45rem;
  border-left: 1px solid rgba(45, 40, 105, .08);
}

.xgrid-row {
  border-bottom: 1px solid rgba(45, 40, 105, .08);
}
.xgrid-row.lv-1 { background: #f5eef9; }
.xgrid-row.lv-2 { background: #eef2fa; }
.xgrid-row.lv-3 { background: #eef7f2; }
.xgrid-row.lv-4 { background: #fff5ec; }
.xgrid-row.lv-5 { background: #f3f7ff; }
.xgrid-row.lv-6 { background: #f7f3ff; }
.xgrid-row.lv-7 { background: #f3faf6; }
.xgrid-row.lv-8 { background: #fff8f0; }
.xgrid-row.lv-9 { background: #f5f5f8; }
.xgrid-row.lv-10 { background: #faf4f7; }

.xgrid-row .xcol {
  display: flex;
  align-items: center;
  gap: .35rem;
  min-width: 0;
  min-height: 2.55rem;
  padding: .3rem .35rem;
  border-left: 1px solid rgba(45, 40, 105, .05);
  box-sizing: border-box;
}

.xgrid-row .xcol input,
.xgrid-row .xcol select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 2rem;
  margin: 0;
  padding: .25rem .45rem;
  border: 1px solid rgba(45, 40, 105, .14);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: .8rem;
  color: var(--text);
  box-sizing: border-box;
  box-shadow: none;
}
.xgrid-row .xcol select {
  cursor: pointer;
}
.xgrid-row .xcol input:focus,
.xgrid-row .xcol select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.xcell-empty {
  display: block;
  width: 100%;
  height: 2rem;
  border-radius: 6px;
  background: rgba(45, 40, 105, .03);
  border: 1px dashed rgba(45, 40, 105, .08);
}

.xcol-tree { gap: .4rem; }
.xgrid-row.lv-1 .xcol-tree { padding-right: .4rem; }
.xgrid-row.lv-2 .xcol-tree { padding-right: 1.15rem; }
.xgrid-row.lv-3 .xcol-tree { padding-right: 1.9rem; }
.xgrid-row.lv-4 .xcol-tree { padding-right: 2.65rem; }
.xgrid-row.lv-5 .xcol-tree { padding-right: 3.4rem; }
.xgrid-row.lv-6 .xcol-tree { padding-right: 4.15rem; }
.xgrid-row.lv-7 .xcol-tree { padding-right: 4.9rem; }
.xgrid-row.lv-8 .xcol-tree { padding-right: 5.65rem; }
.xgrid-row.lv-9 .xcol-tree { padding-right: 6.4rem; }
.xgrid-row.lv-10 .xcol-tree { padding-right: 7.15rem; }
.xgrid-row.lv-2 .xcol-tree::before,
.xgrid-row.lv-3 .xcol-tree::before,
.xgrid-row.lv-4 .xcol-tree::before,
.xgrid-row.lv-5 .xcol-tree::before,
.xgrid-row.lv-6 .xcol-tree::before,
.xgrid-row.lv-7 .xcol-tree::before,
.xgrid-row.lv-8 .xcol-tree::before,
.xgrid-row.lv-9 .xcol-tree::before,
.xgrid-row.lv-10 .xcol-tree::before {
  content: "└";
  flex: 0 0 auto;
  color: #9aa3b2;
  font-size: .72rem;
}

.xbadge,
button.xbadge {
  flex: 0 0 auto;
  font-size: .65rem;
  font-weight: 700;
  padding: .18rem .45rem;
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.2;
  background: #eadcf2;
  color: #6b3480;
  border-color: rgba(129, 67, 146, .2);
}
button.xbadge-btn {
  cursor: pointer;
}
button.xbadge-btn:hover {
  filter: brightness(0.97);
}
.xbadge.loc,
button.xbadge.loc {
  background: #dde1f1;
  color: #2d2869;
  border-color: rgba(45, 40, 105, .18);
}
.xbadge.reg,
button.xbadge.reg {
  background: #d8eee4;
  color: #0d6b4f;
  border-color: rgba(16, 120, 90, .18);
}
.xbadge.cen,
button.xbadge.cen {
  background: #f3e2d1;
  color: #9a4e14;
  border-color: rgba(180, 100, 40, .2);
}

.xcol-act {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .2rem !important;
}
.xbtn-del {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 1px solid rgba(180, 50, 50, .25);
  border-radius: 6px;
  background: rgba(200, 60, 60, .08);
  color: #c0392b;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.xbtn-del:hover {
  background: rgba(200, 60, 60, .16);
}

.xgrid-row.is-saving {
  outline: 1px solid rgba(129, 67, 146, .25);
}
.xgrid-row.is-saved {
  outline: 1px solid rgba(16, 120, 90, .35);
}
.xgrid-row.is-save-err {
  outline: 1px solid rgba(200, 60, 60, .4);
}

.xgrid-empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  min-width: 980px;
}
.hidden-form { display: none !important; }

.samaneh-modal { max-width: 640px; }
.samaneh-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .35rem;
}
.samaneh-modal-head h3 { margin: 0; }
.samaneh-modal-parent {
  margin: 0 0 1rem;
  font-size: .85rem;
}
.samaneh-modal-fields { margin-bottom: .25rem; }
.samaneh-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1.1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 700px) {
  .samaneh-tab-label { max-width: 4.8rem; font-size: .65rem; }
}

/* واحد سازمانی — گرید ۴ ستونه فشرده */
.orgunits-wrap {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-height: 0;
  flex: 1;
}
.orgunits-wrap.is-locked .orgunit-card {
  opacity: .9;
}
.orgunits-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
}
.orgunit-card {
  display: flex;
  flex-direction: column;
  gap: .28rem;
  padding: .55rem .65rem .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #faf8fb;
  transition: border-color .15s ease, background .15s ease;
}
.orgunit-card.is-on {
  border-color: rgba(129, 67, 146, .4);
  background: #f6eef9;
}
.orgunit-card.is-source-off {
  background: #f5f5f6;
}
.orgunit-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
}
.orgunit-mark {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .72rem;
  color: #6b3a7a;
  background: rgba(129, 67, 146, .12);
  flex-shrink: 0;
}
.orgunit-card.is-on .orgunit-mark {
  background: rgba(129, 67, 146, .22);
}
.orgunit-name {
  margin: 0;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text, #1f1a24);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.orgunit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .35rem;
  align-items: center;
}
.orgunit-code {
  font-size: .65rem;
  letter-spacing: .02em;
  padding: .08rem .3rem;
  border-radius: 4px;
  background: rgba(0,0,0,.045);
  color: var(--muted);
}
.orgunit-badge-off {
  font-size: .62rem;
  color: #a05a2c;
  background: rgba(200, 120, 40, .12);
  padding: .08rem .3rem;
  border-radius: 4px;
}
.orgunit-toggle {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  flex-shrink: 0;
}
.orgunit-toggle:disabled {
  cursor: not-allowed;
  opacity: .55;
}
.orgunit-toggle-track {
  width: 2rem;
  height: 1.05rem;
  border-radius: 999px;
  background: #c9c2d0;
  position: relative;
  transition: background .15s ease;
  flex-shrink: 0;
}
.orgunit-toggle-knob {
  position: absolute;
  top: 2px;
  right: 2px;
  width: calc(1.05rem - 4px);
  height: calc(1.05rem - 4px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  transition: transform .15s ease;
}
.orgunit-toggle.is-on .orgunit-toggle-track {
  background: #814392;
}
.orgunit-toggle.is-on .orgunit-toggle-knob {
  transform: translateX(-0.95rem);
}
.orgunit-toggle-text {
  font-size: .65rem;
  color: var(--muted);
  min-width: 2.4rem;
  text-align: start;
}
.orgunit-toggle.is-on .orgunit-toggle-text {
  color: #6b3a7a;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .orgunits-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .orgunits-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .orgunits-grid { grid-template-columns: 1fr; }
}

/* دسته‌بندی — جدول دو سطحی */
.cat-tree-wrap {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-height: 0;
  flex: 1;
}
.cat-tree-table {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  background: #fff;
}
.cat-tree-head,
.cat-tree-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(10rem, 1.6fr) 5.5rem minmax(7rem, 1fr) 6.5rem;
  gap: .4rem;
  align-items: center;
  padding: .4rem .65rem;
}
.cat-tree-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3eef6;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.cat-tree-row {
  border-bottom: 1px solid rgba(0,0,0,.05);
  font-size: .82rem;
  transition: background .15s ease;
}
.cat-tree-row:last-child { border-bottom: 0; }
.cat-tree-row.lv-1 {
  background: #f7f1fa;
  font-weight: 600;
}
.cat-tree-row.lv-2 {
  background: #fafafa;
}
.cat-tree-row.lv-1.is-on { background: #efe4f5; }
.cat-tree-row.lv-2.is-on { background: #f3eaf8; }
.cat-tree-row.is-source-off { opacity: .78; }
.cat-tree-row.is-unit-off {
  opacity: .62;
  background: #f6f6f8;
}
.cat-tree-row.is-unit-off .orgunit-toggle {
  cursor: not-allowed;
}
.cat-badge {
  display: inline-block;
  font-size: .62rem;
  font-weight: 700;
  padding: .12rem .35rem;
  border-radius: 4px;
  background: rgba(129, 67, 146, .15);
  color: #6b3a7a;
  white-space: nowrap;
}
.cat-badge-2 {
  background: rgba(60, 100, 160, .12);
  color: #3a5a8a;
}
.cat-indent {
  display: inline-block;
  padding-inline-start: 1.85rem;
  position: relative;
}
.cat-indent::before {
  content: '';
  position: absolute;
  inset-inline-start: .45rem;
  top: 50%;
  width: .95rem;
  height: 1px;
  background: #c5b8cd;
}
.cat-tree-row.lv-2 .cat-col-name {
  padding-inline-start: .75rem;
}
.cat-tree-row.lv-2 .cat-col-level {
  padding-inline-start: .5rem;
}
.cat-col-code {
  font-size: .72rem;
  color: var(--muted);
}
.cat-col-unit {
  font-size: .74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-col-name strong {
  font-weight: 700;
}
.cat-col-toggle {
  display: flex;
  justify-content: flex-end;
}
.cat-select-all-form {
  display: inline-flex;
  margin: 0;
}

.samaneh-search-bar {
  margin: .2rem 0 .55rem;
}
.samaneh-search-shell {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  min-height: 2.65rem;
  padding: .35rem .55rem .35rem .85rem;
  border: 1px solid rgba(129, 67, 146, .18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, #ffffff 0%, #faf7fc 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.9) inset,
    0 8px 22px rgba(45, 40, 105, .06);
  cursor: text;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.samaneh-search-shell:focus-within {
  border-color: rgba(129, 67, 146, .45);
  box-shadow:
    0 0 0 4px rgba(129, 67, 146, .12),
    0 10px 24px rgba(45, 40, 105, .08);
}
.samaneh-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 10px;
  color: #814392;
  background: rgba(129, 67, 146, .1);
  flex-shrink: 0;
}
.samaneh-search-shell:focus-within .samaneh-search-icon {
  background: rgba(129, 67, 146, .18);
  color: #5f2d6e;
}
.samaneh-search-input {
  flex: 1;
  min-width: 0;
  height: 2rem;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: .9rem;
  color: var(--text);
  padding: 0;
  box-shadow: none;
}
.samaneh-search-input::placeholder {
  color: #9a93ad;
}
.samaneh-search-input::-webkit-search-decoration,
.samaneh-search-input::-webkit-search-cancel-button,
.samaneh-search-input::-webkit-search-results-button {
  -webkit-appearance: none;
}
.samaneh-search-count {
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 700;
  color: #6b3a7a;
  background: rgba(129, 67, 146, .12);
  border-radius: 999px;
  padding: .28rem .65rem;
  white-space: nowrap;
  letter-spacing: .01em;
}
.samaneh-search-count[hidden] {
  display: none !important;
}

.chart-xgrid-wrap {
  width: 100%;
  max-width: 100%;
}
.chart-xgrid.xgrid {
  width: 100%;
}
.chart-xgrid > .xgrid-head,
.chart-xgrid > .chart-row.xgrid-row {
  display: grid !important;
  grid-template-columns:
    minmax(230px, 1.5fr)
    minmax(120px, 1fr)
    minmax(120px, 1fr)
    minmax(120px, 1fr)
    minmax(110px, .95fr)
    minmax(110px, .95fr)
    minmax(100px, .9fr)
    minmax(100px, .9fr)
    minmax(110px, .9fr)
    40px;
  min-width: 1180px;
  width: max(100%, 1180px);
  box-sizing: border-box;
}
.chart-xgrid .xgrid-empty {
  min-width: 1180px;
}
.chart-xgrid .chart-row .xcol {
  min-height: 2.35rem;
  padding: .22rem .28rem;
}
.chart-xgrid .chart-row .xcol input,
.chart-xgrid .chart-row .xcol select {
  height: 1.9rem;
  font-size: .74rem;
  padding: .2rem .35rem;
}
.chart-xgrid .xcol-tree {
  align-items: center;
  gap: .35rem;
  padding-right: 0 !important;
  padding-left: 0 !important;
}
.chart-xgrid .chart-row.lv-1 .xcol-tree { padding-inline-start: .25rem !important; }
.chart-xgrid .chart-row.lv-2 .xcol-tree { padding-inline-start: .7rem !important; }
.chart-xgrid .chart-row.lv-3 .xcol-tree { padding-inline-start: 1.15rem !important; }
.chart-xgrid .chart-row.lv-4 .xcol-tree { padding-inline-start: 1.6rem !important; }
.chart-xgrid .chart-row.lv-5 .xcol-tree { padding-inline-start: 2.05rem !important; }
.chart-xgrid .chart-row.lv-6 .xcol-tree { padding-inline-start: 2.5rem !important; }
.chart-xgrid .chart-row.lv-7 .xcol-tree { padding-inline-start: 2.95rem !important; }
.chart-xgrid .chart-row.lv-8 .xcol-tree { padding-inline-start: 3.4rem !important; }
.chart-xgrid .chart-row.lv-9 .xcol-tree { padding-inline-start: 3.85rem !important; }
.chart-xgrid .chart-row.lv-10 .xcol-tree { padding-inline-start: 4.3rem !important; }
.chart-xgrid .chart-row .xcol-tree::before {
  content: none;
}
.chart-xgrid .chart-row.lv-2 .xcol-tree::before,
.chart-xgrid .chart-row.lv-3 .xcol-tree::before,
.chart-xgrid .chart-row.lv-4 .xcol-tree::before,
.chart-xgrid .chart-row.lv-5 .xcol-tree::before,
.chart-xgrid .chart-row.lv-6 .xcol-tree::before,
.chart-xgrid .chart-row.lv-7 .xcol-tree::before,
.chart-xgrid .chart-row.lv-8 .xcol-tree::before,
.chart-xgrid .chart-row.lv-9 .xcol-tree::before,
.chart-xgrid .chart-row.lv-10 .xcol-tree::before {
  content: "└";
  flex: 0 0 auto;
  color: #9aa3b2;
  font-size: .7rem;
}
.chart-badge {
  background: rgba(129, 67, 146, .14) !important;
  color: #6b3a7a !important;
  white-space: nowrap;
  font-size: .62rem !important;
  padding: .14rem .38rem !important;
}
.chart-parent-col {
  overflow: hidden;
}
.chart-parent-label {
  display: block;
  width: 100%;
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: .25rem .4rem;
  background: rgba(45, 40, 105, .04);
  border-radius: 6px;
  border: 1px solid rgba(45, 40, 105, .08);
}
.modal.chart-modal,
.samaneh-modal.chart-modal {
  max-width: 720px;
}

.personnel-wrap {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-height: 0;
  flex: 1;
}
.personnel-table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: auto;
}
.personnel-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}
.personnel-table th,
.personnel-table td {
  padding: .65rem .7rem;
  border-bottom: 1px solid rgba(45, 40, 105, .08);
  text-align: right;
  font-size: .84rem;
  vertical-align: middle;
}
.personnel-table th {
  background: #f3eff8;
  font-size: .75rem;
  color: #4a3f5c;
  position: sticky;
  top: 0;
  z-index: 1;
}
.personnel-table tr:last-child td { border-bottom: 0; }
.personnel-table .actions {
  white-space: nowrap;
  display: flex;
  gap: .25rem;
  justify-content: flex-end;
}
.personnel-modal {
  max-width: 680px;
}
.warehouse-table {
  min-width: 980px;
}

/* تایید نهایی — گزارش رنگی A4 */
.final-review {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.final-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .45rem .7rem;
}
.final-toolbar-msg { font-size: .8rem; color: var(--muted); }
.final-toolbar-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.final-toolbar-actions .btn:disabled { opacity: .45; cursor: not-allowed; }
.final-confirm-modal { max-width: 420px; }
.final-confirm-body {
  padding: 0 .15rem .35rem;
  font-size: .88rem;
  line-height: 1.65;
  color: #243039;
}
.final-confirm-body ul {
  margin: .35rem 0 .55rem;
  padding-right: 1.15rem;
}
.final-confirm-body li { margin: .2rem 0; }

.final-report {
  width: min(100%, 210mm);
  margin: 0 auto;
  padding: 10mm 9mm 8mm;
  background:
    linear-gradient(180deg, #f7fbff 0%, #fff 28%),
    #fff;
  border: 1px solid #d5e0ea;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(20, 50, 80, .06);
  color: #1c2a35;
  font-size: .7rem;
  line-height: 1.45;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.final-cover {
  display: flex;
  gap: .75rem;
  align-items: stretch;
  margin-bottom: .75rem;
  padding: .7rem .8rem;
  border-radius: 12px;
  background: linear-gradient(120deg, #0f4c6e 0%, #1a7a8c 55%, #2a9d8f 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 76, 110, .22);
}
.final-cover-mark {
  flex: 0 0 auto;
  align-self: center;
  padding: .45rem .55rem;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 8px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  background: rgba(255,255,255,.12);
}
.final-cover-body { min-width: 0; }
.final-cover-body h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}
.final-cover-body p {
  margin: .15rem 0 0;
  font-size: .72rem;
  opacity: .92;
}
.final-cover-lock {
  margin-top: .35rem !important;
  font-size: .7rem !important;
}
.final-cover-lock strong { font-weight: 800; }

.final-block {
  margin: 0 0 .7rem;
  padding: .55rem .55rem .45rem;
  border: 1px solid #d9e4ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(20, 50, 80, .03);
}
.final-sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
  margin: -.55rem -.55rem .5rem;
  padding: .4rem .55rem;
  border-radius: 12px 12px 0 0;
  color: #fff;
  background: #2f6f8f;
}
.final-sec-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.35);
  font-size: .68rem;
  font-weight: 800;
}
.final-sec-head h2 {
  margin: 0;
  flex: 1 1 auto;
  font-size: .78rem;
  font-weight: 800;
}
.final-sec-meta {
  font-size: .66rem;
  opacity: .95;
  background: rgba(0,0,0,.14);
  border-radius: 999px;
  padding: .12rem .45rem;
}

.tone-slate .final-sec-head { background: linear-gradient(90deg, #4b5563, #6b7280); }
.tone-teal .final-sec-head { background: linear-gradient(90deg, #0f766e, #14b8a6); }
.tone-blue .final-sec-head { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.tone-indigo .final-sec-head { background: linear-gradient(90deg, #4338ca, #6366f1); }
.tone-cyan .final-sec-head { background: linear-gradient(90deg, #0e7490, #22d3ee); color: #083344; }
.tone-cyan .final-sec-num { color: #083344; background: rgba(255,255,255,.55); }
.tone-green .final-sec-head { background: linear-gradient(90deg, #15803d, #22c55e); }
.tone-olive .final-sec-head { background: linear-gradient(90deg, #3f6212, #65a30d); }
.tone-amber .final-sec-head { background: linear-gradient(90deg, #b45309, #f59e0b); color: #1c1917; }
.tone-amber .final-sec-num { color: #1c1917; background: rgba(255,255,255,.45); }
.tone-rose .final-sec-head { background: linear-gradient(90deg, #be123c, #fb7185); }
.tone-violet .final-sec-head { background: linear-gradient(90deg, #6d28d9, #a78bfa); }
.tone-navy .final-sec-head { background: linear-gradient(90deg, #1e3a5f, #334155); }

.final-lock-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .35rem;
}
.final-lock-chip {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0 .3rem;
  padding: .35rem .4rem;
  border-radius: 9px;
  border: 1px solid #d5dee8;
  background: #f8fafc;
  font-size: .62rem;
  min-height: 2.6rem;
}
.final-lock-chip b {
  grid-row: 1 / span 2;
  align-self: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  font-size: .62rem;
}
.final-lock-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #334155;
}
.final-lock-chip em {
  font-style: normal;
  color: #64748b;
  font-size: .58rem;
}
.final-lock-chip.on {
  border-color: #86efac;
  background: #f0fdf4;
}
.final-lock-chip.on b { background: #16a34a; color: #fff; }
.final-lock-chip.on em { color: #15803d; font-weight: 700; }
.final-lock-chip.off {
  border-color: #fdba74;
  background: #fff7ed;
}
.final-lock-chip.off b { background: #ea580c; color: #fff; }
.final-lock-chip.off em { color: #c2410c; font-weight: 700; }

.final-entity {
  margin: 0 0 .55rem;
  padding: .45rem;
  border: 1px solid #cfe8e4;
  border-radius: 10px;
  background: linear-gradient(180deg, #f4fffc, #fff);
}
.final-entity-title {
  margin: 0 0 .35rem;
  font-size: .74rem;
  font-weight: 800;
  color: #0f766e;
}
.final-subentity {
  margin: .4rem 0 0;
  padding: .4rem;
  border: 1px dashed #b7d4ef;
  border-radius: 9px;
  background: #f8fbff;
}
.final-subentity-title {
  margin: 0 0 .3rem;
  font-size: .7rem;
  font-weight: 750;
  color: #1d4ed8;
}
.final-nested {
  margin: .35rem 0 0;
  padding: .35rem;
  border-right: 3px solid #6366f1;
  background: #faf9ff;
  border-radius: 0 8px 8px 0;
}
.final-nested-title {
  font-size: .68rem;
  font-weight: 750;
  color: #4338ca;
  margin-bottom: .2rem;
}
.final-nested-title small {
  margin-right: .35rem;
  color: #64748b;
  font-weight: 500;
}
.final-note {
  margin: 0 0 .25rem;
  font-size: .64rem;
  color: #475569;
}
.final-empty {
  margin: .1rem 0;
  font-size: .68rem;
  color: #64748b;
  font-style: italic;
}
.final-foot {
  margin-top: .4rem;
  padding-top: .4rem;
  border-top: 1px dashed #cbd5e1;
  text-align: center;
  color: #64748b;
  font-size: .64rem;
}

.final-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 0 .35rem;
  font-size: .64rem;
  overflow: hidden;
  border: 1px solid #c9d7e4;
  border-radius: 9px;
  background: #fff;
}
.final-table th,
.final-table td {
  border-bottom: 1px solid #dde7f0;
  border-left: 1px solid #e8eef4;
  padding: .28rem .34rem;
  text-align: right;
  vertical-align: top;
  word-break: break-word;
}
.final-table th:first-child,
.final-table td:first-child { border-left: 0; }
.final-table tr:last-child td { border-bottom: 0; }
.final-table thead th {
  background: linear-gradient(180deg, #e8f2fb, #d7e8f7);
  color: #0f3a57;
  font-weight: 800;
  border-bottom-color: #b9cee2;
}
.final-table tbody tr:nth-child(even) td {
  background: #f7fbfe;
}
.final-table tbody tr:hover td {
  background: #eef6fc;
}
.final-table .num {
  width: 1.8rem;
  text-align: center;
  white-space: nowrap;
  color: #475569;
  font-variant-numeric: tabular-nums;
}
.final-table-kv { border-radius: 8px; }
.final-table-kv th {
  width: 5.4rem;
  background: #eef6f4;
  color: #0f5c54;
  font-weight: 750;
  border-bottom-color: #cfe3de;
}
.final-table-dense th,
.final-table-dense td {
  padding: .2rem .26rem;
  font-size: .6rem;
}
.final-table .indent-2 { padding-right: .85rem !important; }
.final-table .indent-3 { padding-right: 1.35rem !important; }
.final-table .indent-4 { padding-right: 1.85rem !important; }
.final-table .indent-5 { padding-right: 2.35rem !important; }
.final-table .indent-6 { padding-right: 2.85rem !important; }

.tone-teal .final-table thead th { background: linear-gradient(180deg, #d8f5f0, #c2eee7); color: #115e59; }
.tone-blue .final-table thead th { background: linear-gradient(180deg, #dbeafe, #bfdbfe); color: #1e3a8a; }
.tone-indigo .final-table thead th { background: linear-gradient(180deg, #e0e7ff, #c7d2fe); color: #312e81; }
.tone-cyan .final-table thead th { background: linear-gradient(180deg, #cffafe, #a5f3fc); color: #155e75; }
.tone-green .final-table thead th { background: linear-gradient(180deg, #dcfce7, #bbf7d0); color: #14532d; }
.tone-olive .final-table thead th { background: linear-gradient(180deg, #ecfccb, #d9f99d); color: #365314; }
.tone-amber .final-table thead th { background: linear-gradient(180deg, #fef3c7, #fde68a); color: #78350f; }
.tone-rose .final-table thead th { background: linear-gradient(180deg, #ffe4e6, #fecdd3); color: #9f1239; }
.tone-violet .final-table thead th { background: linear-gradient(180deg, #ede9fe, #ddd6fe); color: #5b21b6; }
.tone-navy .final-table thead th { background: linear-gradient(180deg, #e2e8f0, #cbd5e1); color: #0f172a; }

@media (max-width: 900px) {
  .final-lock-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .final-report { padding: .75rem; border-radius: 10px; }
}

@media print {
  @page {
    size: A4;
    margin: 8mm 7mm;
  }
  .sidebar,
  .sidebar-backdrop,
  .topbar,
  .samaneh-tabs,
  .panel-head,
  .no-print,
  .flash,
  .final-toolbar {
    display: none !important;
  }
  html, body {
    background: #fff !important;
  }
  body,
  .app,
  .main,
  .content,
  .samaneh-shell,
  .samaneh-pane,
  .panel,
  .panel-body,
  .final-review {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    overflow: visible !important;
  }
  .final-report {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    font-size: 8pt;
  }
  .final-cover,
  .final-sec-head,
  .final-lock-chip,
  .final-entity,
  .final-subentity,
  .final-nested,
  .final-table thead th,
  .final-table-kv th,
  .final-table tbody tr:nth-child(even) td {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .final-block {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
  }
  .final-table { font-size: 7pt; }
  .final-table-dense th,
  .final-table-dense td { font-size: 6.5pt; }
  .final-table thead { display: table-header-group; }
  .final-table tr { page-break-inside: avoid; }
  .final-lock-row { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .final-table tbody tr:hover td { background: inherit; }
}

/* دسته‌بندی کالا — ۴ سطح محلی */
.pcat-wrap .pcat-head,
.pcat-wrap .pcat-row {
  grid-template-columns: 7rem minmax(12rem, 1.4fr) minmax(10rem, 1.2fr) 2.5rem;
}
.pcat-wrap .cat-col-level {
  display: flex;
  align-items: center;
  gap: .25rem;
  min-width: 0;
}
.pcat-fold-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid rgba(45, 40, 105, .16);
  border-radius: 5px;
  background: #fff;
  color: #5b5678;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.pcat-fold-btn:hover {
  background: #f3eef6;
  color: #6b3a7a;
}
.pcat-fold-btn svg {
  display: block;
  transition: transform .18s ease;
}
.pcat-row.is-collapsed .pcat-fold-btn svg {
  transform: rotate(-90deg);
}
.cat-tree-row[hidden],
.pcat-row[hidden],
.pcat-row.is-tree-hidden {
  display: none !important;
}
.pcat-fold-spacer {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
}
.pcat-wrap .cat-col-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.pcat-del-btn {
  flex-shrink: 0;
}
.pcat-row-form {
  display: contents;
}
.pcat-wrap .pcat-row .cat-col-name input,
.pcat-wrap .pcat-row .cat-col-code input {
  width: 100%;
  height: 1.9rem;
  border: 1px solid rgba(45, 40, 105, .14);
  border-radius: 6px;
  padding: .2rem .45rem;
  font: inherit;
  font-size: .82rem;
  background: #fff;
  box-sizing: border-box;
}
/* تورفتگی پلکانی هر سطح نسبت به قبلی */
.pcat-wrap .pcat-row.lv-1 .cat-col-level,
.pcat-wrap .pcat-row.lv-1 .cat-col-name {
  padding-inline-start: .15rem !important;
}
.pcat-wrap .pcat-row.lv-2 .cat-col-level,
.pcat-wrap .pcat-row.lv-2 .cat-col-name {
  padding-inline-start: 1.35rem !important;
}
.pcat-wrap .pcat-row.lv-3 .cat-col-level,
.pcat-wrap .pcat-row.lv-3 .cat-col-name {
  padding-inline-start: 2.55rem !important;
}
.pcat-wrap .pcat-row.lv-4 .cat-col-level,
.pcat-wrap .pcat-row.lv-4 .cat-col-name {
  padding-inline-start: 3.75rem !important;
}
.pcat-wrap .pcat-row.lv-2 .cat-col-name,
.pcat-wrap .pcat-row.lv-3 .cat-col-name,
.pcat-wrap .pcat-row.lv-4 .cat-col-name {
  position: relative;
}
.pcat-wrap .pcat-row.lv-2 .cat-col-name::before,
.pcat-wrap .pcat-row.lv-3 .cat-col-name::before,
.pcat-wrap .pcat-row.lv-4 .cat-col-name::before {
  content: '└';
  position: absolute;
  inset-inline-start: .35rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa3b2;
  font-size: .72rem;
  line-height: 1;
}
.pcat-wrap .pcat-row.lv-2 .cat-col-name::before { inset-inline-start: .55rem; }
.pcat-wrap .pcat-row.lv-3 .cat-col-name::before { inset-inline-start: 1.75rem; }
.pcat-wrap .pcat-row.lv-4 .cat-col-name::before { inset-inline-start: 2.95rem; }
.pcat-wrap .pcat-row.lv-2 { background: #eef2fa; }
.pcat-wrap .pcat-row.lv-3 { background: #eef7f2; }
.pcat-wrap .pcat-row.lv-4 { background: #fff5ec; }
.pcat-wrap .pcat-row.lv-2.is-on { background: #e4eaf8; }
.pcat-wrap .pcat-row.lv-3.is-on { background: #e3f3ea; }
.pcat-wrap .pcat-row.lv-4.is-on { background: #ffeedd; }
.cat-badge-3 {
  background: rgba(16, 120, 90, .12);
  color: #0d6b4f;
}
.cat-badge-4 {
  background: rgba(180, 100, 40, .14);
  color: #9a4e14;
}
.pcat-row.is-saving {
  outline: 1px solid rgba(129, 67, 146, .25);
}
.pcat-row.is-saved {
  outline: 1px solid rgba(16, 120, 90, .35);
}
.pcat-row.is-save-err {
  outline: 1px solid rgba(200, 60, 60, .4);
}
button.pcat-add-btn {
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
}
@media (max-width: 820px) {
  .pcat-wrap .pcat-head,
  .pcat-wrap .pcat-row {
    grid-template-columns: 5.75rem minmax(8rem, 1fr) 2.25rem;
  }
  .pcat-wrap .cat-col-code,
  .pcat-wrap .pcat-head .cat-col-code { display: none; }
  .pcat-wrap .pcat-row.lv-2 .cat-col-level,
  .pcat-wrap .pcat-row.lv-2 .cat-col-name { padding-inline-start: 1rem !important; }
  .pcat-wrap .pcat-row.lv-3 .cat-col-level,
  .pcat-wrap .pcat-row.lv-3 .cat-col-name { padding-inline-start: 1.85rem !important; }
  .pcat-wrap .pcat-row.lv-4 .cat-col-level,
  .pcat-wrap .pcat-row.lv-4 .cat-col-name { padding-inline-start: 2.7rem !important; }
}


@media (max-width: 820px) {
  .cat-tree-head,
  .cat-tree-row {
    grid-template-columns: 3.8rem minmax(8rem, 1fr) 5.5rem;
  }
  .cat-col-code,
  .cat-col-unit { display: none; }
  .cat-tree-head .cat-col-code,
  .cat-tree-head .cat-col-unit { display: none; }
}

.ref-items-head,
.ref-items-table .cat-tree-row {
  grid-template-columns: 5.5rem minmax(10rem, 1.2fr) minmax(8rem, 1.4fr) 6.5rem;
}
.ref-items-table .cat-col-extra {
  font-size: .74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 820px) {
  .ref-items-head,
  .ref-items-table .cat-tree-row {
    grid-template-columns: minmax(8rem, 1fr) 5.5rem;
  }
  .ref-items-table .cat-col-code,
  .ref-items-table .cat-col-extra,
  .ref-items-head .cat-col-code,
  .ref-items-head .cat-col-extra { display: none; }
}



/* —— آموزش تب‌های دریافت سامانه —— */
.samaneh-help-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid rgba(45, 40, 105, .14);
  background: #fff;
  color: var(--brand-indigo);
  font-weight: 700;
  border-radius: 999px;
  padding: .32rem .78rem;
  box-shadow: 0 1px 2px rgba(29, 27, 99, .04);
}
.samaneh-help-btn:hover {
  border-color: rgba(129, 67, 146, .35);
  color: var(--brand-purple);
  background: #faf8fc;
}
.samaneh-help-btn-ico {
  display: inline-flex;
  color: var(--brand-purple);
}

.samaneh-help-modal {
  max-width: 680px;
  width: min(680px, 100%);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 820px);
  border: 0;
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(45, 40, 105, .06),
    0 24px 64px rgba(29, 27, 99, .18);
  background: #fff;
}

.sh-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem 1.15rem;
  background:
    linear-gradient(180deg, #f8f6fb 0%, #ffffff 100%);
  border-bottom: 1px solid rgba(45, 40, 105, .08);
}
.sh-head-main {
  display: flex;
  align-items: center;
  gap: .95rem;
  min-width: 0;
}
.sh-icon {
  position: relative;
  flex-shrink: 0;
  width: 3.55rem;
  height: 3.55rem;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, #9a5bb0 0%, #814392 42%, #2d2869 100%);
  box-shadow:
    0 10px 24px rgba(45, 40, 105, .28),
    inset 0 1px 0 rgba(255,255,255,.28);
  overflow: hidden;
}
.sh-icon-glow {
  position: absolute;
  inset: -40% -20% auto auto;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(255,255,255,.35), transparent 70%);
  pointer-events: none;
}
.sh-icon svg {
  position: relative;
  z-index: 1;
  width: 1.9rem;
  height: 1.9rem;
}
.sh-head-copy { min-width: 0; }
.sh-kicker {
  margin: 0 0 .22rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--brand-purple);
  letter-spacing: .01em;
}
.sh-head h3 {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--brand-navy);
  line-height: 1.35;
}
.sh-head-hint {
  margin: .28rem 0 0;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.4;
}
.sh-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 10px;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--muted) !important;
}

.sh-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1.15rem 1.35rem 1.25rem;
  background:
    radial-gradient(ellipse 70% 40% at 100% 0%, rgba(129, 67, 146, .04), transparent 60%),
    #fff;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sh-intro {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.sh-why {
  margin: 0;
  font-size: .92rem;
  line-height: 1.85;
  color: #3a3554;
}
.sh-goal {
  padding: .85rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(129, 67, 146, .07), rgba(45, 40, 105, .04));
  border: 1px solid rgba(129, 67, 146, .14);
}
.sh-label {
  display: inline-block;
  margin-bottom: .35rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--brand-purple);
  text-transform: none;
}
.sh-goal p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.7;
  font-weight: 600;
  color: var(--brand-indigo);
}

.sh-block {
  padding: 0;
}
.sh-block-title {
  margin: 0 0 .7rem;
  font-size: .8rem;
  font-weight: 800;
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  gap: .45rem;
}
.sh-block-title::before {
  content: "";
  width: .35rem;
  height: .35rem;
  border-radius: 50%;
  background: var(--brand-purple);
  box-shadow: 0 0 0 4px rgba(129, 67, 146, .15);
}

.sh-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.sh-list li {
  position: relative;
  padding: .65rem .85rem .65rem 2.1rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid rgba(45, 40, 105, .06);
  font-size: .84rem;
  line-height: 1.65;
  color: #4a4566;
}
.sh-list li::before {
  content: "";
  position: absolute;
  top: 1rem;
  inset-inline-start: .85rem;
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #c4b5d8;
  box-shadow: inset 0 0 0 2px #fff;
}

.sh-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.sh-steps::before {
  content: "";
  position: absolute;
  top: 1.15rem;
  bottom: 1.15rem;
  inset-inline-start: 1.05rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(129, 67, 146, .35), rgba(45, 40, 105, .08));
  border-radius: 2px;
}
.sh-steps > li {
  display: grid;
  grid-template-columns: 2.15rem 1fr;
  gap: .85rem;
  align-items: start;
  padding: .55rem 0;
  position: relative;
}
.sh-step-num {
  position: relative;
  z-index: 1;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #814392, #2d2869);
  box-shadow:
    0 4px 12px rgba(45, 40, 105, .25),
    0 0 0 4px #fff;
}
.sh-step-body {
  padding: .7rem .9rem .8rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(45, 40, 105, .08);
  box-shadow: 0 2px 8px rgba(29, 27, 99, .04);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sh-steps > li:hover .sh-step-body {
  border-color: rgba(129, 67, 146, .22);
  box-shadow: 0 6px 16px rgba(29, 27, 99, .07);
}
.sh-step-body h5 {
  margin: 0 0 .35rem;
  font-size: .9rem;
  font-weight: 800;
  color: var(--brand-navy);
}
.sh-step-body p {
  margin: 0;
  font-size: .84rem;
  line-height: 1.75;
  color: var(--muted);
}

.sh-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: .45rem;
}
.sh-field {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) 1fr;
  gap: .65rem;
  align-items: start;
  padding: .7rem .85rem;
  border-radius: 12px;
  background: #faf9fc;
  border: 1px solid rgba(45, 40, 105, .07);
}
.sh-field strong {
  font-size: .8rem;
  font-weight: 800;
  color: var(--brand-indigo);
  line-height: 1.5;
}
.sh-field span {
  font-size: .82rem;
  line-height: 1.6;
  color: var(--muted);
}

.sh-done-block {
  padding: .9rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(22, 163, 74, .08), rgba(22, 163, 74, .03));
  border: 1px solid rgba(22, 163, 74, .18);
}
.sh-done-block .sh-block-title { color: #166534; margin-bottom: .4rem; }
.sh-done-block .sh-block-title::before {
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, .15);
}
.sh-done-block p {
  margin: 0;
  font-size: .86rem;
  line-height: 1.7;
  color: #14532d;
  font-weight: 600;
}

.sh-warn-block {
  padding: .9rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(217, 119, 6, .09), rgba(217, 119, 6, .03));
  border: 1px solid rgba(217, 119, 6, .2);
}
.sh-warn-block .sh-block-title { color: #92400e; }
.sh-warn-block .sh-block-title::before {
  background: #d97706;
  box-shadow: 0 0 0 4px rgba(217, 119, 6, .15);
}
.sh-warn-block .sh-list li {
  background: rgba(255,255,255,.55);
  border-color: rgba(217, 119, 6, .12);
  color: #78350f;
}
.sh-warn-block .sh-list li::before {
  background: #f59e0b;
}

.sh-foot {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: .9rem 1.35rem 1.15rem;
  border-top: 1px solid rgba(45, 40, 105, .08);
  background: #fbfafd;
}
.sh-foot .btn-primary {
  min-width: 9.5rem;
  border-radius: 12px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .samaneh-help-modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 16px;
  }
  .sh-head,
  .sh-body,
  .sh-foot { padding-inline: 1rem; }
  .sh-icon { width: 2.9rem; height: 2.9rem; border-radius: 14px; }
  .sh-icon svg { width: 1.55rem; height: 1.55rem; }
  .sh-head h3 { font-size: 1.05rem; }
  .sh-field {
    grid-template-columns: 1fr;
    gap: .2rem;
  }
  .sh-steps::before { inset-inline-start: .95rem; }
}