/* generic_table.css - estratto da generic_table.php */
html,
body {
  /*background-color: #f7f9fa;
  background: transparent !important;
  background-color: transparent !important;*/
  font-family: "Inter", "Segoe UI", sans-serif;
  color: #333;
}
body {
  background: linear-gradient(
    135deg,
    var(--jre-light-3) 0%,
    var(--jre-light-2) 45%,
    #ffffff 100%
  );
  background-attachment: fixed;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--jre-dark-2);
}

.container1 {
  /*width: 98%;*/
  margin: 0 auto;
  padding: 30px 0px 0 55px;
}

.page_container {
  margin-top: 55px;
  max-width: 1600px;
}

h2 {
  font-weight: 600;
  color: #222;
  letter-spacing: -0.3px;
}

.table {
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  overflow: hidden;
}

.table thead th {
  background: linear-gradient(to bottom, #f8fafc, #eef2f7) !important;
  font-size: 0.9rem;
  border-bottom: 1px solid #d6dbe1 !important;
  color: #3a3f45;
}

.table tbody tr {
  transition: background 0.12s ease, transform 0.1s ease;
}

.table tbody tr:hover {
  background-color: #f4f7fb !important;
  transform: translateX(2px);
}
/* --- Modern Table Style (override leggero, non distruttivo) --- */


/* Celle */
.table td {
  border-color: #e5e7eb !important;
  padding: 3px 5px !important;
}

/* --- Azioni modern style --- */

.action-edit:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

.actions {
  align-items: center;
  gap: 10px;
  width: 1%;
  white-space: nowrap;
}

td.text-center {
  white-space: nowrap;
}

/* ------------------------------------------------------ */
/* 🔵 BOTTONI MODERNI — FLAT, SENZA BORDI ARROTONDATI, NO 3D */
/* ------------------------------------------------------ */

.btn,
.btn-sm,
.btn-edit,
.btn-delete,
.btn-primary {
  border-radius: 0 !important;         /* nessun arrotondamento */
  box-shadow: none !important;         /* rimuove effetto 3D */
  transform: none !important;          /* rimuove animazione 3D */
  border: 1px solid transparent;       /* stile più moderno */
  border-radius: 2px !important;
  padding: 6px 12px !important;
  font-size: 0.80rem !important;
  font-weight: 600;
}

.btn-primary {
  background: #3b82f6 !important;
  color: #fff !important;
}

.btn-primary:hover {
  background: #2563eb !important;
}

.btn-edit {
  background: #3b82f6 !important;
  color: #fff !important;
}

.btn-edit:hover {
  background: #1e61c9 !important;
}

.btn-delete {
  background: #f95616 !important;
  color: #fff !important;
}

.btn-delete:hover {
  background: #ea580c !important;
}
.btn-icon {
    padding: 4px 6px;
    font-size: 16px;
    line-height: 1;
    border-radius: 6px;
}

.btn-icon i {
    pointer-events: none; /* evita click sulla sola icona */
}

.btn-icon:hover {
    background-color: #e6f0ff;
}
.btn-action {
    padding: 4px 6px;
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
    color: white !important;
    font-size: 15px;
    border: none;
}

.btn-edit {
    background-color: #0d6efd; /* blu */
}
.btn-edit:hover {
    background-color: #0b5ed7;
}

.btn-duplicate {
    background-color: #6c757d; /* grigio */
}
.btn-duplicate:hover {
    background-color: #5c636a;
}

.btn-move {
    background-color: #fd7e14; /* arancione */
}
.btn-move:hover {
    background-color: #e96c08;
}

.btn-delete {
    background-color: #dc3545; /* rosso */
}
.btn-delete:hover {
    background-color: #bb2d3b;
}

.btn-action i {
    pointer-events: none; /* Evita problemi sui click */
}

/* Mantieni l’effetto “press-down” coerente */
.btn:active {
  background-color: rgba(0,0,0,0.1) !important;
  box-shadow: none !important;
  transform: none !important;
}

@media (max-width: 420px) {
  .actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
  background-color: #e2e5ff;
  border-bottom: 1px solid #e5e7eb;
}

/* Modale CRUD più bassa e posizionata 50px sotto il top */
#editModal .modal-dialog, #inlineInsertModal .modal-dialog {
  margin-top: 80px !important;
  /* sposta verso il basso */
  max-height: calc(100vh - 100px);
  /* riduce altezza totale visibile */
  display: flex;
  align-items: center;
}

#editModal .modal-content, #inlineInsertModal .modal-content {
  max-height: calc(100vh - 120px);
  /* contenuto più basso */
  overflow-y: auto;
  /* abilita lo scroll interno se serve */
  border-radius: 12px;
}

.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 2000;
}

.toast {
  border-radius: 0.75rem;
  font-weight: 500;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 0.2em 0.8em;
  border-radius: 4px;
}

.dataTables_wrapper .dataTables_filter input {
  border-radius: 6px;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  padding: 8px 12px;
  font-weight: 500;
  font-size: 0.95rem;
  background: linear-gradient(to bottom, #fff, #f8f9fa);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08), 0 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.18s ease-in-out;
}

select.form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: linear-gradient(to bottom, #fff, #e6f0ff);
}

select.form-control option {
  font-weight: 400;
}

.select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.select-wrapper:has(select)::after {
  content: "\25BC";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #555;
  font-size: 0.8rem;
}


@media (max-width: 420px) {
  .select-wrapper {
    width: 100%;
  }
}

/* --- Pannello sinistro --- */
#leftPanelWrapper {
  position: fixed;
  top: 0;
  left: 0;
  /* 👈 cambia da right a left */
  width: 320px;
  height: 100vh;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
  /* 👈 cambia bordo */
  box-shadow: 3px 0 8px rgba(0, 0, 0, 0.08);
  /* 👈 cambia direzione ombra */
  transform: translateX(-100%);
  /* 👈 parte nascosto verso sinistra */
  transition: transform 0.3s ease-in-out;
  z-index: 1051;
  overflow-y: auto;
}

#leftPanelWrapper.active {
  transform: translateX(0);
}

/* --- Overlay --- */
#leftPanelOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  z-index: 1050;
}

#leftPanelOverlay.active {
  opacity: 1;
  visibility: visible;
}

/* --- Contenuto interno --- */
.left-panel-content {
  padding: 20px;
}

/* --- Pulsante toggle (in alto a sinistra) --- */
#toggleLeftPanel {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1100;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease;
}

#toggleLeftPanel:hover {
  background: #2563eb;
}

/* Celle editabili - sempre visivamente simili a input */
#inlineTable td.editable {
  background-color: #ffffff;        
  /*border: 1px solid #979797; */         /* grigio chiaro come bordo input */
  border-radius: 4px;
  padding: 4px 6px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  cursor: text;
  transition: all 0.2s ease;
  margin: 2px 2px;
}

/* Hover - evidenzia che è attivo */
#inlineTable td.editable:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

/* Focus - come un input attivo */
#inlineTable td.editable:focus {
  outline: none;
  border-color: #3b82f6;
  background-color: #f0f9ff;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

/* Celle non editabili (mantieni contrasto neutro) */
#inlineTable td:not(.editable):not(.custom) {
  background-color: #f8f9fa;
}


#inlineTable td.cell-saving {
  background-color: #fff3cd !important;
}

#inlineTable td.cell-saved {
  background-color: #d1fae5 !important;
}
#inlineTable td.custom select,
#inlineTable td.custom input {
  width: 100%;
  box-sizing: border-box;
}
/* Centra il contenuto della colonna Azioni */
#inlineTable td.actions-cell {
    text-align: center;
    vertical-align: middle;
}
/* ----------------------------- */
/* ⭐ FILTRO IMMAGINI VUOTE      */
/* ----------------------------- */

.filter-bar {
  align-items: center;
  background: #ffffff;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.filter-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: #374151;
  font-size: 0.95rem;
}

.filter-checkbox input {
  display: none;
}

.filter-checkbox .checkmark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  margin-right: 10px;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
  position: relative;
}

/* Hover */
.filter-checkbox:hover .checkmark {
  border-color: #60a5fa;
  background-color: #f1f5f9;
}

/* Se flaggato */
.filter-checkbox input:checked + .checkmark {
  background: linear-gradient(to bottom, #60a5fa, #3b82f6);
  border-color: #3b82f6;
  box-shadow: 0 2px 6px rgba(59,130,246,0.3);
}

/* Icona di check interna */
.filter-checkbox input:checked + .checkmark::after {
  content: "✔";
  font-size: 13px;
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -52%);
}

.filter-label {
  margin-left: 5px;
  color: #1f2937;
}
/* Spaziatura tra i bottoni del popup SweetAlert2 */
.swal2-actions .btn {
  margin: 0 8px; /* distanza orizzontale */
}
/* Select "Mostra X righe" di DataTables in stile custom */
.dataTables_wrapper .dataTables_length .form-select.form-select-sm {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  border-radius: 8px;
  border: 1px solid #dee2e6;
  padding: 4px 32px 4px 10px; /* più spazio a destra per freccia più grande */
  font-weight: 500;
  font-size: 0.85rem;

  background: linear-gradient(to bottom, #fff, #f8f9fa);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.08),
              0 2px 0 rgba(0,0,0,0.05);

  transition: all 0.18s ease-in-out;
  width: auto;
  display: inline-block;

  /* freccetta custom, più grande */
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23555' height='22' viewBox='0 0 24 24' width='22' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px; /* aumenta se la vuoi ancora più grande */
}
.dataTables_wrapper .dataTables_length .form-select.form-select-sm:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
  background: linear-gradient(to bottom, #fff, #e6f0ff);
}
/* Fix hover della paginazione DataTables */
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #e9ecef !important;    /* grigio chiaro bootstrap */
    color: #0d6efd !important;         /* blu bootstrap */
    border-color: #dee2e6 !important;
}

/* Fix hover dell’elemento corrente (attivo) */
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #0b5ed7 !important;    /* blu scuro hover */
    color: #fff !important;
    border-color: #0b5ed7 !important;
}
/* Font più piccolo nei dati della tabella */
.dataTables_wrapper table.dataTable tbody td {
  font-size: 0.85rem;   /* 85% del font base, modifica come vuoi */
  padding: 3px 5px;    /* facoltativo: un po’ meno padding */
}
.dataTables_wrapper table.dataTable thead th {
  font-size: 0.85rem;
}
/* Posizionamento fisso del box "Elaborazione..." in alto */
.dataTables_wrapper .dataTables_processing {
  position: absolute !important;
  top: 10px !important;          /* distanza dall’alto */
  left: 50% !important;          /* centrato */
  transform: translateX(-50%) !important;
  z-index: 10000 !important;     /* sopra tutto */
  margin: 0 !important;
  padding: 10px 20px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: #333 !important;
}

/* Evita che DataTables centri verticalmente */
.dataTables_wrapper .dataTables_processing::after {
  display: none !important;
}
/* Combo compact per filtri "Categoria", "Marca", ecc. */
#advancedFilter .form-select,
.filter-bar .form-select,
.select-wrapper select.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  font-size: 0.85rem;          /* font più piccolo */
  font-weight: 500;
  padding: 4px 32px 4px 10px;  /* combo più compatta */
  height: 34px;                /* altezza ridotta */
  border-radius: 8px;
  border: 1px solid #dee2e6;

  background: linear-gradient(to bottom, #fff, #f8f9fa);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05),
              0 1px 0 rgba(0,0,0,0.05);

  transition: all 0.18s ease-in-out;
}

/* Hover */
#advancedFilter .form-select:hover,
.filter-bar .form-select:hover,
.select-wrapper select.form-select:hover {
  background-color: #f1f5f9;
  border-color: #bfc7cf;
}

/* Focus */
#advancedFilter .form-select:focus,
.filter-bar .form-select:focus,
.select-wrapper select.form-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
  background: linear-gradient(to bottom, #fff, #e6f0ff);
}

/* Freccia custom grande (come nelle select DataTables) */
#advancedFilter .form-select,
.filter-bar .form-select,
.select-wrapper select.form-select {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23555' width='22' height='22' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
/* ====== LOGIN PAGE ====== */

.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
}

.login-card {
  width: 420px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 30px 30px 25px 30px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  text-align: center;
}

.login-logo img {
  max-width: 180px;
  margin-bottom: 10px;
}

.login-logo h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: #eea303;
  margin-bottom: 20px;
}

.login-field {
  text-align: left;
  margin-bottom: 18px;
}

.login-input {
  width: 100% !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  border: 1px solid #d1d5db !important;
  background: #fff !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.login-input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.2) !important;
}

.login-actions {
  margin-top: 10px;
}

.login-error {
  margin-top: 15px;
  color: #dc2626;
  font-weight: 600;
}

.login-forgot a {
  color: #3b82f6;
  text-decoration: none;
  font-size: 0.9rem;
}

.login-forgot a:hover {
  text-decoration: underline;
}

/* Footer */
.login-footer {
  margin-top: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #374151;
  font-size: 0.9rem;
}

.login-footer a {
  color: #2563eb;
  font-weight: 700;
}

.login-footer img {
  height: 26px;
}

/* Responsive */
@media (max-width: 480px) {
  .login-card {
    width: 90%;
    padding: 25px;
  }
}
/* Stile messaggi */
.login-success {
  margin-top: 15px;
  color: #16a34a;
  font-weight: 600;
}

.login-error {
  margin-top: 15px;
  color: #dc2626;
  font-weight: 600;
}

/* Due bottoni affiancati */
.dual-buttons {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.dual-buttons .btn {
  flex: 1;
}
.login-logo h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: #eea303;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 0.95rem;
  color: #4b5563;
  margin-bottom: 18px;
}
/* ===== AUTH WRAPPER ===== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

/* ===== CARD ===== */
.auth-card {
  width: 420px;
  background: #ffffff;
  padding: 40px 38px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 22px rgba(0,0,0,0.06);
}

/* ===== HEADER ===== */
.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo {
  width: 150px;
  margin-bottom: 12px;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: #4b5563;
  margin-top: 0;
}

/* ===== INPUTS ===== */
.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  display: block;
}

.auth-input {
  width: 100% !important;
  padding: 10px 12px !important;
  /*border-radius: 8px !important;*/
}

/* ===== BUTTONS ===== */
.auth-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.auth-btn {
  flex: 1;
  text-align: center;
  padding: 10px 14px;
  border-radius: 2px;
  font-weight: 600;
  display: inline-block;
  cursor: pointer;
  text-decoration: none;
}

/* primary */
.auth-btn-primary {
  background: linear-gradient(to bottom, #60a5fa, #3b82f6);
  color: #fff;
}

/* secondary */
.auth-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

/* messages */
.auth-message {
  text-align: center;
  margin-bottom: 20px;
  font-weight: 600;
}

.auth-message.error { color: #dc2626; }
.auth-message.success { color: #16a34a; }

/* ===== FOOTER ===== */
.auth-footer {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4b5563;
}

.auth-footer img {
  height: 26px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .auth-card {
    width: 90%;
    padding: 30px 24px;
  }

  .auth-buttons {
    flex-direction: column;
  }
}
.clean-footer {
  margin-top: 25px;
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
}
/* =========================================
   CATEGORIE: SIDEBAR FISSO A SINISTRA
========================================= */

#catPanel {
    position: fixed;
    top: 100px;                      /* distanza dal logo/menu */
    left: 60px;                     /* distacco lato sinistro */
    width: 300px;
    height: auto;                   /* niente auto-fill verticale */
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;            /* ARROTONDATO come card */
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    padding: 18px 15px;
    z-index: 30;
    max-height: calc(100vh - 110px);
}

#categoryTreeContainer {
    max-height: calc(100vh);
    overflow-y: auto;
}
/* Spazio tra sidebar e contenuto principale */
.page_container {
    margin-left: 310px !important;
}

.cat-panel-content {
    padding-bottom: 10px;
}

/* Modale CRUD più bassa e posizionata 50px sotto il top */
#categoryModal .modal-dialog, #inlineInsertModal .modal-dialog {
  margin-top: 80px !important;
  /* sposta verso il basso */
  max-height: calc(100vh - 100px);
  /* riduce altezza totale visibile */
  display: flex;
  align-items: center;
}

#categoryModal .modal-content, #inlineInsertModal .modal-content {
  max-height: calc(100vh - 120px);
  /* contenuto più basso */
  overflow-y: auto;
  /* abilita lo scroll interno se serve */
  border-radius: 12px;
}
/* Modale CRUD più bassa e posizionata 50px sotto il top */
#productModal .modal-dialog, #inlineInsertModal .modal-dialog {
  margin-top: 80px !important;
  /* sposta verso il basso */
  max-height: calc(100vh - 100px);
  /* riduce altezza totale visibile */
  display: flex;
  align-items: center;
}

#productModal .modal-content, #inlineInsertModal .modal-content {
  max-height: calc(100vh - 120px);
  /* contenuto più basso */
  overflow-y: auto;
  /* abilita lo scroll interno se serve */
  border-radius: 12px;
}
/* ============================================
   STILE LISTA CATEGORIE (moderno & elegante)
   ============================================ */

/* ============================================================
   CATEGORIE – TEMA MINIMAL GRIGIO CHIARO
   ============================================================ */

/* Contenitore con leggero bordo a destra */
#categoryTreeContainer {
    padding: 6px 10px;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    border-right: 1px solid #e5e7eb; /* grigio chiarissimo */
}

/* Reset liste */
#categoryTreeContainer ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

/* RIGA CATEGORIA (padre, figlio, nipote) */
#categoryTreeContainer .category-item {
    display: block;
    padding: 6px 10px;
    font-size: 14px;
    color: #444;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

/* Hover minimal */
#categoryTreeContainer .category-item:hover {
    background: #f3f4f6;     /* light gray ultra soft */
    color: #111;             /* testo leggermente più dark */
}

/* Categoria selezionata */
#categoryTreeContainer .category-item.fw-bold.text-primary {
    background: #e5e7eb;     /* grigio molto chiaro */
    color: #000 !important;  /* testo nero */
    font-weight: 600 !important;
    border-left: 3px solid #9ca3af;  /* grigio medio */
    padding-left: 7px;       /* compensazione bordo */
}

/* ============================================================
   DISTINZIONE VISIVA PADRE → FIGLI → NIPOTI
   ============================================================ */

/* Categoria PADRE (livello 0) */
#categoryTreeContainer > ul > li > .category-item {
    font-size: 15px;
    font-weight: 600;
    padding-top: 8px;
    padding-bottom: 8px;
    color: #222;
    margin-top: 2px;
    border-bottom: 1px solid #f0f0f0; /* separatore leggero */
}

/* Categoria FIGLIO (livello 1) */
#categoryTreeContainer ul ul > li > .category-item {
    font-size: 14px;
    padding-left: 20px;
    color: #555;
}

/* Categoria NIPOTE (livello 2) */
#categoryTreeContainer ul ul ul > li > .category-item {
    font-size: 13px;
    padding-left: 32px;
    color: #666;
    opacity: 0.9;
}

/* Categoria pronipote (livello 3+) */
#categoryTreeContainer ul ul ul ul > li > .category-item {
    font-size: 13px;
    padding-left: 44px;
    color: #777;
    opacity: 0.8;
}
/* Freccia per nodi con figli */
.category-has-children {
    position: relative;
    cursor: pointer;
}

/* Icona freccia */
.category-has-children::before {
    content: "▶";   /* freccia destra */
    position: absolute;
    left: -12px;
    top: 8px;
    font-size: 10px;
    color: #6b7280;  /* grigio */
    transition: transform .2s ease;
}

/* Freccia aperta */
.category-open::before {
    transform: rotate(90deg);
}

/* Contenitore figli collassabile */
.category-children {
    display: none;
}

/* Quando aperto */
.category-open + ul.category-children {
    display: block !important;
}
/* Evidenzia la riga cliccata */
#productsTable tbody tr.row-selected > * {
    background-color: #cde4ff !important;
}
/* Mostra il puntatore come cliccabile */
#productsTable tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
}
#productsTable tbody tr:hover > td {
    background-color: #cde4ff !important;
}
/* Mini tree inside modal */
.move-tree ul {
    list-style: none;
    padding-left: 14px;
}

.move-tree li {
    margin: 2px 0;
}

.move-tree a {
    display: block;
    padding: 4px 6px;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.move-tree a:hover {
    background: #eaf3ff;
    cursor: pointer;
}

.move-tree a.move-selected {
    background: #bcdcff !important;
    font-weight: bold;
}
/* ============================================
   TABS MODERNI + ICONE (FLAT STYLE)
============================================ */

.modal .nav-tabs {
    border-bottom: none !important;
    gap: 4px;
    padding-bottom: 6px;
}

.modal .nav-tabs .nav-link {
    background: #f3f4f6;
    color: #374151;
    border: none !important;
    border-radius: 4px;
    padding: 8px 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.18s ease, color 0.18s ease;
}

/* Hover */
.modal .nav-tabs .nav-link:hover {
    background: #e5e7eb;
    color: #111;
}

/* Attivo */
.modal .nav-tabs .nav-link.active {
    background: #3b82f6;
    color: #ffffff !important;
}

/* Icone */
.modal .nav-tabs .nav-link .tab-icon {
    font-size: 1rem;
    opacity: 0.8;
}

.modal .nav-tabs .nav-link.active .tab-icon {
    opacity: 1;
}

/* Tabs lingue */
#prodLangTabs .nav-link,
#catLangTabs .nav-link {
    padding: 6px 12px;
    border-radius: 4px;
}

#prodLangTabs .nav-link.active,
#catLangTabs .nav-link.active {
    background: #3b82f6 !important;
    color: #fff !important;
}
.status-switch {
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    transition: 0.2s;
}

.status-switch:hover {
    opacity: 0.85;
    transform: scale(1.05);
}
/* ============================
   SWITCH iOS per prodotti
============================ */

.switch-ios {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  cursor: pointer;
}

.switch-ios input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-ios .slider {
  position: absolute;
  inset: 0;
  background-color: #dc3545; /* rosso OFF */
  border-radius: 24px;
  transition: .3s;
}

.switch-ios .slider:before {
  position: absolute;
  content: "";
  height: 15px;
  width: 15px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: .3s;
}

/* Stato ON */
.switch-ios input:checked + .slider {
  background-color: #28a745; /* verde ON */
}

.switch-ios input:checked + .slider:before {
  transform: translateX(18px);
}

/* Effetto pressione */
.switch-ios .slider:active:before {
  width: 15px;
}
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #044002;
  color: #109e1a;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
}

.help-icon:hover {
  background-color: #f1f3f5;
  color: #212529;
  border-color: #868e96;
}
/* Popover più visibile ma elegante */
.popover {
  max-width: 320px;
  background-color: #ffffff;
  border: 1px solid #d0d7de;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 14px;
  line-height: 1.45;
  z-index: 2000000000 !important;
}

/* Header popover */
.popover-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #d0d7de;
  font-weight: 600;
  font-size: 14px;
}

/* Corpo popover */
.popover-body {
  color: #212529;
  padding: 12px 14px;
}

/* Liste più compatte */
.popover-body ul {
  padding-left: 18px;
  margin-bottom: 6px;
}

/* Arrow più contrastata */
.popover .popover-arrow::before,
.popover .popover-arrow::after {
  border-right-color: #d0d7de;
}
/* =========================================
   JRE THEME OVERRIDES
========================================= */

:root {
  --jre-gold: #C3A561;
  --jre-gold-dark: #b39450;

  --jre-dark-1: #241A05;
  --jre-dark-2: #49443A;
  --jre-dark-3: #898781;

  --jre-light-1: #D0CEC8;
  --jre-light-2: #EDEBE7;
  --jre-light-3: #F5F4EF;
}

/* ===============================
   TITOLI
================================ */

h1, h2, h3, .page-title {
  font-family: "Georgia", "Times New Roman", serif;
  color: var(--jre-dark-1);
}

/* ===============================
   BOTTONI PRIMARI (ORO)
================================ */

.btn-primary,
.btn-edit {
  background: var(--jre-gold) !important;
  border-color: var(--jre-gold) !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-edit:hover {
  background: var(--jre-gold-dark) !important;
  border-color: var(--jre-gold-dark) !important;
}

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

.btn-secondary {
  background: var(--jre-dark-3) !important;
  border-color: var(--jre-dark-3) !important;
  color: #fff !important;
}

/* ===============================
   DELETE (resta pericoloso)
================================ */

.btn-delete {
  background: #dc3545 !important;
  border-color: #dc3545 !important;
}

/* ===============================
   HEADER (se presente)
================================ */

header {
  background: var(--jre-light-3);
  border-bottom: 1px solid var(--jre-light-1);
}

/* ===============================
   TABELLE
================================ */

.table thead th {
  background: var(--jre-light-2) !important;
  color: var(--jre-dark-2);
}

.table tbody tr:hover {
  background-color: var(--jre-light-3) !important;
}

/* ===============================
   MODALE
================================ */

.modal-header {
  background-color: var(--jre-light-2) !important;
  color: var(--jre-dark-1);
}

/* ===============================
   LINK
================================ */

a {
  color: var(--jre-gold);
}

a:hover {
  color: var(--jre-gold-dark);
}
/* =========================================
   JRE HEADER / MENU
========================================= */

.jre-header {
  background: var(--jre-light-3);
  border-bottom: 1px solid var(--jre-light-1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.jre-header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 14px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

/* LOGO */
.jre-logo a {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--jre-dark-1);
  text-decoration: none;
}

/* MENU */
.jre-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.jre-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--jre-dark-2);
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.jre-nav a:hover {
  color: var(--jre-gold);
}

.jre-nav a.active {
  color: var(--jre-gold);
  border-bottom-color: var(--jre-gold);
}

/* USER / LOGOUT */
.jre-user {
  display: flex;
  align-items: center;
}

.jre-logout {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--jre-dark-3);
  text-decoration: none;
}

.jre-logout:hover {
  color: var(--jre-dark-1);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .jre-header-inner {
    grid-template-columns: auto auto;
    row-gap: 10px;
  }

  .jre-nav {
    grid-column: 1 / -1;
    justify-content: center;
    gap: 16px;
  }
}
/* =========================================
   JRE PAGINATION – ACTIVE PAGE
========================================= */

.active > .page-link,
.page-link.active {
  z-index: 3;
  color: #ffffff !important;
  background-color: var(--jre-gold) !important;
  border-color: var(--jre-gold) !important;
}
.active > .page-link:hover,
.page-link.active:hover {
  background-color: var(--jre-gold-dark) !important;
  border-color: var(--jre-gold-dark) !important;
}
/* =========================================
   LAYOUT CON FOOTER A ALTEZZA FISSA
========================================= */

html, body {
  height: 100%;
}

.app-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* contenuto flessibile */
.app-content {
  flex: 1 0 auto;
  padding-bottom: 20px; /* aria sopra il footer */
}

/* footer */
footer {
  height: 64px;                 /* 👈 ALTEZZA FISSA */
  flex-shrink: 0;
  background: var(--jre-light-3);
  border-top: 1px solid var(--jre-light-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--jre-dark-3);
}
html, body {
  height: 100%;
  margin: 0;
}

.app-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1;
}
.img-preview{
  width:54px;
  height:54px;
  object-fit:cover;
  border-radius:6px;
  border:1px solid #e5e7eb;
  background:#fff;
  display:none; /* appare solo se c’è src */
}
.table-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  display: block;
}

.table-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  color: #9ca3af;
  font-size: 18px;
  border: 1px dashed #d1d5db;
}
/* Altezza maggiore per CKEditor */
.ck-editor__editable {
  min-height: 200px;   /* cambia a piacere: 300, 350, ecc. */
}
.img-field{
  display:flex;
  align-items:center;
  gap:8px;
}

.img-field .form-control{
  flex: 1 1 auto;
  min-width: 0;     /* IMPORTANTISSIMO per evitare wrap */
  width: auto;      /* annulla width:100% */
  margin-bottom: 0 !important; /* se hai mb-2 sull’input */
}

.btn-clear-image {
  width: 34px;
  height: 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: #fd7e14;          /* stesso arancio btn-move */
  color: #ffffff;

  border: none;
  border-radius: 6px;

  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}

.btn-clear-image:hover {
  background: #e96c08;          /* hover coerente */
}

.btn-clear-image:active {
  transform: scale(0.94);
}

.img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.img-lightbox img {
  max-width: 80vw;
  max-height: 80vh;
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.img-lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 30px;
  color: #fff;
  cursor: pointer;
}
.img-lightbox img {
  animation: zoomIn .15s ease-out;
}

@keyframes zoomIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
