/* Veylix Admin Panel Glassmorphic & Isometric Styles */
:root {
  --bg-canvas: #EDE5D4;
  --card-bg: rgba(251, 248, 240, 0.88);
  --card-border: rgba(255, 255, 255, 0.88);
  --text-primary: #23201A;
  --text-secondary: #6B5E4E;
  --text-muted: #948574;
}

[data-theme="dark"] {
  --bg-canvas: #14110E;
  --card-bg: rgba(30, 25, 21, 0.92);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #F5EFE6;
  --text-secondary: #BCAE9E;
  --text-muted: #827566;
}

/* Native View Transition Circular Theme Reveal (Exact Lullo / Kora Studio Effect) */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 9999; }

/* Fallback radial wipe overlay when View Transitions API is unavailable */
#theme-ripple-fallback {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
}
#theme-ripple-fallback.active {
  opacity: 1;
  animation: rippleFade 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes rippleFade {
  0% { opacity: 0.95; clip-path: circle(0px at var(--rx) var(--ry)); }
  70% { opacity: 0.95; clip-path: circle(var(--rr) at var(--rx) var(--ry)); }
  100% { opacity: 0; clip-path: circle(var(--rr) at var(--rx) var(--ry)); }
}

/* Theme icon spin */
.theme-icon-spin {
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-theme="dark"] .theme-icon-spin {
  transform: rotate(180deg);
}

.admin-theme-toggle-btn {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(220, 210, 195, 0.8);
  color: #30271F;
}
.admin-theme-toggle-btn:hover {
  background: #FFFFFF;
  border-color: rgba(183, 138, 74, 0.4);
}
[data-theme="dark"] .admin-theme-toggle-btn {
  background: rgba(42, 35, 29, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F4EDE4;
}
[data-theme="dark"] .admin-theme-toggle-btn:hover {
  background: rgba(56, 47, 39, 0.95);
  border-color: rgba(245, 158, 11, 0.45);
}

.admin-body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at 50% 22%, #F6F0E2 0%, #ECE4D2 55%, #E3DAC6 100%);
  color: #23201A;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
  transition: color 0.2s ease;
}

/* Shell Layout */
.v-shell {
  max-width: 1640px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  min-height: 100vh;
}

@media (max-width: 1023px) {
  .v-shell {
    padding: 10px;
    gap: 12px;
  }
}

/* Warm Glassmorphic Cards matching Veylix design */
.v-card {
  background: linear-gradient(165deg, rgba(253, 251, 245, 0.92) 0%, rgba(246, 240, 228, 0.84) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px -6px rgba(105, 89, 58, 0.07), 0 2px 6px -1px rgba(105, 89, 58, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}

.v-card:hover {
  box-shadow: 0 14px 34px -6px rgba(105, 89, 58, 0.11), 0 4px 10px -2px rgba(105, 89, 58, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.v-pill-row {
  background: rgba(244, 239, 227, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 13px;
  transition: all 0.2s ease;
}

.v-pill-row:hover {
  background: rgba(255, 252, 244, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(105, 89, 58, 0.06);
}

/* Tinted rows */
.row-tint-green {
  background: linear-gradient(90deg, rgba(224, 242, 231, 0.74) 0%, rgba(244, 247, 239, 0.56) 100%);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.row-tint-blue {
  background: linear-gradient(90deg, rgba(228, 238, 248, 0.74) 0%, rgba(244, 245, 248, 0.56) 100%);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.row-tint-purple {
  background: linear-gradient(90deg, rgba(239, 233, 246, 0.74) 0%, rgba(247, 242, 248, 0.56) 100%);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.row-tint-amber {
  background: linear-gradient(90deg, rgba(249, 238, 223, 0.78) 0%, rgba(250, 244, 233, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.row-tint-yellow-active {
  background: linear-gradient(135deg, rgba(253, 242, 202, 0.92) 0%, rgba(249, 233, 182, 0.82) 100%);
  border: 1px solid rgba(235, 195, 94, 0.5);
}

/* Sidebar active pill */
.nav-item-active {
  background: linear-gradient(90deg, #FDF0B8 0%, #FCE89C 100%);
  box-shadow: 0 2px 10px rgba(234, 179, 8, 0.16), inset 0 1px 0 rgba(255,255,255,0.85);
  color: #1F1B12 !important;
  font-weight: 600;
  position: relative;
}
.nav-item-active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  border-radius: 4px;
  background: #EAB308;
}

/* ================= 3D WAREHOUSE ANIMATIONS ================= */
@keyframes studioBoxSlide {
  0% {
    transform: translate(0px, 0px);
    opacity: 0;
  }
  7% {
    transform: translate(-15px, 7.5px);
    opacity: 1;
  }
  89% {
    transform: translate(-188px, 94px);
    opacity: 1;
  }
  97% {
    transform: translate(-208px, 104px);
    opacity: 0;
  }
  100% {
    transform: translate(-208px, 104px);
    opacity: 0;
  }
}

.studio-conv-box-1 {
  animation: studioBoxSlide 6.0s linear infinite;
}
.studio-conv-box-2 {
  animation: studioBoxSlide 6.0s linear infinite;
  animation-delay: -2.0s;
}
.studio-conv-box-3 {
  animation: studioBoxSlide 6.0s linear infinite;
  animation-delay: -4.0s;
}

@keyframes rollerShimmer {
  to {
    stroke-dashoffset: -27;
  }
}
.roller-shimmer-line {
  stroke-dasharray: 3.5 10;
  animation: rollerShimmer 0.75s linear infinite;
}

@keyframes palletHydraulic {
  0%, 100% { transform: translateY(0px); }
  45%, 58% { transform: translateY(-5.5px); }
}
.studio-pallet-lift {
  animation: palletHydraulic 3.8s ease-in-out infinite;
}

@keyframes packingBob {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-3px) scale(1.02); }
}
.studio-packing-box {
  transform-origin: 344px 249px;
  animation: packingBob 2.6s ease-in-out infinite;
}

@keyframes neonBagGlow {
  0%, 100% {
    opacity: 0.45;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.06);
  }
}
.studio-neon-halo {
  transform-origin: 399px 124px;
  animation: neonBagGlow 2.4s ease-in-out infinite;
}

@keyframes shelfWarmBreathe {
  0%, 100% { opacity: 0.18; }
  50% { opacity: 0.48; }
}
.studio-shelf-glow {
  animation: shelfWarmBreathe 3.4s ease-in-out infinite;
}

@keyframes scannerBeam {
  0%, 100% { opacity: 0.2; transform: translateY(0px); }
  50% { opacity: 0.9; transform: translateY(3px); }
}
.studio-scanner-laser {
  animation: scannerBeam 1.0s ease-in-out infinite;
}

@keyframes floatTag {
  0% { transform: translateY(6px); opacity: 0; }
  18% { transform: translateY(0px); opacity: 1; }
  82% { transform: translateY(-7px); opacity: 1; }
  100% { transform: translateY(-13px); opacity: 0; }
}
.floating-tag-1 {
  animation: floatTag 4.2s ease-in-out infinite;
}
.floating-tag-2 {
  animation: floatTag 4.2s ease-in-out infinite;
  animation-delay: -2.1s;
}

@keyframes hotspotPing {
  0% { transform: scale(1); opacity: 0.85; }
  75%, 100% { transform: scale(2.3); opacity: 0; }
}
.hotspot-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: hotspotPing 2.1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* Speed & Pause states */
.warehouse-Paused * {
  animation-play-state: paused !important;
}
.warehouse-Fast .studio-conv-box-1,
.warehouse-Fast .studio-conv-box-2,
.warehouse-Fast .studio-conv-box-3 {
  animation-duration: 2.8s !important;
}
.warehouse-Fast .roller-shimmer-line {
  animation-duration: 0.35s !important;
}

/* Soft vignette mask so 3D studio warehouse blends seamlessly into cream background */
.warehouse-vignette {
  mask-image: radial-gradient(ellipse 92% 90% at 50% 48%, #000 76%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 92% 90% at 50% 48%, #000 76%, transparent 100%);
}

/* Next-Level Responsive Utilities */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

@media (max-width: 640px) {
  .v-card {
    border-radius: 18px;
  }
}

/* ================= COMPREHENSIVE DARK THEME RULES ================= */
[data-theme="dark"] .admin-body,
[data-theme="dark"].admin-body,
html[data-theme="dark"] body {
  background: radial-gradient(circle at 50% 22%, #1D1814 0%, #15120F 55%, #0B0A08 100%) !important;
  color: #F4EDE4 !important;
}

/* Glassmorphic cards in Dark Mode */
[data-theme="dark"] .v-card {
  background: linear-gradient(165deg, rgba(34, 28, 24, 0.94) 0%, rgba(24, 20, 17, 0.94) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 12px 36px -6px rgba(0, 0, 0, 0.5), 0 2px 8px -1px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

[data-theme="dark"] .v-card:hover {
  box-shadow: 0 16px 42px -6px rgba(0, 0, 0, 0.65), 0 4px 12px -2px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

/* Pill rows in Dark Mode */
[data-theme="dark"] .v-pill-row {
  background: rgba(38, 32, 27, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .v-pill-row:hover {
  background: rgba(50, 42, 36, 0.9) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

/* Tinted Rows in Dark Mode */
[data-theme="dark"] .row-tint-green {
  background: linear-gradient(90deg, rgba(28, 44, 34, 0.75) 0%, rgba(22, 36, 28, 0.6) 100%) !important;
  border: 1px solid rgba(74, 107, 83, 0.35) !important;
}
[data-theme="dark"] .row-tint-blue {
  background: linear-gradient(90deg, rgba(28, 40, 56, 0.75) 0%, rgba(22, 32, 46, 0.6) 100%) !important;
  border: 1px solid rgba(91, 117, 150, 0.35) !important;
}
[data-theme="dark"] .row-tint-purple {
  background: linear-gradient(90deg, rgba(42, 32, 54, 0.75) 0%, rgba(34, 26, 44, 0.6) 100%) !important;
  border: 1px solid rgba(147, 112, 179, 0.35) !important;
}
[data-theme="dark"] .row-tint-amber {
  background: linear-gradient(90deg, rgba(50, 38, 26, 0.75) 0%, rgba(40, 30, 20, 0.6) 100%) !important;
  border: 1px solid rgba(198, 138, 50, 0.35) !important;
}
[data-theme="dark"] .row-tint-yellow-active {
  background: linear-gradient(135deg, rgba(62, 50, 22, 0.88) 0%, rgba(50, 38, 16, 0.78) 100%) !important;
  border: 1px solid rgba(234, 179, 8, 0.45) !important;
}

/* Active navigation item in Dark Mode */
[data-theme="dark"] .nav-item-active {
  background: linear-gradient(90deg, #443520 0%, #524024 100%) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  color: #FDE68A !important;
}
[data-theme="dark"] .nav-item-active::before {
  background: #F59E0B !important;
}

/* Text Colors in Dark Mode */
[data-theme="dark"] .admin-body .text-stone-900,
[data-theme="dark"] .admin-body .text-stone-800 {
  color: #F4EDE4 !important;
}
[data-theme="dark"] .admin-body .text-stone-700 {
  color: #D8CEBF !important;
}
[data-theme="dark"] .admin-body .text-stone-600 {
  color: #B5A898 !important;
}
[data-theme="dark"] .admin-body .text-stone-500 {
  color: #928575 !important;
}
[data-theme="dark"] .admin-body .text-stone-400 {
  color: #7A6F62 !important;
}

/* Headings in Dark Mode */
[data-theme="dark"] .admin-body h1,
[data-theme="dark"] .admin-body h2,
[data-theme="dark"] .admin-body h3,
[data-theme="dark"] .admin-body h4 {
  color: #F4EDE4 !important;
}

/* Background elements adapting to Dark Mode */
[data-theme="dark"] .admin-body .bg-white,
[data-theme="dark"] .admin-body .bg-white\/70,
[data-theme="dark"] .admin-body .bg-white\/80,
[data-theme="dark"] .admin-body .bg-white\/90,
[data-theme="dark"] .admin-body .bg-\[\#FAF7F0\],
[data-theme="dark"] .admin-body .bg-\[\#FAF6EC\],
[data-theme="dark"] .admin-body .bg-stone-50,
[data-theme="dark"] .admin-body .bg-stone-100 {
  background-color: #231E19 !important;
}

[data-theme="dark"] .admin-body .bg-stone-200\/60,
[data-theme="dark"] .admin-body .bg-stone-200\/80,
[data-theme="dark"] .admin-body .bg-stone-200 {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Borders in Dark Mode */
[data-theme="dark"] .admin-body .border-stone-200,
[data-theme="dark"] .admin-body .border-stone-200\/60,
[data-theme="dark"] .admin-body .border-stone-200\/70,
[data-theme="dark"] .admin-body .border-stone-200\/80,
[data-theme="dark"] .admin-body .border-stone-200\/90,
[data-theme="dark"] .admin-body .border-stone-300,
[data-theme="dark"] .admin-body .border-white\/80,
[data-theme="dark"] .admin-body .border-white\/90,
[data-theme="dark"] .admin-body .border-white\/20 {
  border-color: rgba(255, 255, 255, 0.09) !important;
}

/* Inputs, textareas, selects in Dark Mode */
[data-theme="dark"] .admin-body input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] .admin-body textarea,
[data-theme="dark"] .admin-body select {
  background-color: #1A1612 !important;
  color: #F4EDE4 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}
[data-theme="dark"] .admin-body input::placeholder,
[data-theme="dark"] .admin-body textarea::placeholder {
  color: #7A6F62 !important;
}
[data-theme="dark"] .admin-body select option {
  background-color: #231E19 !important;
  color: #F4EDE4 !important;
}

/* Dropdown menus & Popovers in Dark Mode */
[data-theme="dark"] .admin-body .ring-black\/5 {
  --tw-ring-color: rgba(255, 255, 255, 0.1) !important;
}

/* Hover effects in Dark Mode */
[data-theme="dark"] .admin-body .hover\:bg-white\/60:hover,
[data-theme="dark"] .admin-body .hover\:bg-white:hover,
[data-theme="dark"] .admin-body .hover\:bg-stone-100:hover,
[data-theme="dark"] .admin-body .hover\:bg-stone-200\/50:hover,
[data-theme="dark"] .admin-body .hover\:bg-stone-200\/60:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
}
[data-theme="dark"] .admin-body .hover\:text-stone-900:hover,
[data-theme="dark"] .admin-body .hover\:text-stone-800:hover,
[data-theme="dark"] .admin-body .hover\:text-stone-700:hover {
  color: #FFFFFF !important;
}

/* Tables in Dark Mode */
[data-theme="dark"] .admin-body table thead {
  background-color: rgba(26, 22, 18, 0.95) !important;
}
[data-theme="dark"] .admin-body table tr {
  border-color: rgba(255, 255, 255, 0.06) !important;
}
[data-theme="dark"] .admin-body table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.03) !important;
}
[data-theme="dark"] .admin-body .divide-stone-200 > :not([hidden]) ~ :not([hidden]),
[data-theme="dark"] .admin-body .divide-stone-200\/60 > :not([hidden]) ~ :not([hidden]) {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Keyboard badge in Dark Mode */
[data-theme="dark"] .admin-body kbd {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #928575 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Scrollbars in Dark Mode */
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: transparent !important;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16) !important;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28) !important;
}

/* 3D warehouse isometric illustration in dark mode */
[data-theme="dark"] .warehouse-vignette {
  mask-image: radial-gradient(ellipse 92% 90% at 50% 48%, #000 68%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 92% 90% at 50% 48%, #000 68%, transparent 100%);
  filter: brightness(0.95) contrast(1.05);
}

/* Rich Text Editor Typography (Tailwind v4 Preflight restoration) */
.hk-rich-content h1 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0.75rem 0 0.45rem;
  color: #1c1917;
}
.hk-rich-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0.65rem 0 0.4rem;
  color: #292524;
}
.hk-rich-content h3 {
  font-size: 1.075rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0.5rem 0 0.3rem;
}
.hk-rich-content p {
  margin: 0 0 0.5rem;
}
.hk-rich-content ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}
.hk-rich-content ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}
.hk-rich-content li {
  display: list-item;
  margin: 0.2rem 0;
}
.hk-rich-content blockquote {
  border-left: 3px solid #B78A4A;
  padding: 0.45rem 0.9rem;
  margin: 0.6rem 0;
  font-style: italic;
  background: rgba(183, 138, 74, 0.08);
  border-radius: 0 0.5rem 0.5rem 0;
  color: #57534e;
}
.hk-rich-content a {
  color: #b45309;
  text-decoration: underline;
  font-weight: 600;
}
.hk-rich-content b,
.hk-rich-content strong {
  font-weight: 700;
}
.hk-rich-content i,
.hk-rich-content em {
  font-style: italic;
}
.hk-rich-content u {
  text-decoration: underline;
}
.hk-rich-content s,
.hk-rich-content strike {
  text-decoration: line-through;
}
.hk-rich-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 0.5rem 0;
}
[data-theme="dark"] .admin-body .hk-rich-content,
[data-theme="dark"] .admin-body .hk-rich-content h1,
[data-theme="dark"] .admin-body .hk-rich-content h2,
[data-theme="dark"] .admin-body .hk-rich-content h3 {
  color: #f5efe6;
}
[data-theme="dark"] .admin-body .hk-rich-content blockquote {
  color: #d6c8b6;
  background: rgba(245, 158, 11, 0.12);
}
.hk-rich-content pre {
  background: #1c1917;
  color: #fef3c7;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  overflow-x: auto;
  margin: 0.6rem 0;
}
.hk-rich-content code {
  background: rgba(183, 138, 74, 0.14);
  color: #75462F;
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
}
.hk-rich-content hr {
  border: 0;
  border-top: 1px solid #d6c8b6;
  margin: 0.9rem 0;
}
.hk-rich-content table.hk-rich-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.85em;
}
.hk-rich-content table.hk-rich-table th,
.hk-rich-content table.hk-rich-table td {
  border: 1px solid #d6c8b6;
  padding: 0.45rem 0.65rem;
  text-align: left;
}
.hk-rich-content table.hk-rich-table th {
  background: #f5efe6;
  font-weight: 700;
}
.hk-rich-content ul.hk-checklist {
  list-style: none;
  padding-left: 0.25rem;
}
.hk-rich-content ul.hk-checklist li::before {
  content: '☑ ';
  color: #15803d;
  font-weight: 700;
}
.hk-rich-content .hk-callout {
  padding: 0.65rem 0.9rem;
  border-radius: 0.65rem;
  margin: 0.7rem 0;
  border-left: 4px solid #B78A4A;
  background: #fdf8ee;
}
.hk-rich-content .hk-callout-tip {
  border-left-color: #15803d;
  background: #f0fdf4;
}
.hk-rich-content .hk-callout-info {
  border-left-color: #1d4ed8;
  background: #eff6ff;
}
.hk-rich-content .hk-callout-warning {
  border-left-color: #b91c1c;
  background: #fef2f2;
}
.hk-rich-content details.hk-faq-block {
  border: 1px solid #e7dfd2;
  border-radius: 0.65rem;
  padding: 0.5rem 0.85rem;
  margin: 0.65rem 0;
  background: #faf7f0;
}
.hk-rich-content details.hk-faq-block summary {
  font-weight: 700;
  cursor: pointer;
}


