/* PureLabs SmartStock — premium.css v5.1 VISUAL IMPACT */

/* FONT SYSTEM - Fallback locali se Google Fonts non disponibile */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');

/* KEYFRAMES */
@keyframes pl5RowIn {
  from { opacity:0; transform:translateX(-8px); }
  to   { opacity:1; transform:translateX(0); }
}
@keyframes pl5FadeUp {
  from { opacity:0; transform:translateY(14px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes pl5ScaleIn {
  from { opacity:0; transform:scale(0.95); }
  to   { opacity:1; transform:scale(1); }
}
@keyframes pl5Glow {
  0%,100% { opacity:1; }
  50% { opacity:0.5; }
}
@keyframes pl5GradBar {
  0%,100% { background-position:0% 50%; }
  50%      { background-position:100% 50%; }
}
@keyframes pl5Overlay {
  from { opacity:0; }
  to { opacity:1; }
}
@keyframes pl5PanelUp {
  from { opacity:0; transform:translateY(24px) scale(0.97); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}

/* GLOBAL */
* { box-sizing:border-box; }
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:#f1f5f9; }
::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:99px; }
::-webkit-scrollbar-thumb:hover { background:#C8102E; }

/* ── BODY & LAYOUT ── */
body {
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif !important;
  background:#f0f4f8 !important;
  color:#0f172a !important;
  -webkit-font-smoothing:antialiased;
}

/* ── MAIN CONTENT AREA ── */
main.main-content, .main-content {
  background:#f0f4f8 !important;
  padding:0 !important;
}

/* ── TAB PANEL ── */
.tab-panel {
  animation:pl5FadeUp 0.4s cubic-bezier(0.16,1,0.3,1) both !important;
  min-height:100vh;
}

/* ── SIDEBAR PREMIUM ── */
aside.sidebar, .sidebar {
  background:#ffffff !important;
  border-right:2px solid #e9edf3 !important;
  box-shadow:4px 0 24px rgba(15,23,42,0.06) !important;
}

.nav-link {
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  padding:10px 14px !important;
  border-radius:10px !important;
  margin:2px 10px !important;
  font-size:13px !important;
  font-weight:600 !important;
  color:#475569 !important;
  text-decoration:none !important;
  transition:all 0.18s cubic-bezier(0.16,1,0.3,1) !important;
  position:relative !important;
}
.nav-link:hover {
  background:rgba(200,16,46,0.08) !important;
  color:#C8102E !important;
  transform:translateX(3px) !important;
}
.nav-link.active {
  background:rgba(200,16,46,0.1) !important;
  color:#C8102E !important;
  font-weight:800 !important;
}
.nav-link.active::before {
  content:'' !important;
  position:absolute !important;
  left:-10px !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  width:3px !important;
  height:60% !important;
  background:#C8102E !important;
  border-radius:99px !important;
}

/* ── THEAD ROSSO PURELABS — MOLTO VISIBILE ── */
table thead tr {
  background:linear-gradient(135deg, #C8102E 0%, #a30d24 100%) !important;
}
table thead th {
  color:#ffffff !important;
  font-weight:800 !important;
  font-size:10.5px !important;
  letter-spacing:0.08em !important;
  text-transform:uppercase !important;
  padding:13px 16px !important;
  border-bottom:none !important;
  white-space:nowrap !important;
}

/* ── RIGHE TABELLA A ZEBRA FORTE ── */
table {
  width:100% !important;
  border-collapse:separate !important;
  border-spacing:0 !important;
  font-size:13px !important;
}
table tbody tr:nth-child(odd)  { background:#ffffff !important; }
table tbody tr:nth-child(even) { background:#f8fafc !important; }
table tbody tr {
  border-bottom:1px solid #e9edf3 !important;
  transition:all 0.18s cubic-bezier(0.16,1,0.3,1) !important;
}
table tbody tr:hover {
  background:linear-gradient(90deg, rgba(200,16,46,0.08) 0%, rgba(200,16,46,0.03) 50%, #fff8f8 100%) !important;
  box-shadow:inset 4px 0 0 0 #C8102E !important;
  transform:translateX(2px) !important;
}
table td {
  padding:12px 16px !important;
  vertical-align:middle !important;
  color:#334155 !important;
  border-bottom:1px solid rgba(226,232,240,0.6) !important;
  font-size:12.5px !important;
  font-family:'Inter',sans-serif !important;
}

/* Rimuovi hover inline dai tr (via attr selector) */
table tbody tr[onmouseover] {
  background:transparent !important;
}

/* ── HEADER SEZIONI (h1 nei tab) ── */
h1, h2, h3 {
  font-family:'Outfit',-apple-system,sans-serif !important;
  letter-spacing:-0.02em !important;
}

/* ── CARD CONTENUTO (solo classi esplicite) ── */
.lux-card, [class*="lux-card"] {
  border-radius:18px !important;
  box-shadow:0 4px 20px rgba(15,23,42,0.06) !important;
  border:1.5px solid #e9edf3 !important;
}

/* ── BOTTONI PRIMARI ── */
button[style*="#C8102E"],
button[style*="linear-gradient(135deg,#C8102E"],
button[style*="linear-gradient(135deg, #C8102E"],
.btn-lux-primary {
  background:linear-gradient(135deg, #C8102E 0%, #a30d24 100%) !important;
  color:#fff !important;
  border:none !important;
  border-radius:10px !important;
  font-weight:700 !important;
  font-family:'Inter',sans-serif !important;
  box-shadow:0 4px 16px rgba(200,16,46,0.28) !important;
  transition:all 0.22s cubic-bezier(0.16,1,0.3,1) !important;
}
button[style*="#C8102E"]:hover,
.btn-lux-primary:hover {
  transform:translateY(-2px) !important;
  box-shadow:0 8px 28px rgba(200,16,46,0.38) !important;
}

/* ── BOTTONI SECONDARI ── */
button, .btn {
  font-family:'Inter',sans-serif !important;
  font-weight:700 !important;
  border-radius:10px !important;
  transition:all 0.2s cubic-bezier(0.16,1,0.3,1) !important;
}

/* ── INPUT & SELECT ── */
input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
select, textarea {
  font-family:'Inter',sans-serif !important;
  border:1.5px solid #e2e8f0 !important;
  border-radius:10px !important;
  padding:10px 13px !important;
  font-size:13px !important;
  color:#0f172a !important;
  background:#fafcff !important;
  transition:border-color 0.2s, box-shadow 0.2s !important;
  outline:none !important;
}
input:focus, select:focus, textarea:focus {
  border-color:#C8102E !important;
  box-shadow:0 0 0 3px rgba(200,16,46,0.12) !important;
  background:#fff !important;
}

/* ── BADGES ── */
[class*="badge-"], span[style*="background:#C8102E"],
span[style*="background: #C8102E"] {
  font-family:'JetBrains Mono','Courier New',monospace !important;
  font-weight:800 !important;
  font-size:11px !important;
  border-radius:6px !important;
  letter-spacing:0.02em !important;
}

/* ── KPI CARD HOVER ── */
[style*="border-radius:16px"]:hover,
[style*="border-radius: 16px"]:hover {
  transform:translateY(-5px) !important;
  box-shadow:0 16px 40px rgba(15,23,42,0.12) !important;
}

/* ── MODAL OVERLAY ── */
[id*="-modal"][style*="position: fixed"],
[id*="-modal"][style*="position:fixed"] {
  backdrop-filter:blur(14px) saturate(1.8) !important;
  -webkit-backdrop-filter:blur(14px) saturate(1.8) !important;
  animation:pl5Overlay 0.25s ease both !important;
}

/* ── PANNELLO MODALE ── */
[id*="-modal"] > div[style*="border-radius:2"],
[id*="-modal"] > div[style*="border-radius: 2"] {
  animation:pl5PanelUp 0.38s cubic-bezier(0.16,1,0.3,1) both !important;
  box-shadow:0 50px 100px -12px rgba(15,23,42,0.3) !important;
}

/* ── ANIMAZIONE RIGHE TABELLA ── */
table tbody tr:nth-child(1)  { animation:pl5RowIn 0.20s 0.00s cubic-bezier(0.16,1,0.3,1) both; }
table tbody tr:nth-child(2)  { animation:pl5RowIn 0.20s 0.02s cubic-bezier(0.16,1,0.3,1) both; }
table tbody tr:nth-child(3)  { animation:pl5RowIn 0.20s 0.04s cubic-bezier(0.16,1,0.3,1) both; }
table tbody tr:nth-child(4)  { animation:pl5RowIn 0.20s 0.06s cubic-bezier(0.16,1,0.3,1) both; }
table tbody tr:nth-child(5)  { animation:pl5RowIn 0.20s 0.08s cubic-bezier(0.16,1,0.3,1) both; }
table tbody tr:nth-child(6)  { animation:pl5RowIn 0.20s 0.10s cubic-bezier(0.16,1,0.3,1) both; }
table tbody tr:nth-child(7)  { animation:pl5RowIn 0.20s 0.12s cubic-bezier(0.16,1,0.3,1) both; }
table tbody tr:nth-child(8)  { animation:pl5RowIn 0.20s 0.14s cubic-bezier(0.16,1,0.3,1) both; }
table tbody tr:nth-child(n+9) { animation:pl5RowIn 0.20s 0.16s cubic-bezier(0.16,1,0.3,1) both; }


/* ═══ TOPBAR PREMIUM ══════════════════════════════════════ */
header, .topbar, nav.topbar, [class*="topbar"], [class*="top-bar"] {
  background:#ffffff !important;
  border-bottom:2px solid #e9edf3 !important;
  box-shadow:0 2px 20px rgba(15,23,42,0.06) !important;
  backdrop-filter:none !important;
}

/* Logo SmartStock */
.logo, [class*="logo"], .brand {
  font-family:'Outfit',sans-serif !important;
  font-weight:900 !important;
  letter-spacing:-0.03em !important;
}

/* Badge Live — verde pulsante */
[class*="live-badge"], span[style*="background:#10B981"],
span[style*="background: #10B981"] {
  animation:pl5Glow 2s ease-in-out infinite !important;
}

/* ═══ SIDEBAR ITEM ATTIVO CON BARRA ══════════════════════ */
.nav-item.active a, .nav-link.active,
a[class*="nav"][class*="active"],
[class*="sidebar"] a[class*="active"] {
  background:rgba(200,16,46,0.08) !important;
  color:#C8102E !important;
  font-weight:800 !important;
  position:relative !important;
}

/* ═══ KPI CARD ANIMAZIONE NUMERO ════════════════════════ */
@keyframes pl5CountUp {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}
[id*="kpi-"] {
  animation:pl5CountUp 0.5s cubic-bezier(0.16,1,0.3,1) both !important;
}

/* ═══ SEARCH BAR GLOBALE ═════════════════════════════════ */
input[type="search"], input[placeholder*="Cerca"],
input[placeholder*="cerca"], input[placeholder*="Filtra"],
#global-search-input {
  border:1.5px solid #e2e8f0 !important;
  border-radius:10px !important;
  font-family:'Inter',sans-serif !important;
  font-size:13px !important;
  padding:9px 14px !important;
  transition:all 0.2s !important;
  outline:none !important;
}
input[type="search"]:focus, #global-search-input:focus {
  border-color:#C8102E !important;
  box-shadow:0 0 0 3px rgba(200,16,46,0.1) !important;
}

/* ═══ MODALE PREMIUM ════════════════════════════════════ */
[id$="-modal"] {
  animation:pl5Overlay 0.2s ease both !important;
}
[id$="-modal"] > [style*="background:#fff"],
[id$="-modal"] > [style*="background: #fff"] {
  border-radius:22px !important;
  box-shadow:0 50px 100px -20px rgba(15,23,42,0.28) !important;
  animation:pl5PanelUp 0.35s cubic-bezier(0.16,1,0.3,1) both !important;
}

/* ═══ CHIP / FILTER TAGS ════════════════════════════════ */
[class*="chip"], [class*="tag"], [class*="filter-btn"],
button[style*="border-radius:999px"], button[style*="border-radius: 999px"] {
  font-weight:700 !important;
  letter-spacing:0.02em !important;
  transition:all 0.18s cubic-bezier(0.16,1,0.3,1) !important;
}

/* ═══ EMPTY STATE ════════════════════════════════════════ */
[class*="empty"], div[style*="text-align:center"][style*="padding:60px"] {
  animation:pl5FadeUp 0.5s cubic-bezier(0.16,1,0.3,1) both !important;
}

/* ═══ SCROLLBAR INSIDE TABLES ══════════════════════════ */
[style*="overflow-x:auto"]::-webkit-scrollbar { height:4px; }
[style*="overflow-x:auto"]::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:99px; }
[style*="overflow-x:auto"]::-webkit-scrollbar-thumb:hover { background:#C8102E; }

/* ═══ SEZIONE HERO FADEUP ═══════════════════════════════ */
[style*="animation: fadeSlideUp"], [style*="animation:fadeSlideUp"] {
  animation-name:pl5FadeUp !important;
}

/* ═══ STATUS BADGE ══════════════════════════════════════ */
span[style*="background:#ECFDF5"], span[style*="background: #ECFDF5"] {
  font-weight:800 !important;
  font-family:'Inter',sans-serif !important;
}
span[style*="background:#FEF2F2"], span[style*="background: #FEF2F2"] {
  font-weight:800 !important;
  font-family:'Inter',sans-serif !important;
}
span[style*="background:#FFF7ED"], span[style*="background: #FFF7ED"] {
  font-weight:800 !important;
  font-family:'Inter',sans-serif !important;
}

/* ═══ STAMPA FORMALE INVENTARIO A4 ══════════════════════ */
@media print {
  @page {
    size: A4 landscape;
    margin: 10mm 12mm 10mm 12mm;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt !important;
  }
  aside.sidebar, header.top-bar, .sidebar, .top-bar, .module-header-actions, .rep-nav-tab, button, #rep-search-input, .no-print,
  #dashboard-cinematic-card, .btn-lux, [onclick*="switchTab"], [onclick*="print"] {
    display: none !important;
  }
  main.main-content, .main-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
  }
  .rep-table-wrap {
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
  .rep-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 8.5pt !important;
  }
  .rep-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    padding: 6px 8px !important;
    font-size: 8pt !important;
  }
  .rep-table td {
    border: 1px solid #e2e8f0 !important;
    padding: 5px 8px !important;
    color: #1e293b !important;
  }
  .print-signatures {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
    page-break-inside: avoid;
  }
}

