@import url("inter.css");

body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Inter", sans-serif;
  margin: 0;
  height: 100vh;
  overflow: hidden;
}

/* Overlay nero semi-trasparente */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none; /* nascosto di default */
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Rotella */
.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #ccc;
  border-top: 6px solid #f96d00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.select-company {
  position: absolute;
  top: 10px;
  left: 10px;
  border-radius: 5px;
  border: none;
  background-color: #007bff;
  padding: 3px;
  z-index: 99999;
}

.botton-container-cornered {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: right;
  justify-content: right;
}

.botton-container-cornered button {
  margin: 5px;

  font-size: 16px;
  font-weight: bold;
  border-radius: 5px;
  border: none;
  background-color: #f96d00;
  padding: 5px;
}

.add-button {
  position: fixed;
  top: 10px;
  right: 10px;
  border-radius: 5px;
  border: none;
  background-color: #f96d00;
  padding: 3px;
  z-index: 999;
}

.add-button-top-corner {
  position: relative;
  z-index: 9999;
  top: 8px;
  right: -0.5rem;
  border-radius: 5px;
  border: none;
  background-color: #f96d00;
  padding: 3px;
}

.add-button-lefttop {
  position: absolute;
  top: 0px;
  left: 20px;
  border-radius: 5px;
  border: none;
  background-color: #f96d00;
  padding: 3px;
  z-index: 999;
}

.add-button-leftdown {
  position: absolute;
  bottom: 10px;
  left: 10px;
  border-radius: 5px;
  border: none;
  background-color: #f96d00;
  padding: 3px;
  z-index: 999;
}
.add-button-rightdown {
  position: absolute;
  bottom: 10px;

  right: 10px;
  border-radius: 5px;
  border: none;
  background-color: #f96d00;
  padding: 3px;
  z-index: 999;
}

input,
select,
textarea {
  width: 80%;
  padding: 10px 14px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #f9f9f9;
  color: #333;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
  margin: auto;
  margin-bottom: 5px;
  margin-top: 5px;
}

.button-form {
  border-radius: 5px;
  border: none;
  background-color: #f96d00;
  padding: 10px;
  font-weight: 700;
  font-size: medium;
}

.grd-home {
  height: 98vh;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 8px;
  overflow: hidden;
}

/* sezio gestione della side bar per la navigazione -------------------------------------------------------- */

/* Sezioni principali visibili nella parte alta */
/* la barra occupa tutta la riga in basso e si centra: nella sola colonna centrale il menu delle aziende la tagliava */
.navbar {
  grid-column: 1 / -1;
  grid-row-start: 8;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin: 8px;
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* Sezione visibile */
.screen.active {
  display: flex;
}

/* Navbar inferiore stile mobile */
/* Barra in basso. I bottoni stanno dentro la barra con 6px di margine e angoli da 8px:
   cosi' l'arancio del bottone attivo segue gli angoli della barra (14px - 6px) */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 4px;
  width: 100%;
  background-color: #ffffff;
  border-radius: 14px;
  padding: 6px;
  box-sizing: border-box;
}

.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 64px;
  height: 54px;
  padding: 0 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: black;
  cursor: pointer;
  transition: background-color 0.2s;
}

.bottom-nav button:hover {
  background-color: #eeeeee;
}

.bottom-nav button.active {
  background-color: #f96d00;
}

.bottom-nav button:focus {
  outline: none;
}

.bottom-nav button:focus-visible {
  outline: 2px solid #242424;
  outline-offset: -2px;
}

/* l'a capo tra icona e nome non serve: il bottone e' gia' in colonna */
.bottom-nav button br {
  display: none;
}

.bottom-nav button img {
  width: 24px;
  height: 24px;
  margin: 0;
}

.bottom-nav button small {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* contenitore della pagina con tutti i dati e le sezoni--------------------------------------------------------------------------------------------------- */

.home-content {
  grid-column: span 3 / span 3;
  grid-row: span 7 / span 7;
  display: flex;
  align-items: center;
  justify-content: center;

  /* Scroll interno */
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  max-height: 100%;
  padding: 10px;
}

/* Responsività generale */
@media (max-width: 768px) {
  .grd-home {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr; /* Solo 1 riga, tutta occupata */
    position: relative; /* Necessario per il posizionamento assoluto interno */
    overflow-y: auto;
  }

  .home-content {
    grid-column: 1;
    grid-row: 1;

    max-height: 100%;
  }
  .navbar {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    margin: 0;
    z-index: 100;
  }

}

/* overlay ngeneralre -------------------------------------------------------------------------------------------------------------------------------------------------------- */

/* Overlay sfondo */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  display: none;
  opacity: 0;
}

.overlay-content {
  background: white;
  padding: 24px;
  border-radius: 16px;
  max-width: 90%;
  width: 400px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.3s ease;
}

.overlay-content h2 {
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.overlay-content p {
  font-size: 1rem;
  color: #333;
  margin-bottom: 20px;
}

.overlay-content a {
  color: #0077cc;
  text-decoration: underline;
}

.overlay-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.overlay-buttons button {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background-color: #f96d00;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.overlay-buttons button:hover {
  background-color: #f58d3d;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*pop un overlay*/
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* sfondo scuro */
  display: none; /* nascosto inizialmente */
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 12px;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

/* suggestion box indcator styl for evrione of tem ------------------------------------------------------------------------------------------- */

.suggestions-box {
  position: absolute;
  z-index: 1000;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  display: none;
  padding: 5px 0;
}

/* Ogni suggerimento */
.suggestions-box div {
  margin: 4px 8px;
  padding: 10px 15px;
  background-color: #f9f9f9;
  border-radius: 6px;
  font-family: "Segoe UI", sans-serif;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

/* Hover: effetto visivo netto */
.suggestions-box div:hover {
  background-color: #007bff;
  color: white;
}

.autocomplete-suggestion {
  padding: 8px 12px;
  cursor: pointer;
}

.autocomplete-suggestion:hover {
  background-color: #ddd;
}

/* form dedicato all inserimento di niove azienda all'intendo del nosto database ----------------------------------------------------------------------------------------------------  */

.AziendaGestor input {
  width: 80%;
  padding: 10px 14px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #f9f9f9;
  color: #333;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
  margin: auto;
  margin-bottom: 10px;
}

.AziendaGestor input:focus {
  border-color: #4a90e2;
  outline: none;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

#FilePreview img {
  max-width: 90%;
  max-height: 90%;
  object-fit: cover;
  border-radius: 4px;
}

/* 
Catalgo scale ispezionate e condizioni del prodotto ------------------------------------------------------------------------------------------------------------------------------------------ */

/* LAYOUT DESKTOP */
.Cat-Left {
  position: relative;
  border: 1px solid #767c85;
  background-color: #5a5f65;
  border-radius: 14px;
  grid-column: span 5 / span 5;
  grid-row: span 5 / span 5;
  overflow-y: auto;
}

.Cat-Right {
  grid-column: span 2 / span 2;
  grid-row: span 5 / span 5;
  grid-column-start: 6;
}

.Cat-Left2 {
  position: relative;
  border: 1px solid #767c85;
  background-color: #5a5f65;
  border-radius: 14px;
  grid-column: span 5 / span 5;
  grid-row: span 5 / span 5;
  overflow-y: auto;
}
.Cat-Right2 {
  grid-column: span 2 / span 2;
  grid-row: span 5 / span 5;
  grid-column-start: 6;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* hom del sito codice per la pagina di ingesso al sito--------------------------------------------------------------------------------------------------------------------- */

/* MEDIA QUERY: Tablet (max-width: 1024px) */

/* MEDIA QUERY: Mobile (max-width: 768px) */

/* LAYOUT MOBILE */
@media (max-width: 768px) {

  .Cat-Right {
    position: sticky;
    top: 0;

    z-index: 10;

    height: auto;
  }

  .Cat-Left {
    flex: 1;
    max-height: 50%;
  }
}

/* form inserimento nuove commesse nel database  */

.Date-cont {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(1, 1fr);
  gap: 8px;
  padding: 10px;
  border: solid #f96d00 2px;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* css relativo al elenco commesse  */

/* drop box areea -------------------------------------------------------------- */
.dropzone2 {
  border: 2px dashed #aaa;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  background-color: #f9f9f9;
  max-width: 200px;
  margin: 20px auto;
  position: relative;
}

.dropzone2-label {
  display: block;
  width: 100%;
  height: 100%;
}

#DropZoneText2 {
  font-size: 14px;
  color: #666;
}

.preview2 img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  margin-top: 10px;
  border-radius: 8px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

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

input:checked + .slider {
  background-color: #f96d00; /* Verde iOS */
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* gestione casella file immagini file caricament e file card.------------------------------------- */

.file-card {
  position: relative;
  width: 90%;
  background-color: #fff;
  border: none;
  border-bottom: 1px solid #e6e6e6;
  border-radius: 0;
  padding: 10px 12px;
  margin: 10px;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.15s ease;
  border-radius: 14px;
}

.file-card:hover {
  background-color: #f4f4f4;
  transform: none;
}

/* Icona come nelle notifiche */
.file-icon {
  width: 43px;
  height: 43px;
  flex-shrink: 0;
}

/* Testi più compatti */
.file-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #222;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
}

.file-date {
  font-size: 0.7rem;
  color: var(--testo-3);
  margin: 2px 0 0;
}

/* Messaggio vuoto più "sistema" */
.file-empty-msg {
  margin: 20px;
  font-size: 0.8rem;
  color: var(--testo-3);
  font-style: normal;
  text-align: center;
}

.modal-content-file {
  background-color: white;
  padding: 2rem;
  border-radius: 12px;
  max-width: 70vw;
  max-height: 70vh;
  width: auto;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  overflow: auto;
  color: black;
}
.Cat-Container {
  height: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 8px;
}

@media (max-width: 768px) {
  .Cat-Container {
    grid-template-columns: 1fr; /* Una sola colonna */
    grid-template-rows: auto; /* Altezza automatica */
  }

  .Cat-Left2 {
    position: relative;
    border: 1px solid #767c85;
    background-color: #5a5f65;
    border-radius: 14px;
    grid-column: 1 / -1; /* Occupano tutta la colonna */
    grid-row: auto;
    overflow-y: auto;
  }

  .Cat-Right2 {
    grid-column: 1 / -1; /* Anche lui tutta la colonna */
    grid-row: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
  }
}
/* 
gestione modulo aggiunta utente-------------------------------  */

.modType-cont {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 8px;
  padding: 10px;
  border: solid #fbd204 2px;
  border-radius: 8px;
}

/* ############################################## */
/* sezione caricamento dati utente con tabella apropiata */
/* ################################################## */

.List_overlay {
  width: 70vh;
  max-height: 60vh;
  overflow-y: scroll;
  scrollbar-width: none;
}

.Grid_List {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.Lister_Container {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #eaeaea);
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  width: 100%;
  max-height: 300px;
  min-height: 300px;
  overflow-y: auto;
  scrollbar-width: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-sizing: border-box;
}

.Lister_Container:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.Lister_Container span {
  padding: 6px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 6px;
  font-size: 14px;
  color: #000;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}

.Lister_Container span:hover {
  background: #f96d00;
  color: white;
  cursor: pointer;
}

.list-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}

@media (max-width: 768px) {

  .Grid_List {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
}

/* ################################### */
/* gestione dei form file clienti */

.fileclient-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(12, 1fr);
  gap: 8px;
  color: black;
}

/* Riga 1 */
.fc1 {
  grid-column: span 3;
}

.fc2 {
  grid-column: span 3;
}

/* Riga 2 */
.fc3 {
  grid-column: span 3;
  grid-row-start: 2;
}

.fc4 {
  grid-column: span 3;
  grid-row-start: 2;
}

/* Riga 3 */
.fc5 {
  grid-column: span 6;
  grid-row-start: 3;
  display: flex;
  flex-direction: column;
}

/* Riga 4 */
.fc6 {
  grid-column: span 3;
  grid-row-start: 4;
}

.fc7 {
  grid-column: span 3;

  grid-row-start: 4;
}

/* Riga 5 */
.fc8 {
  grid-column: span 3;
  grid-row-start: 5;
}

.fc9 {
  grid-column: span 3;

  grid-row-start: 5;
}

/* Riga 6 */
.fc10 {
  grid-column: span 6;
  grid-row-start: 6;
  display: flex;
  flex-direction: column;
}

/* Riga 7 */
.fc11 {
  grid-column: span 2;
  grid-row-start: 7;
}

.fc12 {
  grid-column: span 2;

  grid-row-start: 7;
}

.fc13 {
  grid-column: span 2;

  grid-row-start: 7;
}

/* Riga 8 */
/* Riga 9 */
.fc18 {
  grid-column: span 3;
  grid-row-start: 9;
}

.fc19 {
  grid-column: span 3;

  grid-row-start: 9;
}

/* Riga 9 */
/* Riga 11 */
.fc20 {
  grid-column: span 3;
  grid-row-start: 11;
}

/* Riga 13 */
.fc21 {
  grid-column: span 3;

  grid-row-start: 11;
}

/* Riga 10 */
.fc23 {
  grid-column: span 6;
  grid-row-start: 10;
}
/* Riga 12 */
.fc24 {
  grid-column: span 6;
  grid-row-start: 8;
  display: flex;
  flex-direction: column;
}

/* Riga 12 */
.fc25 {
  grid-column: span 6;
  grid-row-start: 12;
  display: flex;
  flex-direction: column;
}


.Divider {
  width: 100%;
  border: solid #f96d00 2px;
  border-radius: 2px;
  margin: 10px;
}
/* 
CAMPI PROCEDURALI------- */

.Procedural-filds {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 0.5fr;
  gap: 8px;
  justify-content: center;
  align-items: center;
  position: relative;
}
.Procedural-full {
  grid-column: span 3;
}
/* Wrapper dell’input per suggerimenti */
.input-wrapper {
  position: relative;
  width: 100%;
}

/* Lista dei suggerimenti */
.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 150px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  z-index: 100;
  display: none; /* viene mostrata quando ci sono suggerimenti */
  color: black;
}

.suggestions div {
  padding: 6px 10px;
  cursor: pointer;
}

.suggestions div:hover {
  background: #f0f0f0;
}

/* Bottone genera campi */
#addFieldBtn {
  background: rgb(21, 215, 21);
  color: var(--testo);
  font-weight: 600;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#addFieldBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Bottone rimuovi X */
.removeField {
  background: #e0e0e0;
  color: #333;
  font-weight: bold;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
  text-align: center;
  line-height: 28px;
  font-size: 16px;
  padding: 0;
}

.removeField:hover {
  background: #f44336;
  color: white;
  transform: scale(1.1);
}

/* tabella con i dati generali filecliente ------------------------------------ */

/* Barra filtri */

/* Wrapper con radius vero */

/* Tabella */

/* Header */

/* 🔥 Radius SOLO sugli angoli veri */

/* Celle */

/* Righe */

/* Input */

@media (max-width: 768px) {
  /* Nasconde header */
  

  /* Rimuove min width */
  

  /* Trasforma la tabella */
  

  /* Ogni riga diventa una card */
  

  /* Nasconde tutte le colonne tranne la prima */
  

  /* Rimuove hover zoom su mobile */
  

  /* Filtri in colonna */
  
}
/* =========================
   OVERLAY
========================= */
#fcPanelOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  z-index: 999;
}

#fcPanelOverlay.open {
  opacity: 1;
  visibility: visible;
}

/* =========================
   PANEL
========================= */
#fcPanel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 600px;
  max-width: 100%;
  background: var(--laterale);
  color: var(--testo);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.77, 0, 0.18, 1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  border-top-left-radius: 20px;
  border-bottom-left-radius: 20px;
}

#fcPanel.open {
  /* l'ombra solo da aperto: da chiuso il pannello e' fuori schermo ma l'ombra rientrava sul bordo destro */
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  transform: translateX(0);
}

/* =========================
   HEADER
========================= */
.fcPanel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px;
  background: var(--blocco);
  border-bottom: 1px solid var(--linea);
  border-top-left-radius: 20px;
}

.fcPanel-title h3 {
  margin: 0;
  font-weight: 600;
}

#fcPanelSubTitle {
  font-size: 13px;
  color: var(--arancio-testo);
}

#fcPanelClose {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--arancio-testo);
  cursor: pointer;
  transition: 0.3s;
}

#fcPanelClose:hover {
  transform: rotate(90deg);
}

/* =========================
   BODY
========================= */
.fcPanel-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
}

/* =========================
   GRID
========================= */
.fcPanel-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

.fcPanel-grid div {
  box-sizing: border-box;
}

/* Colonne */
.fc-full {
  grid-column: span 6;
}
.fc-half {
  grid-column: span 3;
}
.fc-third {
  grid-column: span 2;
}

/* =========================
   FIELD
========================= */
.fc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 5px;
  margin: 3px;
}

.fc-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--arancio-testo);
  letter-spacing: 0.5px;
}

.fc-field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--linea);
  background: var(--blocco);
  color: var(--testo);
  font-size: 14px;
}

.fc-field input:disabled {
  opacity: 0.85;
}

/* Divider */
.fc-divider {
  grid-column: span 6;
  height: 2px;
  background: #f96d00;
  border-radius: 2px;
  margin: 10px 0;
  opacity: 0.4;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {
  #fcPanel {
    width: 100%;
    border-radius: 0;
  }
}

/* =========================
   FILE DOWNLOAD SECTION
========================= */

.fc-files {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

/* Layout dinamico */
.fc-files.cols-1 {
  grid-template-columns: 1fr;
}
.fc-files.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.fc-files.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.fc-file-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--linea);
  background: var(--blocco);
  color: var(--testo);
  font-weight: 600;
  text-decoration: none;
  transition: 0.25s;
  cursor: pointer;
}

.fc-file-btn:hover {
  background: #f96d00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 109, 0, 0.4);
}

.fc-action-btn {
  background-color: #007bff; /* blu brillante */
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 10px;
  transition: background-color 0.2s;
}

.fc-action-btn:hover {
  background-color: #0056b3;
}

/* categoria della macchina nel pannello: suggerisce il modello del report */
.fc-categoria {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--testo-3);
}

.fc-categoria input {
  width: 220px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 5px;
  border: 1px solid var(--linea-forte);
  background: var(--blocco);
  color: var(--testo);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0;
  color-scheme: dark;
}

.fc-categoria input:focus {
  outline: none;
  border-color: #f96d00;
}


.autocomplete-list {
  border: 1px solid #ccc;
  max-height: 150px;
  overflow-y: auto;
  position: absolute;
  background: #fff;
  z-index: 1000;
  width: 200px; /* uguale all'input */
  color: black;
}

.autocomplete-list div {
  padding: 5px;
  cursor: pointer;
}

.autocomplete-list div:hover {
  background-color: #f0f0f0;
}

/* ############################################ */
/* Tooltip generico */

/* il contenitore tooltip creato dinamicamente */
.custom-tooltip {
  position: fixed; /* fixed evita che si sposti con container absolute */
  background: rgba(0, 0, 0, 0.85);
  color: var(--testo);
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.05s ease-in-out; /* comparsa rapidissima */
  z-index: 9999;
}

.custom-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
}

/* su computer la barra e' larga quanto il suo contenuto e i bottoni non si stringono sotto il loro nome */
.navbar .bottom-nav {
  width: auto;
  max-width: 100%;
}

.bottom-nav button {
  flex-shrink: 0;
}

/* menu unico delle aziende nella barra in basso: vale per tutte le sezioni (Home e Scadenziario).
   Alto quanto i bottoni, grigio chiaro come il loro passaggio del mouse; un nome lungo si taglia */
.bottom-nav #selectAzienda {
  flex: 0 1 220px;
  min-width: 0;
  height: 40px;
  margin: 0 6px 0 0;
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: black;
  background-color: #eeeeee;
  border: none;
  border-radius: 8px;
  text-overflow: ellipsis;
  cursor: pointer;
}

/* sul telefono solo le icone: il menu prende lo spazio che resta */
@media (max-width: 768px) {
  .bottom-nav button small {
    display: none;
  }

  .bottom-nav button {
    flex: 0 0 44px;
    min-width: 0;
    height: 44px;
    padding: 0;
  }

  .bottom-nav #selectAzienda {
    flex: 1 1 auto;
    height: 44px;
    font-size: 13px;
  }

  .navbar .bottom-nav {
    width: 100%;
  }
}

/* tecnici manutentori: la riga si clicca per cambiare password o eliminare */
.tec-blocco {
  cursor: pointer;
}

/* la matita sta nell'angolo, come le icone sugli utenti del back office: la colonna e' stretta */

.tec-modal {
  color: black;
}

/* tecnico non ancora confermato dall'amministratore */
.tec-attesa {
  display: block;
  font-size: 12px;
  color: var(--arancio-testo);
}

.tec-elimina {
  background-color: red;
  color: var(--testo);
  margin-top: 10px;
}

/* HOME DEL FORNITORE: i componenti sono in styleHM.css, qui solo la disposizione.
   La tabella delle utenze occupa due colonne; sotto i 1100px tutto in una colonna */
.fr-grid .gu-card {
  grid-column: span 2;
}

/* AZIENDE DELLA DITTA (screen4): l'elenco in due colonne, richieste e spiegazione nella terza */
.fa-grid .fa-aziende {
  grid-column: span 2;
}

.fa-azioni {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.fa-testo {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--testo-2);
}

.fa-stato {
  font-weight: 700;
}

.fa-attesa {
  color: var(--arancio-testo);
}

.fa-accettata {
  color: #4caf50;
}

.fa-rifiutata {
  color: var(--rosso-testo);
}

/* finestra NUOVA AZIENDA: suggerimenti sotto il nome (stile della lista in styleHM.css) e riga della scelta */
.fa-cerca {
  position: relative;
}

.fa-cerca .suggestions-box {
  top: 44px;
  max-height: 240px;
}

.fa-cerca .suggestions-box div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}

/* selettore piu' lungo: styleHM.css colora d'arancio i <b> delle finestre */
.fa-cerca .suggestions-box div b {
  color: var(--testo);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.fa-cerca .suggestions-box small {
  color: var(--testo-3);
  font-size: 12px;
}

.modal-overlay .fa-scelta {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #f96d00;
  border-radius: 8px;
  color: var(--testo);
}

.modal-overlay .button-form:disabled {
  opacity: 0.5;
  cursor: default;
}

/* selettore doppio: styleHM.css si carica dopo questo foglio */
@media (max-width: 1100px) {
  .hm-grid.fr-grid,
  .hm-grid.fa-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .fr-grid .gu-card,
  .fa-grid .fa-aziende {
    grid-column: auto;
  }
}

/* campi data e ora: Chrome e Safari su iPhone danno loro una larghezza minima propria (il selettore) che allarga
   la colonna, e su iPhone un'altezza diversa. Cosi' restano larghi e alti come i campi di testo */
input[type="date"],
input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  min-height: 20px;
}

input::-webkit-date-and-time-value {
  text-align: left;
}
