/* ── Background grid + glow ── */
body {
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Glow sfumati */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(59,130,246,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 80% 70%, rgba(99,102,241,0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 60% 10%, rgba(139,92,246,0.05) 0%, transparent 70%);
  pointer-events: none;
}

/* Light mode: griglia più chiara */
body:not(.dark)::before {
  background-image:
    linear-gradient(rgba(37,99,235,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.1) 1px, transparent 1px);
  background-size: 40px 40px;
}

body:not(.dark)::after {
  background:
    radial-gradient(ellipse 60% 40% at 20% 20%, rgba(59,130,246,0.1) 0%, transparent 70%),
    radial-gradient(ellipse 50% 35% at 80% 70%, rgba(99,102,241,0.08) 0%, transparent 70%);
}

/* Assicura che tutto il contenuto sia sopra */
.pt-14 { position: relative; }

nav { position: fixed; z-index: 30; }


/* ── Utils ── */
[x-cloak] { display: none !important; }
.clamp2 { overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical; }
.clamp3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  max-height: calc(0.75rem * 1.625 * 3);
}

.text-sm { font-size: 0.8rem !important; }

/* ── Sidebar: flex + width animation (slide da sinistra) ── */

.sidebar-inner {
  width: 240px;
  padding-right: 1.25rem;
  overflow-y: auto;
  max-height: calc(100vh - 7rem);
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}
.sidebar-inner::-webkit-scrollbar { width: 3px; }
.sidebar-inner::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 9px; }
.dark .sidebar-inner::-webkit-scrollbar-thumb { background: #4b5563; }

/* ── Filter section search input ── */
.f-search {
  display: block;
  width: 100%;
  padding: .35rem .6rem;
  margin-bottom: .5rem;
  font-size: .8rem;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: .375rem;
  color: #111827;
  outline: none;
  transition: border-color .15s;
}
.f-search::placeholder { color: #9ca3af; }
.f-search:hover { border-color: #93c5fd; }
.f-search:focus { border-color: #3b82f6; box-shadow: 0 0 0 1px #3b82f6; }
.dark .f-search { background: transparent; border-color: #4b5563; color: #f9fafb; }
.dark .f-search::placeholder { color: #9ca3af; }
.dark .f-search:hover { border-color: #60a5fa; }

/* ── Bar button ── */
.bar-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .75rem;
  font-size: .8rem; font-weight: 500;
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: .375rem;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s;
  line-height: 1.25rem;
}
.bar-btn:hover { border-color: #93c5fd; background: transparent; }
.bar-btn:focus { outline: none; border-color: #3b82f6; }
.bar-btn.active { border-color: #2563eb !important; color: #2563eb !important; background: transparent !important; }

.dark .bar-btn { color: #d1d5db; border-color: #4b5563; }
.dark .bar-btn:hover { border-color: #60a5fa; background: transparent; }
.dark .bar-btn.active { border-color: #3b82f6 !important; color: #93c5fd !important; background: transparent !important; }

/* ── Dropdown panel ── */
.dd-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  width: 264px;
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: .625rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  padding: .625rem;
}
.dark .dd-panel { background: #1f2937; border-color: #374151; box-shadow: 0 4px 24px rgba(0,0,0,.4); }

/* ── Skeleton ── */
@keyframes sk { 0%,100%{opacity:1} 50%{opacity:.4} }
.sk { animation: sk 1.4s ease-in-out infinite; }

/* ── Neon Oneskill ── */
.neon { color: #00D4FF; text-shadow: 0 0 8px rgba(0,212,255,.45); }

/* ── Modal prose ── */
.prose-md p { margin-bottom: .4rem; }

/* ── Hover uniforme su input/select ── */
input[type="search"]:hover,
input[type="number"]:hover,
select:hover {
  border-color: #93c5fd !important;
}
.dark input[type="search"]:hover,
.dark input[type="number"]:hover,
.dark select:hover {
  border-color: #60a5fa !important;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

/* LAYOUT PRINCIPALE — !important per evitare override Tailwind/Flowbite */
.layout-row {
  display: flex;
  align-items: flex-start;
  width: 100%;
  gap: 0;
}
.layout-side   { overflow: hidden; flex-shrink: 0; width: 0; transition: width 0.3s ease; }
.layout-side.is-open {
  width: 260px;
  min-width: 260px;
}
.layout-cards {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}


/* Scrollbar globale sottile */
* {
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}
*::-webkit-scrollbar { width: 3px; height: 3px; }
*::-webkit-scrollbar-track { background: transparent; border-radius: 9px; }
*::-webkit-scrollbar-thumb { 
  background: #d1d5db; 
  border-radius: 9px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

.dark * { scrollbar-color: #4b5563 transparent; }
.dark *::-webkit-scrollbar-thumb { 
  background: #4b5563;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.dark *::-webkit-scrollbar-thumb:hover { background: #6b7280; }

input[type="checkbox"]:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
input[type="checkbox"]:focus-within {
  outline: none !important;
  box-shadow: none !important;
}

input[type="checkbox"]:hover {
  border-color: #93c5fd !important;
}
.dark input[type="checkbox"]:hover {
  border-color: #60a5fa !important;
}

/* Light: blu scuro */
.logo-img {
  filter: brightness(0) saturate(100%) invert(22%) sepia(89%) saturate(1500%) hue-rotate(213deg) brightness(95%) contrast(98%);
}
/* Dark: blu chiaro */
.dark .logo-img { filter: none; }

input[type="search"]::-webkit-search-cancel-button {
  filter: brightness(0);
}
.dark input[type="search"]::-webkit-search-cancel-button {
  filter: brightness(0) invert(1);
}

input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

@media (max-width: 767px) {
  .hero-headline-wrap {
    min-height: 6rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
  }
}

body.modal-open {
  overflow: hidden;
}