textarea {
  resize: none;
}

.kt-login.kt-login--v3
  .kt-login__wrapper
  .kt-login__container
  .kt-form
  .form-control.is-invalid {
  border: 1px solid #fd397a !important;
}

@media (min-width: 1025px) {
  .kt-header--fixed.kt-subheader--fixed.kt-subheader--enabled .kt-wrapper {
    padding-top: 64px;
  }
}

.form-control:focus {
  border-color: #e2e5ec;
}

#main-page-loader {
  padding-top: 20%;
}
.main-page-spinner {
  margin: 0 auto;
  height: 64px;
  width: 64px;
  animation: rotate 0.8s infinite linear;
  border: 5px solid firebrick;
  border-right-color: transparent;
  border-radius: 50%;
}

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

.div-dettaglio-prenotazione {
  background-color: #f7f8fa;
}

.show-detail {
  cursor: pointer;
}

.form-control.is-warning,
.was-validated .form-control:valid,
.is-valid {
  border-color: #0abb87;
  padding-right: calc(1.5em + 1.3rem);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath fill='%23333333' fill-rule='evenodd' d='M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0'/%3E %3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center right calc(0.375em + 0.325rem);
  background-size: calc(0.75em + 0.65rem) calc(0.75em + 0.65rem);
}

/* FIX GOOGLE MAPS AUTOCOMPLETE */
.pac-container {
  z-index: 1051 !important;
}

.struttura-disattivata {
  background-color: #e0e0e0;
}

.struttura-contratto {
  background-color: #99ffb4;
}

.struttura-trial {
  background-color: #ffffcc;
}

.struttura-no-contratto {
  background-color: #ff9999;
}

.highcharts-figure,
.highcharts-data-table table {
  padding: 0;
  min-width: 360px;
  max-width: 100%;
}
.div_grafici {
  width: 100%;
}

.highcharts-data-table table {
  font-family: Verdana, sans-serif;
  border-collapse: collapse;
  border: 1px solid #ebebeb;
  margin: 10px auto;
  text-align: center;
  width: 100%;
  max-width: 500px;
}

.highcharts-data-table caption {
  padding: 1em 0;
  font-size: 1.2em;
  color: #555;
}

.highcharts-data-table th {
  font-weight: 600;
  padding: 0.5em;
}

.highcharts-data-table td,
.highcharts-data-table th,
.highcharts-data-table caption {
  padding: 0.5em;
}

.highcharts-data-table thead tr,
.highcharts-data-table tr:nth-child(even) {
  background: #f8f8f8;
}

.highcharts-data-table tr:hover {
  background: #f1f7ff;
}

/* ==========================================================================
   Componenti condivisi cpanel (prefisso .cp-)
   Palette: #5d78ff primary, #0abb87 green, #fd397a red, #ffb822 orange
            #74788d muted, #48465b text, #f8f9fa bg-light, #e2e5ec border
   ========================================================================== */

/* --- Stats Grid --- */
.cp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.cp-stat-box {
  background: #f8f9fa;
  border: 1px solid #e2e5ec;
  border-radius: 6px;
  padding: 14px;
  text-align: center;
}
.cp-stat-box .cp-val {
  font-size: 22px;
  font-weight: 700;
  color: #48465b;
  line-height: 1.2;
  margin-bottom: 2px;
}
.cp-stat-box .cp-val.green {
  color: #0abb87;
}
.cp-stat-box .cp-val.red {
  color: #fd397a;
}
.cp-stat-box .cp-val.purple {
  color: #5d78ff;
}
.cp-stat-box .cp-val.orange {
  color: #ffb822;
}
.cp-stat-box .cp-lbl {
  font-size: 11px;
  color: #74788d;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cp-stat-box.cp-stat-box--clickable {
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.cp-stat-box.cp-stat-box--clickable:hover {
  background: #fff;
  border-color: #c4c8d4;
}
.cp-stat-box.cp-stat-box--clickable.cp-stat-box--active {
  background: linear-gradient(180deg, #eef1ff 0%, #e4e9ff 100%);
  border-color: #5d78ff;
  box-shadow:
    inset 0 3px 8px rgba(72, 70, 91, 0.2),
    0 0 0 1px #5d78ff,
    0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(1px);
}
.cp-stat-box.cp-stat-box--clickable.cp-stat-box--active .cp-lbl {
  color: #48465b;
}
/* Righe elenco link: nascoste dal filtro (evita conflitti display su tr con utility BS) */
tr.cp-link-row.cp-link-row--hidden {
  display: none !important;
}
.cp-card-mobile.cp-link-row.cp-link-row--hidden {
  display: none !important;
}
.cp-link-toolbar {
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding: 12px 14px;
  background: #f8f9fa;
  border: 1px solid #e2e5ec;
  border-radius: 6px;
  margin-bottom: 16px;
}
.cp-link-toolbar label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #74788d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.cp-link-filter-empty {
  display: none !important;
  padding: 24px;
  text-align: center;
  color: #74788d;
  font-size: 14px;
  border: 1px dashed #e2e5ec;
  border-radius: 6px;
  margin-bottom: 12px;
}
.cp-link-filter-empty.is-visible {
  display: block !important;
}

/* --- Test diagnostici: Google export14 cancellazione (td-cancel-*) --- */
.td-cancel-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0;
  padding: 14px 16px;
  background: hsl(228 100% 97%);
  border-radius: 8px;
  border: 1px solid hsl(228 45% 88%);
  font-size: 12px;
  color: hsl(228 18% 28%);
  line-height: 1.5;
  align-items: flex-start;
}
.td-cancel-legend__main {
  flex: 1;
  min-width: 200px;
}
.td-cancel-legend__title {
  color: hsl(228 100% 62%);
}
.td-cancel-legend__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  color: hsl(228 12% 40%);
}
.td-cancel-legend__swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.td-cancel-legend__swatch--ok {
  background: hsl(162 89% 38%);
}
.td-cancel-legend__swatch--no {
  background: hsl(343 98% 56%);
}
.td-cancel-legend__swatch--skip {
  background: hsl(42 100% 57%);
}
.td-cancel-legend__tone-ok {
  color: hsl(162 89% 32%);
  font-weight: 600;
}
.td-cancel-legend__tone-no {
  color: hsl(343 98% 50%);
  font-weight: 600;
}
.td-cancel-legend__tone-skip {
  color: hsl(38 100% 32%);
  font-weight: 600;
}
.cp-stats-grid.td-cancel-stats {
  margin-top: 8px;
}
.td-cancel-alert--info {
  margin: 10px 0;
  padding: 12px 16px;
  background: hsl(210 60% 96%);
  border-left: 5px solid hsl(228 100% 62%);
  border-radius: 6px;
  font-size: 12px;
  color: hsl(228 55% 26%);
}
.td-cancel-alert--info .fa {
  margin-right: 8px;
  color: hsl(228 100% 62%);
}
.td-cancel-alert--warn {
  margin: 10px 0;
  padding: 12px 16px;
  background: hsl(42 90% 94%);
  border-left: 5px solid hsl(42 82% 50%);
  border-radius: 6px;
  font-size: 12px;
  color: hsl(42 90% 22%);
}
.td-cancel-alert--warn .fa {
  margin-right: 8px;
  color: hsl(42 82% 50%);
}
.td-cancel-meta {
  margin: 12px 0;
  font-size: 12px;
  color: hsl(228 10% 52%);
}
.td-cancel-meta .fa {
  margin-right: 6px;
}
.td-cancel-meta__all-zones {
  color: hsl(162 89% 32%);
}
.td-cancel-table {
  margin-bottom: 14px;
  font-size: 12px;
}
.cp-table.td-cancel-table th .td-cancel-th-muted {
  font-weight: 400;
  color: hsl(228 10% 52%);
}
.td-cancel-verdict-td {
  min-width: 300px;
  max-width: 380px;
  vertical-align: top;
  padding: 0;
  border: none;
}
.td-cancel-verdict-card {
  background: var(--tdv-bg, hsl(228 30% 98%));
  border-left: 5px solid var(--tdv-border, hsl(228 10% 52%));
  border-radius: 8px;
  padding: 12px 14px;
  margin: 4px 0;
  box-shadow: 0 1px 2px hsl(0 0% 0% / 0.04);
}
.td-cancel-verdict-card__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.td-cancel-verdict-card__icon {
  font-size: 22px;
  color: var(--tdv-border, hsl(228 10% 52%));
  margin-top: 2px;
  flex-shrink: 0;
}
.td-cancel-verdict-card__body {
  flex: 1;
  min-width: 0;
}
.td-cancel-verdict-card__title {
  font-weight: 700;
  font-size: 14px;
  color: hsl(228 12% 12%);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.td-cancel-verdict-card__line1 {
  font-size: 12px;
  line-height: 1.5;
  color: hsl(228 10% 28%);
  margin-bottom: 6px;
}
.td-cancel-verdict-card__line2 {
  font-size: 11px;
  line-height: 1.45;
  color: hsl(228 8% 46%);
}
.td-cancel-verdict-card__accent {
  color: hsl(162 89% 30%);
}
.td-cancel-verdict-card__accent-danger {
  color: hsl(6 59% 42%);
}
.td-cancel-td-mid {
  vertical-align: middle;
}
.td-cancel-policy-src {
  font-size: 10px;
  color: hsl(228 12% 64%);
}
.td-cancel-struttura-small {
  color: hsl(228 12% 64%);
  font-size: 10px;
}
.td-cancel-day-debug summary {
  cursor: pointer;
  font-size: 12px;
  color: hsl(228 76% 58%);
}
.td-cancel-day-debug pre {
  margin: 0;
  color: hsl(228 22% 62%);
  font-size: 11px;
}
.td-cancel-note {
  font-size: 12px;
  color: hsl(228 12% 40%);
}
.td-cancel-note .fa {
  margin-right: 8px;
  color: hsl(228 100% 62%);
}

/* --- Tabelle dati --- */
.cp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cp-table.cp-table-fixed {
  table-layout: fixed;
}
/* --- Colonna che aderisce al contenuto (shrink-to-fit) --- */
.cp-col-shrink {
  width: 1%;
  white-space: nowrap;
}
.cp-table th {
  background: #f8f9fa;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #74788d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  border-bottom: 2px solid #e2e5ec;
}
.cp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e5ec;
  color: #48465b;
  vertical-align: middle;
}
.cp-table tr:last-child td {
  border-bottom: none;
}
.cp-table tr:hover td {
  background: #f8f9fa;
}

/* --- Section title con linea --- */
.cp-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #48465b;
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cp-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e5ec;
}

/* --- Badge di stato --- */
.cp-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.cp-badge.success {
  background: #d4edda;
  color: #155724;
}
.cp-badge.danger {
  background: #f8d7da;
  color: #721c24;
}
.cp-badge.warning {
  background: #fff3cd;
  color: #856404;
}
.cp-badge.info {
  background: #d1ecf1;
  color: #0c5460;
}
.cp-badge.primary {
  background: #eef0ff;
  color: #5d78ff;
}
.cp-badge.sm {
  padding: 2px 8px;
  font-size: 10px;
}

/* --- Pulsanti azione compatti --- */
.cp-btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  gap: 5px;
  color: #48465b;
  background: #f0f0f5;
  line-height: 1.4;
}
.cp-btn-action:hover {
  filter: brightness(0.92);
}
.cp-btn-action.primary {
  background: #5d78ff;
  color: #fff;
}
.cp-btn-action.success {
  background: #0abb87;
  color: #fff;
}
.cp-btn-action.warning {
  background: #ffb822;
  color: #fff;
}
.cp-btn-action.danger {
  background: #fd397a;
  color: #fff;
}
.cp-btn-action.info {
  background: #5578eb;
  color: #fff;
}
.cp-btn-action.secondary {
  background: #6c757d;
  color: #fff;
}
.cp-btn-action.cp-btn-action--outline-secondary {
  background: #fff;
  color: #74788d;
  border: 1px solid #e2e5ec;
  box-shadow: none;
}
.cp-btn-action.cp-btn-action--outline-secondary:hover {
  filter: none;
  background: #f8f9fa;
  border-color: #c4c8d4;
  color: #48465b;
}
.cp-btn-action.cp-btn-action--outline-primary {
  background: #eef0ff;
  color: #5d78ff;
  border: 1px solid #d4daf8;
  box-shadow: none;
}
.cp-btn-action.cp-btn-action--outline-primary:hover {
  filter: none;
  background: #5d78ff;
  border-color: #5d78ff;
  color: #fff;
}
.cp-btn-action.cp-btn-action--outline-danger {
  background: #fff5f8;
  color: #fd397a;
  border: 1px solid #fcd4df;
  box-shadow: none;
}
.cp-btn-action.cp-btn-action--outline-danger:hover {
  filter: none;
  background: #fd397a;
  border-color: #fd397a;
  color: #fff;
}
.cp-btn-action.disabled,
.cp-btn-action[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

/* --- Cella azioni con bottoni affiancati e centrati --- */
.cp-actions-cell {
  white-space: nowrap;
}
.cp-actions-cell .cp-btn-action {
  margin: 2px 2px;
}
td.cp-actions-cell {
  text-align: center;
}

/* --- Bottone icon-only (senza testo) --- */
.cp-btn-icon {
  padding: 6px 8px;
  min-width: 30px;
}

/* --- Link ordinamento nelle intestazioni tabella --- */
.cp-sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.cp-sort-link:hover {
  color: #5d78ff;
}
.cp-sort-link i {
  font-size: 13px;
}

/* --- Barra filtri sopra tabella --- */
.cp-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.cp-filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 180px;
}
.cp-filter-group label {
  font-size: 11px;
  font-weight: 700;
  color: #74788d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.cp-filter-group--count {
  align-self: center;
  min-width: auto;
}
.cp-filter-group--actions {
  flex-direction: row;
  align-self: flex-end;
  gap: 6px;
  min-width: auto;
}

/* --- Stato vuoto --- */
.cp-empty-state {
  text-align: center;
  padding: 30px;
  color: #74788d;
  font-size: 13px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px dashed #e2e5ec;
}

/* --- Blocco date con label --- */
.cp-date-block {
  font-size: 12px;
  line-height: 1.6;
}
.cp-date-block .cp-date-label {
  color: #74788d;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* --- Colonna azioni --- */
.cp-actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* --- Dropdown azioni dentro tabella --- */
.cp-actions-dropdown {
  min-width: 180px;
  padding: 6px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border: 1px solid #e2e5ec;
  border-radius: 6px;
}
.cp-actions-dropdown .dropdown-item {
  font-size: 13px;
  padding: 8px 16px;
  color: #48465b;
}
.cp-actions-dropdown .dropdown-item:hover {
  background: #f0f3ff;
}
.cp-actions-dropdown .dropdown-item i {
  width: 18px;
  text-align: center;
}
.cp-actions-dropdown .dropdown-divider {
  margin: 4px 0;
}

/* --- Testo troncato con ellipsis --- */
.cp-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-table-fixed .cp-truncate {
  max-width: 0;
}

/* --- Log operazioni (terminale scuro) --- */
.cp-steps-log {
  background: #1e1e2d;
  border-radius: 6px;
  padding: 14px 16px;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.9;
  max-height: 220px;
  overflow-y: auto;
}
.cp-steps-log .cp-step-line {
  color: #8b97c6;
}
.cp-steps-log .cp-step-line::before {
  content: '\25B8 ';
  color: #0abb87;
}

/* --- Search wrap con icona --- */
.cp-search-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.cp-search-wrap .cp-search-field {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
}
.cp-search-wrap .cp-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #74788d;
  pointer-events: none;
}
.cp-search-wrap .cp-search-btns {
  display: flex;
  gap: 6px;
  padding-bottom: 1px;
}

/* --- Meta info box --- */
.cp-meta-box {
  margin-top: 10px;
  padding: 10px 14px;
  background: #f8f9fa;
  border: 1px solid #e2e5ec;
  border-radius: 6px;
  font-size: 13px;
  color: #74788d;
  display: none;
}
.cp-meta-box.visible {
  display: block;
}

/* --- Progress bar indeterminate --- */
.cp-progress-wrap {
  height: 6px;
  background: #e2e5ec;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.cp-progress-fill {
  height: 100%;
  background: #5d78ff;
  border-radius: 3px;
  animation: cp-indeterminate 1.4s infinite;
}
@keyframes cp-indeterminate {
  0% {
    transform: translateX(-100%) scaleX(0.5);
  }
  50% {
    transform: translateX(0) scaleX(1);
  }
  100% {
    transform: translateX(100%) scaleX(0.5);
  }
}

/* --- Spinner inline --- */
.cp-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(93, 120, 255, 0.25);
  border-top-color: #5d78ff;
  border-radius: 50%;
  animation: cp-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 5px;
}
@keyframes cp-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- Grid per card tipo selezione --- */
.cp-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

/* --- Card tipo selezione (radio card) --- */
.cp-type-card {
  border: 2px solid #e2e5ec;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.cp-type-card:hover {
  border-color: #9aabff;
  background: #f5f6ff;
}
.cp-type-card.selected {
  border-color: #5d78ff;
  background: #eef0ff;
}
.cp-type-card input[type='radio'] {
  position: absolute;
  opacity: 0;
}
.cp-type-card .cp-type-icon {
  font-size: 20px;
  margin-bottom: 6px;
}
.cp-type-card .cp-type-title {
  font-size: 13px;
  font-weight: 700;
  color: #48465b;
  margin-bottom: 3px;
}
.cp-type-card .cp-type-desc {
  font-size: 12px;
  color: #74788d;
  line-height: 1.5;
}

/* --- Preview box --- */
.cp-preview-box {
  margin-top: 10px;
  padding: 12px 14px;
  background: #f8f9fa;
  border: 1px solid #e2e5ec;
  border-radius: 6px;
  display: none;
}
.cp-preview-box.visible {
  display: block;
}
.cp-preview-box .cp-preview-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid #e2e5ec;
}
.cp-preview-box .cp-preview-row:last-child {
  border-bottom: none;
}
.cp-preview-box .cp-preview-lbl {
  color: #74788d;
}
.cp-preview-box .cp-preview-val {
  font-weight: 600;
  color: #48465b;
}

/* --- Nav tabs stile cpanel --- */
.cp-tabs .nav-link {
  font-weight: 600;
  color: #74788d;
}
.cp-tabs .nav-link.active {
  color: #5d78ff;
  border-bottom: 3px solid #5d78ff;
  background: transparent;
}

/* --- Code inline --- */
.cp-code {
  background: #f0f0f8;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  color: #5d78ff;
}

/* --- Tab content padding --- */
.cp-tab-content {
  padding-top: 20px;
}

/* --- Modal cpanel (override globale per template cpanel) --- */
.modal-content {
  border: none;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}
.modal-header {
  background: #f8f9fa;
  border-bottom: 1px solid #e2e5ec;
  padding: 16px 24px;
  border-radius: 8px 8px 0 0;
}
.modal-header .modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #48465b;
}
.modal-header .close {
  font-size: 22px;
  color: #74788d;
  opacity: 0.7;
}
.modal-header .close:hover {
  opacity: 1;
  color: #48465b;
}
.modal-body {
  padding: 24px;
}
.modal-footer {
  border-top: 1px solid #e2e5ec;
  padding: 14px 24px;
  background: #f8f9fa;
  border-radius: 0 0 8px 8px;
}
.modal-footer .btn-primary {
  background: #5d78ff;
  border-color: #5d78ff;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 4px;
}
.modal-footer .btn-primary:hover {
  background: #4a67e0;
  border-color: #4a67e0;
}
.modal-footer .btn-secondary {
  background: #f0f0f5;
  border-color: #e2e5ec;
  color: #48465b;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 4px;
}
.modal-footer .btn-secondary:hover {
  background: #e2e5ec;
}
.modal-footer .btn-danger {
  background: #fd397a;
  border-color: #fd397a;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 4px;
}
.modal-footer .btn-danger:hover {
  background: #e52e6a;
  border-color: #e52e6a;
}

/* --- Nav pills dentro modal (tab Informazioni/Piano/Fatturazione) --- */
.modal .nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
}
.modal .nav-pills .nav-link {
  color: #74788d;
  font-weight: 600;
  font-size: 13px;
  border-radius: 4px;
  padding: 8px 16px;
  white-space: nowrap;
}
.modal .nav-pills .nav-link:hover {
  background: #f0f3ff;
  color: #5d78ff;
}
.modal .nav-pills .nav-link.active {
  background: #5d78ff;
  color: #fff;
}
.modal .tab-content {
  padding-top: 20px;
}

/* --- Form labels dentro modal --- */
.modal .form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #48465b;
  margin-bottom: 6px;
}
.modal .form-control {
  border-radius: 4px;
  border-color: #e2e5ec;
  font-size: 13px;
}
.modal .form-control:focus {
  border-color: #5d78ff;
  box-shadow: 0 0 0 0.2rem rgba(93, 120, 255, 0.15);
}

/* --- Etichetta filtro compatta --- */
.cp-filter-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #74788d;
  margin-bottom: 4px;
}

/* --- Riga totale evidenziata dentro cp-table --- */
.cp-table tr.cp-row-total td {
  background: #f0f3ff;
  font-weight: 700;
  border-top: 2px solid #5d78ff;
}

/* --- Righe colorate per stato struttura dentro cp-table --- */
.cp-table tr.struttura-disattivata td {
  background: #f0f0f0;
}
.cp-table tr.struttura-contratto td {
  background: #edfff3;
}
.cp-table tr.struttura-trial td {
  background: #fffde6;
}
.cp-table tr.struttura-no-contratto td {
  background: #fff0f0;
}
.cp-table tr.struttura-disattivata:hover td {
  background: #e8e8e8;
}
.cp-table tr.struttura-contratto:hover td {
  background: #ddf7e6;
}
.cp-table tr.struttura-trial:hover td {
  background: #fff8cc;
}
.cp-table tr.struttura-no-contratto:hover td {
  background: #ffe0e0;
}

/* --- Contenitore tabella scrollabile --- */
.cp-table-responsive {
  overflow-x: visible;
  width: 100%;
}

/* --- Legenda compatta --- */
.cp-legend-list {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: #74788d;
}

/* --- Dropdown searchable (rivenditore / segnalatore) --- */
.cp-dropdown {
  position: relative;
  display: inline-block;
  width: 100%;
}
.cp-dropdown-btn {
  background: #fff;
  color: #495057;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #ced4da;
  cursor: pointer;
  border-radius: 4px;
  width: 100%;
  text-align: left;
  position: relative;
}
.cp-dropdown-btn:hover,
.cp-dropdown-btn:focus {
  background: #f8f9fa;
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.cp-dropdown-btn:disabled {
  background: #e9ecef;
  color: #6c757d;
  cursor: not-allowed;
  opacity: 0.65;
}
.cp-dropdown-btn:disabled:hover {
  background: #e9ecef;
  border-color: #ced4da;
  box-shadow: none;
}
.cp-dropdown-content {
  display: none;
  position: absolute;
  background: #f6f6f6;
  min-width: 100%;
  border: 1px solid #ddd;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}
.cp-dropdown-content a {
  color: #333;
  padding: 8px 12px;
  text-decoration: none;
  display: block;
  font-size: 14px;
}
.cp-dropdown-content a:hover {
  background: #e9ecef;
}
.cp-dropdown-content.show {
  display: block;
}
.cp-dropdown-search {
  box-sizing: border-box;
  font-size: 14px;
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid #ddd;
  width: 100%;
}
.cp-dropdown-search:focus {
  outline: 3px solid #ddd;
}

/* --- Badge list (elenco badge affiancati con wrap) --- */
.cp-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
}

/* --- Card layout mobile per tabelle --- */
.cp-card-mobile {
  background: #fff;
  border: 1px solid #e2e5ec;
  border-radius: 6px;
  margin-bottom: 10px;
  overflow: hidden;
}
.cp-card-mobile__header {
  padding: 10px 14px;
  background: #f8f9fa;
  border-bottom: 1px solid #e2e5ec;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cp-card-mobile__id {
  color: #74788d;
  font-size: 12px;
  font-weight: 600;
}
.cp-card-mobile__body {
  padding: 10px 14px;
}
.cp-card-mobile__footer {
  padding: 8px 14px;
  border-top: 1px solid #e2e5ec;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
.cp-card-mobile__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 3px 0;
  font-size: 13px;
}
.cp-card-mobile__label {
  font-weight: 700;
  color: #74788d;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  margin-right: 10px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .cp-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cp-table {
    font-size: 12px;
  }
  .cp-table th,
  .cp-table td {
    padding: 8px 6px;
  }
  .cp-type-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Gestione pagine / menu (vista ad albero, coerente con cp-*) --- */
.cp-gp-tabs-nav {
  margin-bottom: 18px;
  border-bottom: 1px solid #e2e5ec;
}
.cp-gp-tabs-nav .nav-item {
  margin-bottom: -1px;
}
.cp-gp-tabs-nav .nav-link {
  padding: 10px 18px;
  font-size: 13px;
}
.cp-gp-notice {
  border-radius: 6px;
  border: 1px solid #e2e5ec;
  border-left: 4px solid #5d78ff;
  background: linear-gradient(90deg, #f4f6ff 0%, #fafbfd 28%, #fafbfd 100%);
  padding: 14px 18px;
  margin-bottom: 20px;
  max-width: 960px;
  font-size: 13px;
  color: #74788d;
  line-height: 1.55;
}
.cp-gp-notice code {
  color: #48465b;
  font-size: 12px;
  background: #f0f1f5;
  padding: 1px 5px;
  border-radius: 3px;
}
.cp-gp-main-card {
  border: 1px solid #e2e5ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 6px rgba(82, 63, 105, 0.06);
  margin-bottom: 8px;
  overflow: hidden;
}
.cp-gp-main-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px;
  background: linear-gradient(180deg, #fafbfd 0%, #f4f5f8 100%);
  border-bottom: 1px solid #e2e5ec;
}
.cp-gp-main-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #48465b;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cp-gp-main-card__title i {
  color: #74788d;
  font-size: 16px;
  font-weight: 400;
}
.cp-gp-main-card__body {
  padding: 18px 20px 20px;
  background: #fff;
}
.cp-gp-main-card__body > .cp-gp-tpl-block:last-child {
  margin-bottom: 0;
}
.cp-gp-tpl-block {
  margin-bottom: 28px;
}
.cp-gp-tpl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid #e2e5ec;
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 1px 4px rgba(82, 63, 105, 0.06);
}
.cp-gp-tpl-head h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #48465b;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.cp-gp-tpl-head__muted {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #74788d;
}
.cp-gp-sezione {
  border: 1px solid #e2e5ec;
  border-radius: 6px;
  margin-bottom: 16px;
  overflow: hidden;
  background: #fff;
}
.cp-gp-sezione-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(180deg, #fafbfd 0%, #f4f5f8 100%);
  border-bottom: 1px solid #e2e5ec;
}
.cp-gp-sezione-head__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #48465b;
}
.cp-gp-sezione-head__title i {
  color: #74788d;
  font-size: 16px;
}
.cp-gp-sezione-head__title .cp-gp-code {
  font-size: 15px;
}
.cp-gp-meta {
  font-size: 12px;
  color: #74788d;
  font-weight: 600;
}
.cp-gp-code {
  font-family:
    SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
    monospace;
  font-size: 13px;
  color: #48465b;
  font-weight: 600;
}
/* Ordine: gruppo visivo input + azioni (stile input-group Metronic) — sempre una riga */
.cp-gp-ordine-inline {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
}
.cp-gp-ordine-inline.cp-gp-ordine-inputgroup {
  border: 1px solid #e2e5ec;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(82, 63, 105, 0.04);
  flex-wrap: nowrap;
}
.cp-gp-ordine-inline .cp-gp-ordine-input {
  width: 6.75rem;
  min-width: 6.75rem;
  max-width: 8.5rem;
  flex: 0 0 auto;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  min-height: 36px;
  text-align: center;
  border-radius: 4px;
  border: 1px solid #e2e5ec;
}
.cp-gp-ordine-inputgroup .cp-gp-ordine-input {
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.cp-gp-ordine-inputgroup .cp-gp-ordine-input:focus {
  box-shadow: inset 0 0 0 1px #5d78ff;
  z-index: 1;
  position: relative;
}
.cp-gp-ordine-inputgroup .cp-btn-action {
  border-radius: 0;
  margin: 0;
  min-height: 36px;
  flex-shrink: 0;
  align-self: stretch;
  border: none;
  border-left: 1px solid #e2e5ec;
}
.cp-gp-ordine-inputgroup .cp-btn-action:hover {
  filter: none;
  background: #f4f6fb;
}
.cp-gp-ordine-inputgroup .cp-btn-action.cp-btn-action--outline-secondary:hover {
  background: #f0f2f8;
}
.cp-gp-ordine-inputgroup .cp-btn-action.success:hover {
  filter: none;
  background: #09a77a;
}
.cp-gp-ordine-inline .cp-btn-action--ordine-save {
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  min-height: 36px;
  min-width: 38px;
}
.cp-gp-table tbody td {
  vertical-align: middle;
  line-height: 1.45;
}
.cp-gp-table td:first-child {
  vertical-align: middle;
  white-space: nowrap;
  line-height: normal;
}
/* Testo numerico (Livello): stessa metrica verticale delle altre celle testo */
.cp-gp-table td.cp-td-center {
  vertical-align: middle;
  line-height: 1.45;
}
.cp-gp-table .cp-actions-cell .cp-btn-icon {
  min-width: 38px;
  min-height: 38px;
  padding: 0 10px;
  font-size: 15px;
  border-radius: 6px;
}
/*
 * Azioni: padding 12px sopra / 8px sotto (somma 20px come 10+10 sulle altre celle)
 * così il gruppo pulsanti scende leggermente e si allinea meglio al testo (line-box) vicino.
 */
.cp-gp-table td.cp-actions-cell {
  vertical-align: middle;
  text-align: center;
  line-height: normal;
  padding: 14px 12px 8px;
}
.cp-gp-table .cp-gp-actions-wrap {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.cp-gp-table .cp-gp-actions-wrap .cp-btn-action {
  margin: 0;
  flex-shrink: 0;
}
.cp-gp-table tbody tr.cp-gp-row-genitore td {
  background: #f4f6f9;
  font-weight: 600;
  padding: 10px 12px;
}
.cp-gp-table tbody tr.cp-gp-row-figlio:nth-child(even) td {
  background: #fafbfc;
}
.cp-gp-table tbody tr.cp-gp-row-figlio:nth-child(odd) td {
  background: #fff;
}
.cp-gp-table tbody tr.cp-gp-row-figlio td:first-child {
  box-shadow: inset 4px 0 0 #5d78ff33;
}
.cp-gp-table tbody tr:hover td {
  filter: none;
}
.cp-gp-table tbody tr.cp-gp-row-genitore:hover td,
.cp-gp-table tbody tr.cp-gp-row-figlio:hover td {
  background: #f0f3ff !important;
}
.cp-gp-table.cp-gp-table--flat tbody tr:nth-child(even) td {
  background: #fafbfc;
}
.cp-gp-table.cp-gp-table--flat tbody tr:nth-child(odd) td {
  background: #fff;
}
.cp-gp-table.cp-gp-table--flat tbody tr:hover td {
  background: #f0f3ff !important;
}
/* Legacy stack (se presente altrove) */
.cp-gp-ordine-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.cp-gp-ordine-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cp-gp-ordine-row .form-control {
  width: 76px;
  padding: 4px 8px;
  font-size: 12px;
  height: auto;
  min-height: 30px;
}
.cp-gp-alert {
  border-left: 4px solid #ffb822;
  background: #fffaf0;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #48465b;
}
.cp-btn-action.cp-btn-action--compact {
  padding: 4px 10px;
  font-size: 11px;
}

/* Utility tabella / modale (gestione pagine e analoghe) */
.cp-filter-bar.cp-filter-bar--section-gap {
  margin-bottom: 18px;
}
.cp-th-center,
.cp-td-center {
  text-align: center;
}
.cp-th-narrow {
  width: 72px;
}
.cp-th-actions {
  width: 200px;
  text-align: center;
}
.cp-th-actions.cp-th-actions--wide {
  width: auto;
  min-width: 180px;
}
.cp-url-cell-tree {
  max-width: 280px;
}
.cp-url-cell-flat {
  max-width: 220px;
}
.cp-modal-body-scroll {
  max-height: 70vh;
  overflow-y: auto;
}
.cp-badge.neutral {
  background: #eef0f5;
  color: #74788d;
}
