/* AI Act Compliance Manager - stili custom (CSS puro, no @apply) */

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

*:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }

/* Select nativo */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7' /%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25em 1.25em;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.5rem;
}

/* ================================================================
   INPUT BASE - applicato a .input-base ma anche come fallback
   a tutti gli input/select/textarea nelle form della pagina
   ================================================================ */

.input-base,
input[type="text"].input-base,
input[type="email"].input-base,
input[type="password"].input-base,
input[type="tel"].input-base,
input[type="url"].input-base,
input[type="number"].input-base,
input[type="date"].input-base,
input[type="search"].input-base,
select.input-base,
textarea.input-base {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #0f172a;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.input-base:hover { border-color: #94a3b8; }

.input-base:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-base:disabled,
.input-base[readonly] {
  background-color: #f8fafc;
  color: #64748b;
  cursor: not-allowed;
}

.input-base::placeholder { color: #94a3b8; }

select.input-base { padding-right: 2.5rem; }

textarea.input-base { min-height: 80px; resize: vertical; }

/* Uppercase handler */
.input-base.uppercase { text-transform: uppercase; }
.input-base.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ================================================================
   BOTTONI
   ================================================================ */

.btn-primary, .btn-secondary, .btn-danger, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  min-height: 44px;
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.btn-primary:hover { background-color: #1d4ed8; border-color: #1d4ed8; }
.btn-primary:active { background-color: #1e40af; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background-color: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}
.btn-secondary:hover { background-color: #f8fafc; }
.btn-secondary:active { background-color: #f1f5f9; }

.btn-danger {
  background-color: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}
.btn-danger:hover { background-color: #b91c1c; border-color: #b91c1c; }

.btn-ghost {
  background-color: transparent;
  color: #475569;
  border-color: transparent;
  padding: 0.5rem 0.75rem;
  min-height: 0;
}
.btn-ghost:hover { background-color: #f1f5f9; }

/* ================================================================
   CARD
   ================================================================ */

.card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-body { padding: 1.25rem; }

/* ================================================================
   TABELLA RESPONSIVE -> CARD SU MOBILE
   ================================================================ */

@media (max-width: 767px) {
  .table-responsive tbody tr {
    display: block;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: white;
  }
  .table-responsive tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    border: none !important;
    text-align: right;
  }
  .table-responsive tbody td::before {
    content: attr(data-label);
    font-weight: 500;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    text-align: left;
    margin-right: 0.75rem;
  }
  .table-responsive thead { display: none; }
}

/* ================================================================
   EMPTY STATE
   ================================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.empty-state-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  background-color: #f1f5f9;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

/* ================================================================
   LOADING SKELETON
   ================================================================ */

.skeleton {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  background-color: #e2e8f0;
  border-radius: 0.25rem;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ================================================================
   CHECKBOX / RADIO - un minimo di coerenza
   ================================================================ */

input[type="checkbox"], input[type="radio"] {
  width: 1rem;
  height: 1rem;
  accent-color: #2563eb;
  cursor: pointer;
}

/* ================================================================
   STAMPA
   ================================================================ */

@media print {
  aside, header, footer, .no-print { display: none !important; }
  main { padding: 0 !important; }
}

/* ================================================================
   X-CLOAK per Alpine.js (nasconde elementi con x-cloak finche Alpine non carica)
   ================================================================ */

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