/* Gestionale Immobiliari - foglio di stile unico
   compatibile con Google Chrome e Microsoft Edge */

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 0 40px 0;
  background: #eef2f7;
  color: #1c2330;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- barra in alto ---------- */
.testata {
  background: #2f6fd0;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}
.testata a { color: #fff; text-decoration: underline; margin-left: auto; }
.testata a + a { margin-left: 14px; }

/* ---------- contenitore ---------- */
.box {
  background: #fff;
  max-width: 900px;
  margin: 24px auto;
  padding: 26px 30px;
  border: 1px solid #d3dceb;
  border-radius: 6px;
}
.box.stretto  { max-width: 460px; }
.box.centrato { text-align: center; }

h1 { font-size: 22px; margin: 0 0 6px 0; }
h2 { font-size: 17px; margin: 26px 0 10px 0; padding-bottom: 5px;
     border-bottom: 1px solid #e2e8f2; }
.sotto { color: #5c6a80; margin-top: 0; }
.nota  { color: #5c6a80; font-size: 14px; }

/* ---------- campi ---------- */
label { display: block; margin: 12px 0 4px 0; font-weight: bold; font-size: 14px; }
input[type=text], input[type=email], select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #b9c5d8;
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
input[type=file] { margin-top: 4px; font-size: 14px; }
input:focus, select:focus { outline: 2px solid #2f6fd0; outline-offset: 1px; }

label.check { font-weight: normal; display: block; margin: 7px 0; }
label.check input { margin-right: 7px; }

.griglia { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.griglia.tre { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) {
  .griglia, .griglia.tre { grid-template-columns: 1fr; }
}

/* ---------- bottoni ---------- */
.btn {
  display: inline-block;
  background: #2f6fd0;
  color: #fff;
  border: 0;
  padding: 11px 22px;
  border-radius: 4px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  margin-top: 16px;
}
.btn:hover { background: #245ab0; }
.btn.grigio { background: #6b7890; }
.btn.grigio:hover { background: #58637a; }
.btn:disabled { background: #b3bcca; cursor: not-allowed; }

.riga-bottoni { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.mini {
  background: #6b7890; color: #fff; border: 0; padding: 4px 9px;
  border-radius: 3px; font-size: 12px; cursor: pointer;
}
.mini:hover { background: #58637a; }
.inline { display: inline; }

/* ---------- messaggi ---------- */
.errore {
  background: #fdecec; border-left: 4px solid #c62828;
  padding: 10px 12px; margin: 10px 0; color: #8c1c1c;
}
.avviso {
  background: #eaf4ea; border-left: 4px solid #2e7d32;
  padding: 10px 12px; margin: 10px 0; color: #1f5c22;
}
.rosso { color: #c62828; }
.ok { color: #2e7d32; font-size: 13px; }

/* ---------- documenti e testi lunghi ---------- */
.documento, .testo-lungo {
  background: #f7f9fc;
  border: 1px solid #dde5f0;
  border-radius: 4px;
  padding: 14px 16px;
  max-height: 340px;
  overflow-y: auto;
  font-size: 13px;
}
.documento { white-space: pre-wrap; font-family: Consolas, Menlo, monospace; }

/* ---------- slot documenti ---------- */
.slot {
  border: 1px solid #dde5f0;
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: #fafcff;
}
.slot-nome { font-weight: bold; font-size: 14px; margin-bottom: 6px; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: normal; }
.tag.obb { background: #fdecec; color: #8c1c1c; }
.tag.fac { background: #eef2f7; color: #5c6a80; }

/* ---------- tabelle ---------- */
table.elenco, table.sintesi {
  width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px;
}
table.elenco th, table.elenco td,
table.sintesi th, table.sintesi td {
  border: 1px solid #dde5f0; padding: 8px 10px; text-align: left; vertical-align: top;
}
table.elenco th { background: #f0f4fa; }
table.sintesi th { background: #f7f9fc; width: 34%; }
table.elenco td.azioni { white-space: nowrap; }

@media (max-width: 640px) {
  table.elenco { display: block; overflow-x: auto; }
}

/* ---------- stampa ---------- */
@media print {
  .testata, .btn, .riga-bottoni, form { display: none; }
  .box { border: 0; margin: 0; max-width: none; }
  .documento { max-height: none; overflow: visible; border: 0; background: #fff; }
}
