/* ════════════════════════════════
   LOGIN PAGE — split panel
════════════════════════════════ */
.login-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* برندینگ: پنل راست در RTL */
.login-panel-brand {
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(0,180,216,.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 80%, rgba(240,165,0,.07) 0%, transparent 50%),
    var(--bg-0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  position: relative;
}
.login-panel-brand::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,180,216,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,180,216,.04) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 40%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 40%, transparent 80%);
  pointer-events: none;
}
.login-panel-brand::after {
  content: '';
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  border: 1px solid rgba(0,180,216,.1);
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 55px rgba(0,180,216,.04),
    0 0 0 110px rgba(0,180,216,.025),
    0 0 0 165px rgba(0,180,216,.01);
  pointer-events: none;
}
.login-brand-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  animation: fadeUp .5s ease both;
}
.login-brand-icon-xl {
  width: 80px; height: 80px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dim) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 40px rgba(0,180,216,.35), 0 0 80px rgba(0,180,216,.12);
}
.login-brand-icon-xl svg { width: 40px; height: 40px; color: #000; }
.login-brand-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: .5rem;
}
.login-brand-sub {
  font-size: .9rem;
  color: var(--text-3);
  line-height: 1.75;
  max-width: 260px;
  margin: 0 auto;
}
.login-features {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  text-align: right;
}
.login-feature {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .85rem;
  color: var(--text-2);
}
.login-feature-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(0,180,216,.7);
}

/* فرم: پنل چپ در RTL */
.login-panel-form {
  background:
    radial-gradient(ellipse 70% 60% at 30% 60%, rgba(0,180,216,.06) 0%, transparent 60%),
    var(--bg-0);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
}
.login-panel-form::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,180,216,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,180,216,.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}
.login-box {
  width: 100%;
  max-width: 400px;
  animation: fadeUp .45s .1s ease both;
  position: relative;
  z-index: 1;
}
.login-box-header {
  text-align: center;
  margin-bottom: 2rem;
}
.login-box-header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: .4rem; }
.login-box-header p  { font-size: .87rem; color: var(--text-3); }

/* tabs با sliding indicator */
.login-tabs {
  position: relative;
  display: flex;
  background: var(--bg-3);
  border-radius: var(--r-md);
  padding: 4px;
  margin-bottom: 1.75rem;
  border: 1px solid var(--border-mid);
}
.login-tab-indicator {
  position: absolute;
  top: 4px; bottom: 4px;
  width: calc(50% - 4px);
  right: 4px;
  border-radius: calc(var(--r-md) - 2px);
  background: rgba(0,180,216,.12);
  border: 1px solid rgba(0,180,216,.25);
  transition: transform var(--t-base);
  pointer-events: none;
}
.login-tab {
  flex: 1;
  padding: .6rem .75rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text-3);
  font-family: inherit;
  border-radius: calc(var(--r-md) - 2px);
  transition: color var(--t-base);
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}
.login-tab svg { width: 14px; height: 14px; flex-shrink: 0; }
.login-tab.active { color: var(--teal); }
.login-tab:hover:not(.active) { color: var(--text-2); }

.login-form { display: flex; flex-direction: column; gap: 1.1rem; }

.login-error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--r-sm);
  color: #fca5a5;
  font-size: .85rem;
  padding: .65rem .9rem;
}

/* input with icon */
.input-icon-wrap { position: relative; }
.input-icon-wrap > svg {
  position: absolute;
  right: .85rem; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-3);
  pointer-events: none;
  z-index: 1;
}
.input-icon-wrap input { padding-right: 2.75rem; }
.password-wrap input { padding-left: 2.75rem; }
.pw-toggle {
  position: absolute; left: .65rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  padding: .2rem; display: flex;
  align-items: center; justify-content: center;
  transition: color var(--t-base); z-index: 2; line-height: 0;
}
.pw-toggle:hover { color: var(--teal); }
.pw-toggle svg { width: 15px; height: 15px; pointer-events: none; }

@media (max-width: 780px) {
  .login-page { grid-template-columns: 1fr; }
  .login-panel-brand { display: none; }
  .login-panel-form { min-height: 100vh; }
}

/* ════════════════════════════════
   WELCOME BANNER (dashboard)
════════════════════════════════ */
.welcome-banner {
  background:
    linear-gradient(135deg, rgba(0,180,216,.06) 0%, transparent 50%),
    var(--bg-2);
  border: 1px solid rgba(0,180,216,.12);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  animation: fadeUp .35s ease both;
}
.welcome-heading {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: .2rem;
}
.welcome-sub { font-size: .82rem; color: var(--text-3); }
.live-clock {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
  opacity: .75;
  letter-spacing: .03em;
  white-space: nowrap;
  direction: ltr;
}
@media (max-width: 600px) {
  .welcome-banner { flex-direction: column; align-items: flex-start; }
}

/* ════════════════════════════════
   PROFILE PAGE
════════════════════════════════ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) { .profile-grid { grid-template-columns: 1fr; } }

.profile-field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .9rem 1.1rem;
  background: var(--bg-3);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.profile-field-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.profile-field-value {
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-1);
}
.profile-field-value.empty { color: var(--text-3); font-style: italic; }

.admin-back-banner {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.1rem;
  background: rgba(0,180,216,.06);
  border: 1px solid rgba(0,180,216,.15);
  border-radius: var(--r-md);
  font-size: .85rem;
  color: var(--teal);
  margin-bottom: 1.5rem;
}
.admin-back-banner svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ════════════════════════════════
   MACHINE DETAIL
════════════════════════════════ */
.detail-section {
  margin-bottom: 1.5rem;
}
.detail-section-title {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-row-label { color: var(--text-2); }
.detail-row-value { color: var(--text-1); font-weight: 500; }

.my-share-highlight {
  background: rgba(0,180,216,.06);
  border: 1px solid rgba(0,180,216,.15);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.my-share-highlight .share-pct {
  font-size: 2rem;
  font-weight: 800;
  color: var(--teal);
}
.my-share-highlight .share-label {
  font-size: .82rem;
  color: var(--text-3);
}
.my-share-highlight .invest-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-1);
}

.owner-row-me { background: rgba(0,180,216,.04) !important; }
.owner-row-me td { color: var(--teal) !important; }

.price-summary {
  background: var(--bg-3);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}
.price-row {
  display: flex;
  justify-content: space-between;
  padding: .35rem 0;
  font-size: .88rem;
  color: var(--text-2);
}
.price-row.total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
  border-top: 1px solid var(--border);
  margin-top: .5rem;
  padding-top: .75rem;
}

/* ════════════════════════════════
   LIGHT MODE PAGE OVERRIDES — green
════════════════════════════════ */
/* ── login: full-page near-black mesh with orange/red glow ── */
[data-theme="light"] .login-page {
  position: relative;
  background-color: #0F0F0F;
  background-image:
    radial-gradient(ellipse 70% 60% at 10% 10%,  rgba(249,115,22,.42)  0%, transparent 55%),
    radial-gradient(ellipse 55% 50% at 90% 15%,  rgba(220,38,38,.34)   0%, transparent 50%),
    radial-gradient(ellipse 65% 55% at 75% 85%,  rgba(234,88,12,.30)   0%, transparent 55%),
    radial-gradient(ellipse 50% 45% at 15% 80%,  rgba(220,38,38,.26)   0%, transparent 50%),
    radial-gradient(ellipse 40% 35% at 50% 50%,  rgba(253,186,116,.18) 0%, transparent 50%);
}

/* both panels fully transparent — mesh shows through uniformly */
[data-theme="light"] .login-panel-brand {
  background: transparent;
  border-left: none;
}

/* decorative rings → white */
[data-theme="light"] .login-panel-brand::before {
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
}
[data-theme="light"] .login-panel-brand::after {
  border-color: rgba(255,255,255,.12);
  box-shadow:
    0 0 0 55px rgba(255,255,255,.03),
    0 0 0 110px rgba(255,255,255,.015),
    0 0 0 165px rgba(255,255,255,.008);
}

/* brand icon → glass */
[data-theme="light"] .login-brand-icon-xl {
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 8px 32px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.4);
}
[data-theme="light"] .login-brand-icon-xl svg { color: #fff; }

/* brand title → white (override text-gradient-teal) */
[data-theme="light"] .login-brand-title {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: #fff;
  background-clip: unset;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0,0,0,.2);
}

/* brand sub + features → white */
[data-theme="light"] .login-brand-sub { color: rgba(255,255,255,.75); }
[data-theme="light"] .login-feature   { color: rgba(255,255,255,.8); }
[data-theme="light"] .login-feature-dot {
  background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,.6);
}

/* form panel → transparent */
[data-theme="light"] .login-panel-form { background: transparent; }
[data-theme="light"] .login-panel-form::before { display: none; }

/* glass login card */
[data-theme="light"] .login-box {
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255,255,255,.32);
  border-radius: var(--r-xl);
  box-shadow: 0 24px 64px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.45);
  padding: 2.25rem;
}

/* box header → white text */
[data-theme="light"] .login-box-header h1 { color: #fff; }
[data-theme="light"] .login-box-header p  { color: rgba(255,255,255,.65); }

/* tabs → glass */
[data-theme="light"] .login-tabs {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
}
[data-theme="light"] .login-tab-indicator {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.35);
}
[data-theme="light"] .login-tab         { color: rgba(255,255,255,.55); }
[data-theme="light"] .login-tab.active  { color: #fff; }
[data-theme="light"] .login-tab:hover:not(.active) { color: rgba(255,255,255,.8); }

/* labels → white */
[data-theme="light"] .login-box label   { color: rgba(255,255,255,.85); }
[data-theme="light"] .login-box label .required { color: #fca5a5; }

/* inputs inside login box → glass white */
[data-theme="light"] .login-box input[type="text"],
[data-theme="light"] .login-box input[type="tel"],
[data-theme="light"] .login-box input[type="password"] {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.28);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
[data-theme="light"] .login-box input::placeholder { color: rgba(255,255,255,.4); }
[data-theme="light"] .login-box input:focus {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.5);
  box-shadow: 0 0 0 3px rgba(255,255,255,.12), inset 0 1px 0 rgba(255,255,255,.25);
}
[data-theme="light"] .login-box .input-icon-wrap > svg { color: rgba(255,255,255,.5); }
[data-theme="light"] .pw-toggle { color: rgba(255,255,255,.5); }
[data-theme="light"] .pw-toggle:hover { color: #fff; }

/* primary button inside login → solid white */
[data-theme="light"] .login-box .btn-primary {
  background: rgba(255,255,255,.95);
  color: #9A3412;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  font-weight: 700;
}
[data-theme="light"] .login-box .btn-primary:hover {
  background: #fff;
  box-shadow: 0 6px 24px rgba(0,0,0,.25);
}

/* ghost button inside login */
[data-theme="light"] .login-box .btn-ghost {
  color: rgba(255,255,255,.7);
  border-color: transparent;
}
[data-theme="light"] .login-box .btn-ghost:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

/* error box → glass red */
[data-theme="light"] .login-error {
  background: rgba(239,68,68,.2);
  border-color: rgba(239,68,68,.35);
  color: #fecaca;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* OTP step text inside glass card */
[data-theme="light"] .login-box [style*="color:var(--teal)"] { color: #fca5a5 !important; }

[data-theme="light"] .welcome-banner {
  background: linear-gradient(135deg, #0F0F0F 0%, #1A1A1A 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: rgba(249,115,22,.25);
  box-shadow: 0 4px 20px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.06);
}
[data-theme="light"] .welcome-heading { color: #fff; }
[data-theme="light"] .welcome-sub     { color: rgba(255,255,255,.65); }
[data-theme="light"] .live-clock      { color: #FB923C; opacity: 1; }

[data-theme="light"] .my-share-highlight {
  background: rgba(234,88,12,.06);
  border-color: rgba(234,88,12,.18);
}
[data-theme="light"] .my-share-highlight .share-pct { color: var(--gold); }

[data-theme="light"] .owner-row-me { background: rgba(234,88,12,.05) !important; }
[data-theme="light"] .owner-row-me td { color: var(--gold) !important; }

[data-theme="light"] .admin-back-banner {
  background: rgba(234,88,12,.06);
  border-color: rgba(234,88,12,.18);
  color: var(--gold);
}

[data-theme="light"] .price-summary { background: var(--bg-3); }

/* ════════════════════════════════
   DASHBOARD STAT CARDS — enhanced
════════════════════════════════ */
.dash-stats {
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
}

.stat-card {
  position: relative;
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 110% -10%, rgba(255,255,255,.07) 0%, transparent 60%);
  pointer-events: none;
}

.stat-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .85rem;
  position: relative;
  flex-shrink: 0;
}
.stat-icon svg { width: 20px; height: 20px; }

.stat-card.teal .stat-icon  { background: rgba(0,180,216,.14); box-shadow: 0 0 14px rgba(0,180,216,.2); }
.stat-card.teal .stat-icon svg { color: #00b4d8; filter: drop-shadow(0 0 5px rgba(0,180,216,.5)); }
.stat-card.green .stat-icon { background: rgba(34,197,94,.13); box-shadow: 0 0 14px rgba(34,197,94,.15); }
.stat-card.green .stat-icon svg { color: #22c55e; filter: drop-shadow(0 0 5px rgba(34,197,94,.4)); }
.stat-card.gold .stat-icon  { background: rgba(234,179,8,.12); box-shadow: 0 0 14px rgba(234,179,8,.15); }
.stat-card.gold .stat-icon svg { color: #eab308; filter: drop-shadow(0 0 5px rgba(234,179,8,.4)); }
.stat-card.purple .stat-icon { background: rgba(168,85,247,.12); box-shadow: 0 0 14px rgba(168,85,247,.15); }
.stat-card.purple .stat-icon svg { color: #a855f7; filter: drop-shadow(0 0 5px rgba(168,85,247,.4)); }
.stat-card.red .stat-icon   { background: rgba(239,68,68,.12); box-shadow: 0 0 14px rgba(239,68,68,.15); }
.stat-card.red .stat-icon svg { color: #ef4444; filter: drop-shadow(0 0 5px rgba(239,68,68,.4)); }

.stat-value { font-size: 1.65rem; font-weight: 800; line-height: 1.1; margin-bottom: .3rem; letter-spacing: -.01em; }
.stat-label { font-size: .76rem; font-weight: 500; color: var(--text-3); }

.stat-trend {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .7rem;
  font-weight: 600;
  margin-top: .6rem;
  padding: .18rem .55rem;
  border-radius: 99px;
  width: fit-content;
}
.stat-trend-up   { background: rgba(34,197,94,.12); color: #16a34a; }
.stat-trend-warn { background: rgba(234,179,8,.1);  color: #b45309; }

/* light mode icons — vivid solid color on soft tint */
[data-theme="light"] .stat-card.teal .stat-icon  { background: rgba(220,38,38,.14);  box-shadow: none; }
[data-theme="light"] .stat-card.green .stat-icon { background: rgba(34,197,94,.14);  box-shadow: none; }
[data-theme="light"] .stat-card.gold .stat-icon  { background: rgba(234,88,12,.15);  box-shadow: none; }
[data-theme="light"] .stat-card.purple .stat-icon{ background: rgba(139,92,246,.14); box-shadow: none; }
[data-theme="light"] .stat-card.red .stat-icon   { background: rgba(239,68,68,.15);  box-shadow: none; }
[data-theme="light"] .stat-card.teal .stat-icon svg,
[data-theme="light"] .stat-card.red .stat-icon svg   { color: #DC2626; filter: none; }
[data-theme="light"] .stat-card.green .stat-icon svg { color: #16A34A; filter: none; }
[data-theme="light"] .stat-card.gold .stat-icon svg  { color: #EA580C; filter: none; }
[data-theme="light"] .stat-card.purple .stat-icon svg{ color: #7C3AED; filter: none; }

/* trend pills — dark text on light tint */
[data-theme="light"] .stat-card .stat-trend-up   { background: rgba(34,197,94,.14);  color: #15803D; }
[data-theme="light"] .stat-card .stat-trend-warn { background: rgba(234,88,12,.14);  color: #B45309; }

/* 3px glowing top accent border per variant */
[data-theme="light"] .stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  pointer-events: none;
}
[data-theme="light"] .stat-card.teal::after   { background: #DC2626; box-shadow: 0 0 14px rgba(220,38,38,.65); }
[data-theme="light"] .stat-card.green::after  { background: #22C55E; box-shadow: 0 0 14px rgba(34,197,94,.6); }
[data-theme="light"] .stat-card.gold::after   { background: #F97316; box-shadow: 0 0 14px rgba(249,115,22,.65); }
[data-theme="light"] .stat-card.purple::after { background: #8b5cf6; box-shadow: 0 0 14px rgba(139,92,246,.6); }
[data-theme="light"] .stat-card.red::after    { background: #ef4444; box-shadow: 0 0 14px rgba(239,68,68,.6); }

/* ════════════════════════════════
   DASHBOARD CHARTS ROW
════════════════════════════════ */
.dash-charts-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.dash-charts-row > * { min-width: 0; overflow: hidden; }

@media (max-width: 1080px) {
  .dash-charts-row { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .welcome-banner { flex-direction: column; gap: .75rem; align-items: flex-start; }
  .live-clock { font-size: .85rem; }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 1.35rem; }
  .stat-icon { width: 36px; height: 36px; margin-bottom: .65rem; }
  .stat-icon svg { width: 17px; height: 17px; }
}

/* ── موجودی و ثبت مواد (inventory redesign) ─────────────────── */
.inventory-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.machine-picker { position: sticky; top: 1rem; }
.machine-picker-list { display: flex; flex-direction: column; gap: .35rem; padding: .5rem; }
.picker-empty { padding: 1.25rem .5rem; text-align: center; color: var(--text-3); font-size: .85rem; }
.picker-item {
  display: flex; align-items: center; gap: .55rem;
  padding: .6rem .7rem; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: background .15s, border-color .15s;
  font-size: .88rem; font-weight: 500;
}
.picker-item:hover { background: var(--bg-2); }
.picker-item.active { background: color-mix(in srgb, var(--gold) 14%, transparent); border-color: var(--gold); color: var(--text-1); }
.picker-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.inv-empty-state { padding: 3rem 1rem; }
.inv-workspace { display: flex; flex-direction: column; gap: 1.25rem; }

.report-empty { text-align: center; padding: 1.75rem; color: var(--text-3); }
.cell-name { font-weight: 600; }
.cell-name .cell-note { display: block; font-size: .72rem; color: var(--text-3); font-weight: 400; }
.cell-total { font-weight: 700; color: var(--teal); white-space: nowrap; }
.cell-date { font-size: .8rem; color: var(--text-3); white-space: nowrap; }
.cell-actions { white-space: nowrap; display: flex; gap: .15rem; }
.btn-danger-ghost { color: var(--red); }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }
.report-totals td { font-weight: 800; border-top: 2px solid var(--border); padding: .8rem .65rem; }

/* charts */
.inv-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.chart-box h4 { margin: 0 0 .5rem; font-size: .82rem; color: var(--text-2); font-weight: 700; }
.chart-box-wide { grid-column: 1 / -1; }
.chart-wrap { position: relative; height: 220px; }
.chart-box-wide .chart-wrap { height: 200px; }

.inv-report-table { overflow-x: auto; }

/* ── type tabs (segmented) ── */
.inv-tabs {
  display: inline-flex; flex-wrap: wrap; gap: .25rem;
  padding: .3rem; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--border);
}
.inv-tab {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .95rem; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--text-2); border: none;
  font-size: .85rem; font-weight: 600; transition: background .15s, color .15s;
}
.inv-tab svg { width: 16px; height: 16px; flex-shrink: 0; }
.inv-tab:hover { color: var(--text-1); background: color-mix(in srgb, var(--text-3) 8%, transparent); }
.inv-tab.active { background: var(--gold); color: #1a1206; box-shadow: 0 1px 3px rgba(0,0,0,.14); }

/* ── flow intro ── */
.inv-flow-intro {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .55rem .9rem; border-radius: 10px;
  background: var(--bg-2); border: 1px dashed var(--border);
  font-size: .8rem; color: var(--text-2); font-weight: 600;
}
.inv-flow-step { display: inline-flex; align-items: center; gap: .35rem; }
.inv-flow-arrow { color: var(--text-3); font-weight: 700; }

/* ── process step cards ── */
.inv-step { position: relative; }
.inv-step-head { display: flex; align-items: center; gap: .75rem; }
.inv-step-num {
  flex-shrink: 0; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  font-weight: 800; font-size: 1rem; line-height: 1;
}
.inv-step-titles { display: flex; flex-direction: column; gap: .1rem; flex: 1; min-width: 0; }
.inv-step-sub { font-size: .76rem; color: var(--text-3); font-weight: 500; }

/* blocked state (no units for this type) */
.inv-step.is-blocked { opacity: .92; }
.inv-step.is-blocked .inv-step-num {
  background: color-mix(in srgb, var(--text-3) 14%, transparent);
  color: var(--text-3); border-color: transparent;
}
.inv-step-blocked {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .9rem 1rem; border-radius: 10px; margin-bottom: .5rem;
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 32%, transparent);
  color: var(--text-1); font-size: .85rem;
}
.inv-step-blocked svg { width: 22px; height: 22px; color: var(--gold); flex-shrink: 0; }
.inv-step-blocked div { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 180px; }
.inv-step-blocked strong { font-size: .9rem; }
.inv-step-blocked span { color: var(--text-2); font-size: .8rem; }

/* ── record cards (one per material unit) ── */
.rec-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .85rem;
}
.rec-card {
  display: flex; flex-direction: column; gap: .6rem;
  padding: .85rem .9rem; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--border);
  transition: border-color .15s, box-shadow .15s;
}
.rec-card:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 14%, transparent); }
.rec-card.is-editing { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 6%, var(--bg-2)); }
.rec-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.rec-card-name { font-weight: 700; font-size: .95rem; color: var(--text-1); }
.rec-card-unit { font-size: .72rem; color: var(--text-3); white-space: nowrap; }
.rec-card-form { display: flex; flex-direction: column; gap: .5rem; }
.rec-card-row { display: flex; gap: .5rem; }
.rec-field { display: flex; flex-direction: column; gap: .25rem; flex: 1; min-width: 0; }
.rec-field span { font-size: .72rem; color: var(--text-3); font-weight: 600; }
.rec-field .form-control { min-height: 36px; }
.rec-field-note { flex: 1 1 100%; }
.rec-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .1rem; }
.rec-card-total { font-size: .76rem; font-weight: 700; color: var(--gold); white-space: nowrap; }
.rec-card-actions { display: flex; gap: .35rem; }

/* ── report bar: period selector + count ── */
.inv-report-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.inv-period { display: inline-flex; gap: .25rem; padding: .25rem; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); }
.inv-period-btn {
  padding: .4rem .8rem; border-radius: 7px; cursor: pointer;
  background: transparent; color: var(--text-2); border: none;
  font-size: .8rem; font-weight: 600; transition: background .15s, color .15s;
}
.inv-period-btn:hover { color: var(--text-1); }
.inv-period-btn.active { background: var(--gold); color: #1a1206; }

/* ── pagination ── */
.inv-pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap; margin-top: .9rem; padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.inv-pager-info { font-size: .78rem; color: var(--text-3); }
.inv-pager-btns { display: flex; gap: .25rem; flex-wrap: wrap; }
.inv-pager-btn {
  min-width: 34px; height: 34px; padding: 0 .55rem; border-radius: 8px; cursor: pointer;
  background: var(--bg-2); color: var(--text-2); border: 1px solid var(--border);
  font-size: .8rem; font-weight: 700; transition: background .15s, color .15s, border-color .15s;
}
.inv-pager-btn:hover:not(:disabled) { color: var(--text-1); border-color: var(--gold); }
.inv-pager-btn.active { background: var(--gold); color: #1a1206; border-color: var(--gold); }
.inv-pager-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── responsive ── */
@media (max-width: 860px) {
  .inventory-layout { grid-template-columns: 1fr; }
  .machine-picker { position: static; }
  .inv-charts { grid-template-columns: 1fr; }
  .rec-cards { grid-template-columns: 1fr; }
  .inv-report-bar { justify-content: flex-start; }
  .inv-period-btn { padding: .45rem .9rem; font-size: .82rem; }
  .inv-pager { justify-content: center; }
  .inv-pager-info { width: 100%; text-align: center; }
}

@media (max-width: 520px) {
  .inv-step-sub { display: none; }
  .inv-flow-intro { font-size: .75rem; }
  .inv-step-num { width: 30px; height: 30px; font-size: .9rem; }
  .inv-pager-btn { min-width: 38px; height: 38px; }
  .inv-tab { padding: .5rem .75rem; }
}

/* ── inventory charge cards (per-material, per-kg) ── */
.rec-card {
  flex-direction: row !important;
  align-items: center;
  gap: .75rem;
}
.rec-card-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  color: var(--gold);
  border: 1px solid color-mix(in srgb, var(--gold) 32%, transparent);
}
.rec-card-icon svg { width: 22px; height: 22px; }
.rec-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.rec-card-meta { font-size: .74rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-card .rec-charge { flex-shrink: 0; white-space: nowrap; }

/* ── charge modal ── */
.charge-modal { max-width: 460px; }
.charge-body { display: flex; flex-direction: column; gap: .85rem; }
.charge-field { display: flex; flex-direction: column; gap: .3rem; }
.charge-field > span { font-size: .76rem; color: var(--text-2); font-weight: 700; }
.charge-field .form-control { min-height: 38px; font-size: .9rem; }
.charge-field-note textarea { resize: vertical; }
.charge-total {
  margin-top: .15rem;
  padding: .6rem .8rem;
  border-radius: 9px;
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 28%, transparent);
  color: var(--gold);
  font-weight: 800;
  font-size: .85rem;
}

.cell-operator { font-size: .8rem; color: var(--text-2); white-space: nowrap; }

@media (max-width: 540px) {
  .rec-card { flex-wrap: wrap; }
  .rec-card .rec-charge { flex: 1 1 100%; justify-content: center; }
}

.charge-preview {
  display: block;
  margin-top: .15rem;
  font-size: .76rem;
  color: var(--text-2);
  font-weight: 600;
}

/* ── snack-not-yet notice ── */
.inv-snack-notice { padding: 1.5rem; }
.inv-snack-notice-inner {
  display: flex; align-items: center; gap: .85rem; flex-wrap: wrap;
  padding: 1rem 1.1rem; border-radius: 12px;
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 32%, transparent);
  color: var(--text-1);
}
.inv-snack-notice-inner svg { width: 30px; height: 30px; color: var(--gold); flex-shrink: 0; }
.inv-snack-notice-inner div { display: flex; flex-direction: column; gap: .2rem; flex: 1; min-width: 200px; }
.inv-snack-notice-inner strong { font-size: .95rem; }
.inv-snack-notice-inner span { font-size: .82rem; color: var(--text-2); }
