@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --sat: env(safe-area-inset-top);
  --sab: env(safe-area-inset-bottom);
  --sal: env(safe-area-inset-left);
  --sar: env(safe-area-inset-right);
}

* {
  box-sizing: border-box;
}

html, body {
  background-color: #09090b;
  color: #f4f4f5;
  font-family: var(--font-main);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

/* Custom Smooth Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(24, 24, 27, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(113, 113, 122, 0.4);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.8);
}

.touch-scroll {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* ==========================================================================
   V0 PREMIUM DASHBOARD ARCHITECTURE (DEEP CHARCOAL & ZINC 950)
   ========================================================================== */

/* Outer Canvas Container */
.dashboard-outer-canvas {
  min-height: 100vh;
  background-color: #09090b;
  padding: 0.5rem;
}

@media (min-width: 640px) {
  .dashboard-outer-canvas {
    padding: 1rem 1.25rem;
  }
}

@media (min-width: 1024px) {
  .dashboard-outer-canvas {
    padding: 1.5rem 2rem;
  }
}

/* Inner Shell Frame */
.dashboard-inner-shell {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 1.25rem;
  background-color: #121215;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
}

@media (min-width: 640px) {
  .dashboard-inner-shell {
    border-radius: 1.75rem;
    padding: 1.25rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .dashboard-inner-shell {
    border-radius: 2rem;
    padding: 1.75rem 2rem;
  }
}

/* Bento Card Style */
.bento-card {
  background: #18181c;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  color: #f4f4f5;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

@media (min-width: 640px) {
  .bento-card {
    border-radius: 1.25rem;
  }
}

@media (hover: hover) {
  .bento-card:hover {
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
    transform: translateY(-1.5px);
  }
}

.bento-card-subtle {
  background: #151518;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Bento Inset Item (List Rows & Tiles) */
.bento-item {
  border-radius: 0.875rem;
  padding: 0.65rem 0.85rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: #151519;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #f4f4f5;
}

.bento-item:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background-color: #1e1e24;
}

/* ===============================================================
   PILL NAVIGATION SYSTEM (V0 STYLE - CRISP WHITE ACTIVE PILL)
   =============================================================== */

.nav-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  border: none;
  outline: none;
  color: #cbd5e1;
  background-color: transparent;
}

@media (min-width: 640px) {
  .nav-pill-btn {
    padding: 0.5rem 1.15rem;
    font-size: 0.8125rem;
  }
}

.nav-pill-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-pill-btn.active {
  background-color: #ffffff !important;
  color: #09090b !important;
  box-shadow: 0 2px 12px rgba(255, 255, 255, 0.3) !important;
  font-weight: 800 !important;
}

.nav-pill-btn.active * {
  color: #09090b !important;
}

/* ===============================================================
   INPUTS & MODALS
   =============================================================== */

.glass-dropdown {
  background: #18181c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
  border-radius: 1.25rem;
  color: #f4f4f5;
}

.glass-input {
  background: #121215;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f4f4f5;
  transition: all 0.2s ease;
}

.glass-input:focus {
  background: #18181c;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
  outline: none;
}

.font-mono-num {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.stock-progress-bar {
  height: 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

.stock-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.touch-target {
  min-height: 38px;
  min-width: 38px;
}

/* Range Inputs (Simulator Sliders) */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #6366f1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.badge-category {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Tables */
table thead tr {
  background-color: rgba(9, 9, 11, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

table thead th {
  color: #a1a1aa;
  font-weight: 700;
}

table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.15s ease;
}

table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

/* ===============================================================
   TOAST NOTIFICATIONS (SLEEK DARK GLOW)
   =============================================================== */

.toast-card {
  border-radius: 1rem;
  padding: 0.85rem 1.1rem;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(24, 24, 28, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f4f4f5;
}

.toast-card.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
}
.toast-card.toast-warning {
  border-color: rgba(245, 158, 11, 0.4);
}
.toast-card.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
}
.toast-card.toast-info {
  border-color: rgba(99, 102, 241, 0.4);
}

.toast-card h5 {
  color: #ffffff;
  font-weight: 800;
}

.toast-card p {
  color: #cbd5e1;
  font-weight: 500;
}

/* ===============================================================
   SKELETON SHIMMER LOADERS (V0 / APPLE STYLE)
   =============================================================== */

@keyframes shimmerEffect {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.skeleton-shimmer {
  position: relative;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.skeleton-shimmer::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.04) 20%,
    rgba(255, 255, 255, 0.1) 60%,
    rgba(255, 255, 255, 0)
  );
  animation: shimmerEffect 1.6s infinite cubic-bezier(0.4, 0, 0.2, 1);
  content: '';
}

/* ===============================================================
   ACCESSIBILITY & FOCUS VISIBLE (WCAG 2.1 AA)
   =============================================================== */

:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}

/* Ergonomie tactile POS Mobile (minimum 44px) */
.touch-btn-pos {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
