
/* HOMI Theme v6 — Tabelle generiche + Modali + Form (scoped su body.theme-homi)
   Obiettivo: applicare lo stesso look in tutte le Anagrafiche e nelle modali
   senza toccare l'HTML.
*/

/* =========================
   TABLES (Bootstrap + DataTables generico)
   ========================= */
.theme-homi table.table,
.theme-homi table.dataTable {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100% !important;
  background: #fff !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  box-shadow: 0 10px 28px rgba(17,24,39,.10) !important;
  border: 1px solid #e6ebf2 !important;
}

.theme-homi table.table thead th,
.theme-homi table.dataTable thead th {
  background: #eef3fb !important;
  color: #475069 !important;
  font-weight: 600 !important;
  border-bottom: 1px solid #e6ebf2 !important;
  vertical-align: middle !important;
  padding: 12px 10px !important;
}

.theme-homi table.table tbody td,
.theme-homi table.dataTable tbody td {
  border-bottom: 1px solid #e6ebf2 !important;
  vertical-align: middle !important;
  padding: 12px 10px !important;
}

.theme-homi table.table tbody tr:hover,
.theme-homi table.dataTable tbody tr:hover {
  background: #f8fbff !important;
}

/* Sorting states */
.theme-homi table.table thead th.sorting,
.theme-homi table.table thead th.sorting_asc,
.theme-homi table.table thead th.sorting_desc,
.theme-homi table.dataTable thead th.sorting,
.theme-homi table.dataTable thead th.sorting_asc,
.theme-homi table.dataTable thead th.sorting_desc {
  background: #eef3fb !important;
}

/* DataTables wrapper controls (generico) */
.theme-homi .dataTables_wrapper .dataTables_length select {
  border: 1px solid #e6ebf2 !important;
  border-radius: 10px !important;
  padding: 4px 8px !important;
  background: #fff !important;
}
.theme-homi .dataTables_wrapper .dataTables_filter { text-align: right !important; }
.theme-homi .dataTables_wrapper .dataTables_filter input {
  border: 1px solid #e6ebf2 !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  width: 220px !important;
  background: #fff !important;
}
.theme-homi .dataTables_wrapper .dataTables_info { color: #6b7280 !important; }
.theme-homi .dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 1px solid #e6ebf2 !important;
  border-radius: 10px !important;
  padding: 4px 10px !important;
  background: #fff !important;
  margin: 0 2px !important;
}
.theme-homi .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #1b74ff !important;
  color: #fff !important;
  border-color: #1b74ff !important;
}
/* Bottoni export */
.theme-homi .dt-buttons .dt-button {
  border: 1px solid #e6ebf2 !important;
  background: #fff !important;
  color: #1f2330 !important;
  border-radius: 10px !important;
  padding: 6px 10px !important;
  margin: 0 2px !important;
  box-shadow: 0 4px 12px rgba(17,24,39,.06) !important;
}
.theme-homi .dt-buttons .dt-button:hover { background: #f7f9fc !important; }

/* Wrapper "card" consigliato (se presente un contenitore tipo .table-wrap o .box) */
.theme-homi .table-wrap,
.theme-homi .box-table,
.theme-homi .table-card {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(17,24,39,.10);
  padding: 12px;
}

/* =========================
   MODALS (Bootstrap)
   ========================= */
.theme-homi .modal-backdrop.show {
  backdrop-filter: blur(1px);
  background-color: rgba(15,17,21,.45);
}
.theme-homi .modal .modal-dialog {
  margin-top: 6vh;
}
.theme-homi .modal .modal-content {
  background: #ffffff;
  border: 1px solid #e6ebf2;
  border-radius: 18px;
  box-shadow: 0 20px 44px rgba(17,24,39,.18);
}
.theme-homi .modal .modal-header {
  border-bottom: 1px solid #eef1f5;
  background: #f8fbff;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}
.theme-homi .modal .modal-title {
  font-weight: 700;
  color: #1f2330;
}
.theme-homi .modal .close,
.theme-homi .modal .btn-close {
  filter: none !important;
  opacity: .65;
}
.theme-homi .modal .close:hover,
.theme-homi .modal .btn-close:hover { opacity: .9; }
.theme-homi .modal .modal-footer {
  border-top: 1px solid #eef1f5;
  background: #fbfcfe;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

/* =========================
   FORM ELEMENTS (nelle modali e non)
   ========================= */
.theme-homi .form-control,
.theme-homi .form-select,
.theme-homi select.form-control {
  border: 1px solid #e6ebf2 !important;
  border-radius: 12px !important;
  background: #fff !important;
  padding: 8px 10px !important;
  box-shadow: none !important;
}
.theme-homi .form-control:focus,
.theme-homi .form-select:focus,
.theme-homi select.form-control:focus {
  border-color: #1b74ff !important;
  box-shadow: 0 0 0 3px rgba(27,116,255,.20) !important;
}

.theme-homi .input-group-text {
  border: 1px solid #e6ebf2 !important;
  background: #f8fbff !important;
  border-radius: 12px !important;
}

/* Checkbox & radio (Bootstrap 4/5) */
.theme-homi .form-check-input {
  border-radius: 6px !important;
  border: 1px solid #d8dee9 !important;
}
.theme-homi .form-check-input:checked {
  background-color: #1b74ff !important;
  border-color: #1b74ff !important;
}

/* Bootstrap-select (se usata) */
.theme-homi .bootstrap-select .dropdown-toggle {
  border: 1px solid #e6ebf2 !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: none !important;
  padding: 8px 10px !important;
}
.theme-homi .bootstrap-select .dropdown-menu {
  border: 1px solid #e6ebf2 !important;
  border-radius: 12px !important;
  box-shadow: 0 14px 34px rgba(17,24,39,.12) !important;
}

/* Help text + error */
.theme-homi .form-text { color: #6b7280 !important; }
.theme-homi .is-invalid,
.theme-homi .form-control.is-invalid,
.theme-homi .form-select.is-invalid {
  border-color: #e74c3c !important;
  box-shadow: 0 0 0 3px rgba(231,76,60,.15) !important;
}
.theme-homi .invalid-feedback { color: #e74c3c !important; }

/* ===== MODAL HEADER — GRADIENTE B (Blu → Viola) ===== */
.theme-homi .modal .modal-header {
  background: linear-gradient(90deg, #3b3eff 0%, #9b57ff 100%) !important;
  border-bottom: none !important;
  padding-top: 16px !important;
  padding-bottom: 16px !important;
  border-top-left-radius: 18px !important;
  border-top-right-radius: 18px !important;
}

.theme-homi .modal .modal-title {
  color: #ffffff !important;
  font-weight: 700 !important;
  letter-spacing: .2px;
}

/* Pulsante chiusura */
.theme-homi .modal .btn-close,
.theme-homi .modal .close {
  filter: brightness(1000%) !important;
  opacity: 0.85 !important;
  mix-blend-mode: screen !important; /* evita l'effetto grigio */
}
.theme-homi .modal .btn-close:hover,
.theme-homi .modal .close:hover {
  opacity: 1 !important;
}

/* Footer definito */
.theme-homi .modal .modal-footer {
  background: #fbfcfe !important;
  border-top: 1px solid #e6ebf2 !important;
  border-bottom-left-radius: 18px !important;
  border-bottom-right-radius: 18px !important;
}

/* ===== PANEL "MODALE" (Bootstrap 3) — Gradient B ===== */
.theme-homi .panel.panel-primary {
  background: #fff;
  border: 1px solid #e6ebf2 !important;
  border-radius: 18px !important;
  box-shadow: 0 20px 44px rgba(17,24,39,.12);
  overflow: hidden; /* arrotonda anche gli inner */
}

/* Header con gradiente blu → viola */
.theme-homi .panel.panel-primary > .panel-heading {
  background: linear-gradient(90deg, #3b3eff 0%, #9b57ff 100%) !important;
  color: #fff !important;
  border: none !important;
  padding: 16px 18px !important;
  font-weight: 700;
}

/* Body chiaro + separatore soft */
.theme-homi .panel.panel-primary > .panel-body {
  background: #fff !important;
  border-top: 1px solid #eef1f5 !important;
  padding: 16px !important;
}

/* Titolo pagina sopra il panel: un filo più deciso */
.theme-homi .container > h3 {
  font-weight: 700; letter-spacing: .2px; margin-bottom: 14px;
}

/* Input group (Bootstrap 3) armonizzati */
.theme-homi .input-group { margin-bottom: 12px !important; }
.theme-homi .input-group .input-group-prepend .input-group-text,
.theme-homi .input-group .input-group-addon,
.theme-homi .input-group-addon {
  border: 1px solid #e6ebf2 !important;
  background: #f8fbff !important;
  border-radius: 12px !important;
}
.theme-homi .input-group .form-control {
  border: 1px solid #e6ebf2 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}

/* Textarea coerente */
.theme-homi textarea.form-control {
  min-height: 160px;
  border-radius: 12px !important;
}

/* Pulsanti (riusa le nostre regole v5; qui solo un pizzico di spacing) */
.theme-homi .panel .btn { margin-right: 6px; }

/* ================================
   HOMI — Rifiniture finali (Append v6)
   - Titolo <h3> con gradiente B (blu → viola)
   - Spaziature coerenti modali/panel
   - Allineamento input-group e colonne
   ================================ */

/* Titolo pagina */
.theme-homi .container > h3{
  font-weight: 700 !important;
  font-size: 22px !important;
  letter-spacing: .2px;
  margin-bottom: 18px !important;
  background: linear-gradient(90deg, #3b3eff 0%, #9b57ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Panel “modale” (Bootstrap 3) — respiro interno */
.theme-homi .panel.panel-primary{
  padding: 18px !important;
}

/* Spaziatura verticale uniforme tra blocchi */
.theme-homi .input-group,
.theme-homi .form-group,
.theme-homi .form-check,
.theme-homi .containertextarea{
  margin-bottom: 14px !important;
}

/* Ultimo gruppo pulsanti con margine superiore armonico */
.theme-homi form .form-group:last-of-type{
  margin-top: 18px !important;
}

/* Campi: padding consistente */
.theme-homi .form-control{
  padding: 9px 12px !important;
}

/* Input group: allineamento e altezza addon */
.theme-homi .input-group-text,
.theme-homi .input-group-addon{
  height: 38px !important;
  display: flex;
  align-items: center;
  border: 1px solid #e6ebf2 !important;
  background: #f8fbff !important;
  border-radius: 12px !important;
}

/* Colonne: distanza laterale coerente */
.theme-homi .row [class*="col-"]{
  padding-right: 12px !important;
  padding-left: 12px !important;
}

/* Titoletti colonna laterale */
.theme-homi .col-xl-4 h4{
  margin-bottom: 10px !important;
  font-weight: 600 !important;
}

/* Textarea: altezza e radius */
.theme-homi textarea.form-control{
  min-height: 160px;
  border-radius: 12px !important;
}
