/* EXTRUCK Admin — Light Glass + Soft 3D + Motion */
:root {
  --admin-bg: #EEF2F7;
  --admin-surface: rgba(255, 255, 255, 0.72);
  --admin-surface-solid: #ffffff;
  --admin-glass-border: rgba(255, 255, 255, 0.7);
  --admin-ink: #0F172A;
  --admin-muted: #64748B;
  --brand-navy: #1A2B4A;
  --brand-orange: #F5A623;
  --orange-glow: rgba(245, 166, 35, 0.22);
  --success: #059669;
  --danger: #DC2626;
  --warn: #D97706;
  --info: #0284C8;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-3d: 0 18px 40px rgba(15, 23, 42, 0.12), 0 2px 0 rgba(255, 255, 255, 0.8) inset;
  --motion-fast: 150ms;
  --motion-base: 220ms;
  --motion-slow: 380ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tabbar-h: 68px;
}

html, body {
  max-width: 100vw;
  overflow-x: hidden;
  font-family: 'Vazirmatn', sans-serif;
  background: var(--admin-bg);
  color: var(--admin-ink);
  font-size: 14px;
  line-height: 1.65;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }

.admin-scene {
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(245, 166, 35, 0.16), transparent 55%),
    radial-gradient(700px 420px at 95% 5%, rgba(2, 132, 200, 0.12), transparent 50%),
    linear-gradient(180deg, #f7f9fc 0%, var(--admin-bg) 40%, #e8eef6 100%);
}

.admin-blob {
  position: fixed;
  border-radius: 9999px;
  filter: blur(90px);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
  animation: ex-float 10s ease-in-out infinite alternate;
}
.admin-blob-a { width: 280px; height: 280px; background: #F5A623; top: 8%; left: 5%; }
.admin-blob-b { width: 320px; height: 320px; background: #38BDF8; bottom: 12%; right: 8%; animation-delay: -3s; }
.admin-blob-c { width: 220px; height: 220px; background: #94A3B8; top: 45%; left: 40%; opacity: 0.1; animation-delay: -6s; }

.glass, .sidebar, .topbar, .glass-card, .bottom-tabbar, .cmd-palette {
  background: var(--admin-surface);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--admin-glass-border);
  box-shadow: var(--shadow-soft);
}

.glass-card {
  border-radius: 22px;
  box-shadow: var(--shadow-3d);
  transition: transform var(--motion-base) var(--ease-out), box-shadow var(--motion-base) var(--ease-out);
}

.btn-b2b-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #F5A623 50%, #d97706 100%) !important;
  color: #0B1120 !important;
  font-weight: 800 !important;
  border: 1px solid rgba(251, 191, 36, 0.55) !important;
  box-shadow: 0 8px 22px var(--orange-glow) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 13px;
  min-height: 44px;
  transition: transform var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast) var(--ease-out);
  cursor: pointer;
  touch-action: manipulation;
}
.btn-b2b-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(245, 166, 35, 0.35) !important; }
.btn-b2b-gold:active { transform: translateY(1px); }

.btn-b2b-navy {
  background: var(--brand-navy) !important;
  color: #fbbf24 !important;
  font-weight: 800 !important;
  border: 1px solid #334155 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 13px;
  min-height: 44px;
  transition: transform var(--motion-fast) var(--ease-out), background var(--motion-fast) var(--ease-out);
  cursor: pointer;
  touch-action: manipulation;
}
.btn-b2b-navy:hover { transform: translateY(-2px); background: #243b63 !important; color: #fff !important; }
.btn-b2b-navy:active { transform: translateY(1px); }

.sidebar {
  background: rgba(255, 255, 255, 0.78);
  border-left: 1px solid rgba(255, 255, 255, 0.75);
  z-index: 60;
}

.nav-group-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--admin-muted);
  letter-spacing: 0.04em;
  padding: 10px 14px 6px;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  transition: transform var(--motion-fast) var(--ease-out), background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
  border: 1px solid transparent;
  min-height: 44px;
}
.nav-link:hover { color: #b45309; background: rgba(255, 255, 255, 0.7); border-color: rgba(226, 232, 240, 0.9); transform: translateX(-2px); }
.nav-link.active {
  color: var(--admin-ink);
  background: linear-gradient(135deg, #fbbf24, #F5A623);
  border-color: #f59e0b;
  box-shadow: 0 6px 18px var(--orange-glow);
}
.nav-link.active .ex-icon { color: var(--admin-ink); }
.nav-link .ex-icon { color: #d97706; flex-shrink: 0; }
.nav-link.active .ex-ico-soft {
  background: rgba(15, 23, 42, 0.12);
  color: var(--admin-ink);
  border-color: transparent;
}
.tab-item .ex-icon { margin-bottom: 1px; }

/* ─── EXTRUCK Professional Icon System ─── */
.ex-icon {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.2em;
  fill: none;
  stroke: currentColor;
  flex-shrink: 0;
}
.ex-icon-sm { width: 16px; height: 16px; }
.ex-icon-md { width: 20px; height: 20px; }
.ex-icon-lg { width: 24px; height: 24px; }
.ex-icon-xl { width: 28px; height: 28px; }

.ex-ico-tile {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: transform var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast) var(--ease-out);
}
.ex-ico-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255,255,255,.35), transparent 55%);
  pointer-events: none;
}
.ex-ico-tile:hover { transform: translateY(-2px) scale(1.03); }
.ex-ico-tile .ex-icon { width: 22px; height: 22px; position: relative; z-index: 1; }

.ex-ico-amber { background: linear-gradient(145deg, #fde68a, #F5A623); color: #0B1120; }
.ex-ico-navy { background: linear-gradient(145deg, #334155, #1A2B4A); color: #fbbf24; }
.ex-ico-sky { background: linear-gradient(145deg, #bae6fd, #0284C8); color: #0c4a6e; }
.ex-ico-emerald { background: linear-gradient(145deg, #a7f3d0, #059669); color: #064e3b; }
.ex-ico-rose { background: linear-gradient(145deg, #fecdd3, #e11d48); color: #881337; }
.ex-ico-soft { background: rgba(255,255,255,.75); border: 1px solid rgba(255,255,255,.85); color: #d97706; }

.icon-3d .ex-icon { width: 22px; height: 22px; }

.topbar {
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.65);
  padding-top: max(0px, var(--safe-t));
  z-index: 40;
}

.card, .glass-panel {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--admin-glass-border);
  border-radius: 22px;
  box-shadow: var(--shadow-3d);
  max-width: 100%;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  background: var(--admin-surface-solid);
}
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 680px; }
.data-table thead th {
  background: var(--brand-navy);
  padding: 12px 14px;
  text-align: right;
  font-weight: 800;
  color: #fbbf24;
  font-size: 11px;
  letter-spacing: .04em;
  border-bottom: 3px solid var(--brand-orange);
  white-space: nowrap;
}
.data-table tbody td { padding: 12px 14px; border-bottom: 1px solid #e2e8f0; color: var(--admin-ink); font-weight: 700; }
.data-table tbody tr:nth-child(even) { background: #f8fafc; }
.data-table tbody tr:hover { background: #fff7ed; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  gap: 4px;
  white-space: nowrap;
}
.badge-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.badge-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde047; }
.badge-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge-info { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.badge-neutral { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

.kpi-card {
  perspective: 900px;
  transform-style: preserve-3d;
  will-change: transform;
}
.kpi-card .kpi-inner {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--admin-glass-border);
  border-radius: 22px;
  box-shadow: var(--shadow-3d);
  transition: transform var(--motion-base) var(--ease-out), box-shadow var(--motion-base) var(--ease-out);
}
.kpi-card:hover .kpi-inner { box-shadow: 0 22px 44px rgba(15, 23, 42, 0.14); }

.icon-3d {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.ex-fade-up { animation: exFadeUp var(--motion-slow) var(--ease-out) both; }
.ex-stagger > *:nth-child(1) { animation-delay: 40ms; }
.ex-stagger > *:nth-child(2) { animation-delay: 80ms; }
.ex-stagger > *:nth-child(3) { animation-delay: 120ms; }
.ex-stagger > *:nth-child(4) { animation-delay: 160ms; }
.ex-stagger > *:nth-child(5) { animation-delay: 200ms; }
.ex-stagger > *:nth-child(6) { animation-delay: 240ms; }
.ex-lift { transition: transform var(--motion-fast) var(--ease-out); }
.ex-lift:hover { transform: translateY(-3px); }
.ex-shimmer {
  background: linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: exShimmer 1.2s linear infinite;
}
.ex-pulse-live { animation: exPulse 1.6s ease-in-out infinite; }

.bottom-tabbar {
  padding-bottom: max(8px, var(--safe-b));
  z-index: 70;
  border-radius: 18px 18px 0 0;
}
.tab-item {
  min-width: 56px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #64748B;
  font-weight: 800;
  font-size: 10px;
  touch-action: manipulation;
  transition: color var(--motion-fast) var(--ease-out), transform var(--motion-fast) var(--ease-out);
}
.tab-item.active, .tab-item:hover { color: #b45309; }
.tab-item.active { transform: translateY(-1px); }
.tab-item i { font-size: 17px; }

.sheet-modal {
  border-radius: 22px 22px 0 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.16);
}
.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: #cbd5e1;
  margin: 10px auto 6px;
}

.toast-host {
  bottom: calc(var(--tabbar-h) + 12px + var(--safe-b));
}
@media (min-width: 1024px) {
  .toast-host { bottom: 24px; }
}

.cmd-palette {
  border-radius: 18px;
  max-height: min(70vh, 520px);
}

.hero3d-wrap {
  height: 240px;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, rgba(26, 43, 74, 0.92), rgba(15, 23, 42, 0.88));
  box-shadow: var(--shadow-3d);
}
.hero3d-wrap canvas { width: 100% !important; height: 100% !important; display: block; }
.hero3d-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24;
  font-weight: 800;
}

/* Forms & module list helpers */
.form-control, .form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-ink);
  min-height: 44px;
  outline: none;
  font-family: inherit;
  transition: border-color var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast) var(--ease-out);
}
.form-control:focus, .form-input:focus {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px var(--orange-glow);
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  margin-bottom: 6px;
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { composes: none; }
.btn.btn-primary, a.btn-primary, button.btn-primary {
  background: linear-gradient(135deg, #fbbf24 0%, #F5A623 50%, #d97706 100%) !important;
  color: #0B1120 !important;
  font-weight: 800 !important;
  border: 1px solid rgba(251, 191, 36, 0.55) !important;
  border-radius: 14px;
  padding: 11px 18px;
  min-height: 44px;
  font-size: 13px;
}
.btn.btn-secondary, a.btn-secondary {
  background: var(--brand-navy) !important;
  color: #fbbf24 !important;
  font-weight: 800 !important;
  border: 1px solid #334155 !important;
  border-radius: 14px;
  padding: 11px 18px;
  min-height: 44px;
  font-size: 13px;
}
.section-tag {
  display: inline-flex;
  font-size: 10px;
  font-weight: 800;
  color: #b45309;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--admin-ink);
}
.ex-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.35);
  color: #b45309;
}
.ex-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  transition: transform var(--motion-fast) var(--ease-out), background var(--motion-fast) var(--ease-out);
  touch-action: manipulation;
}
.ex-action:hover { transform: translateY(-1px); }
.ex-action-edit { background: rgba(245, 166, 35, 0.15); color: #b45309; }
.ex-action-edit:hover { background: rgba(245, 166, 35, 0.28); }
.ex-action-danger { background: rgba(225, 29, 72, 0.1); color: #e11d48; }
.ex-action-danger:hover { background: rgba(225, 29, 72, 0.2); }
.ex-action-ok { background: rgba(5, 150, 105, 0.12); color: #059669; }
.ex-action-ok:hover { background: rgba(5, 150, 105, 0.22); }
.mobile-card-list { display: none; }
@media (max-width: 767px) {
  .desktop-table-wrap { display: none !important; }
  .mobile-card-list { display: block; }
}

[x-cloak] { display: none !important; }

@keyframes exFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ex-float {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(18px, -22px, 0); }
}
@keyframes exShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes exPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.92); }
}

@media (prefers-reduced-motion: reduce) {
  .admin-blob, .ex-fade-up, .ex-shimmer, .ex-pulse-live, .kpi-card .kpi-inner { animation: none !important; }
  .kpi-card, .ex-lift, .nav-link, .btn-b2b-gold, .btn-b2b-navy { transition: none !important; transform: none !important; }
}

@media (max-width: 1023px) {
  .admin-main-pad { padding-bottom: calc(var(--tabbar-h) + 18px + var(--safe-b)) !important; }
}
