/**
 * HPM — Tema admin bozza: topnav stile area utenti, sidebar nascosta.
 * Toggle: body.hpm-admin-topnav (aggiunta via admin_body_class).
 */

/* Nasconde menù tradizionale (sidebar) + pannello setup laterale */
body.hpm-admin-topnav #menu,
body.hpm-admin-topnav #setup-menu-wrapper {
  display: none !important;
}

body.hpm-admin-topnav #wrapper {
  margin-left: 0 !important;
}

body.hpm-admin-topnav .hide-menu {
  display: none !important;
}

/* Logo sempre visibile (anche mobile) + inset 10px */
body.hpm-admin-topnav #header #logo {
  display: flex !important;
  margin-left: 10px;
}

/* Hamburger tre linee (come area utenti), abbassato 5px */
body.hpm-admin-topnav .hpm-admin-hamburger {
  display: none;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  margin: 5px 0 0 0;
  float: none;
}

body.hpm-admin-topnav .hpm-admin-hamburger .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  margin: 4px 0;
  background-color: #475569;
  border-radius: 1px;
}

@media (max-width: 991px) {
  /* Cerca inutile su mobile: nascosto */
  body.hpm-admin-topnav #top_search,
  body.hpm-admin-topnav #header nav > .tw-flex > .tw-flex-1 {
    display: none !important;
  }

  body.hpm-admin-topnav .hpm-admin-hamburger {
    display: inline-block !important;
  }
}

/* Topnav blu (stesso tono area clienti) */
.hpm-admin-topnav {
  background: #1a4d80;
  margin: 0;
  padding: 0;
  border: 0;
  position: relative;
  /* Sopra #header (99) e soprattutto sopra .dropdown-backdrop BS3 (~990) */
  z-index: 1000;
}

/* BS3 su touch: backdrop sopra il menu mangia i tap sulle sottovoci */
body.hpm-admin-topnav .dropdown-backdrop {
  display: none !important;
  pointer-events: none !important;
}

/* Desktop: barra sempre visibile anche con classe collapse BS3 */
@media (min-width: 992px) {
  .hpm-admin-topnav.collapse {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    visibility: visible !important;
  }
}

.hpm-admin-topnav-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  padding: 0 12px;
  box-sizing: border-box;
}

.hpm-admin-topnav-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  flex: 0 1 auto;
  float: none !important;
}

.hpm-admin-topnav-nav.navbar-nav > li {
  float: none !important;
}

.hpm-admin-topnav-nav.navbar-nav > li > a {
  height: auto !important;
}

.hpm-admin-topnav-account {
  flex: 0 0 auto;
  margin-left: auto;
}

.hpm-admin-topnav-nav > li {
  margin: 0;
  padding: 0;
  position: relative;
}

.hpm-admin-topnav-nav > li > a {
  display: block;
  padding: 12px 16px;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.hpm-admin-topnav-nav > li > a:hover,
.hpm-admin-topnav-nav > li > a:focus {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}

.hpm-admin-topnav-nav > li.is-active > a,
.hpm-admin-topnav-nav > li.open > a,
.hpm-admin-topnav-nav > li.is-active > a:hover,
.hpm-admin-topnav-nav > li.open > a:hover {
  background: rgba(0, 0, 0, 0.18) !important;
  color: #fff !important;
}

.hpm-admin-topnav-nav > li > a .fa-caret-down {
  margin-left: 6px;
  font-size: 12px;
}

.hpm-admin-nav-dropdown-menu,
.hpm-admin-account-menu {
  margin-top: 0 !important;
  border-radius: 4px;
  border: 1px solid #ddd;
  min-width: 220px;
  padding: 4px 0;
}

.hpm-admin-nav-dropdown-menu > li > a,
.hpm-admin-account-menu > li > a {
  color: #1a1a1a;
  padding: 8px 16px;
  font-size: 13px;
}

.hpm-admin-nav-dropdown-menu > li > a:hover,
.hpm-admin-nav-dropdown-menu > li > a:focus,
.hpm-admin-account-menu > li > a:hover,
.hpm-admin-account-menu > li > a:focus {
  background: #f3f4f6;
  color: #111;
}

/* Sottomenu (setup a destra; account/lingua a sinistra: menu sul bordo destro) */
.hpm-admin-setup-menu .dropdown-submenu,
.hpm-admin-account-menu .dropdown-submenu,
.hpm-admin-nav-dropdown-menu .dropdown-submenu {
  position: relative;
}

.hpm-admin-setup-menu .dropdown-submenu > .dropdown-menu,
.hpm-admin-nav-dropdown-menu .dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -4px;
  margin-left: 0;
  display: none;
}

/* Account in alto a destra: sottomenu Lingua apre a SINISTRA, altrimenti esce dallo schermo */
.hpm-admin-account-menu .dropdown-submenu > .dropdown-menu {
  top: 0;
  left: auto;
  right: 100%;
  margin-top: -4px;
  margin-left: 0;
  margin-right: 0;
  display: none;
}

.hpm-admin-account-menu .dropdown-submenu > a {
  position: relative;
  padding-right: 28px;
}

.hpm-admin-account-menu .dropdown-submenu > a .fa-caret-right {
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: -6px;
  float: none;
}

.hpm-admin-setup-menu .dropdown-submenu:hover > .dropdown-menu,
.hpm-admin-account-menu .dropdown-submenu:hover > .dropdown-menu,
.hpm-admin-nav-dropdown-menu .dropdown-submenu:hover > .dropdown-menu {
  display: block;
}

@media (max-width: 991px) {
  .hpm-admin-topnav-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .hpm-admin-topnav-nav {
    flex-direction: column;
    width: 100%;
    flex-wrap: nowrap;
  }

  .hpm-admin-topnav-account {
    margin-left: 0;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .hpm-admin-topnav-nav > li > a {
    padding: 12px 15px;
  }

  .hpm-admin-nav-dropdown-menu,
  .hpm-admin-account-menu {
    position: static !important;
    float: none !important;
    width: 100%;
    margin: 0 !important;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.15);
    border: 0;
    border-radius: 0;
  }

  .hpm-admin-nav-dropdown-menu > li > a,
  .hpm-admin-account-menu > li > a,
  .hpm-admin-setup-menu .dropdown-submenu > .dropdown-menu > li > a,
  .hpm-admin-account-menu .dropdown-submenu > .dropdown-menu > li > a,
  .hpm-admin-nav-dropdown-menu .dropdown-submenu > .dropdown-menu > li > a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    color: #fff;
    padding: 14px 16px 14px 28px;
    min-height: 48px;
    font-size: 15px;
    line-height: 1.4;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.25);
    position: relative;
    z-index: 2;
  }

  .hpm-admin-topnav-nav > li > a {
    min-height: 48px;
    padding: 14px 15px;
    font-size: 15px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.25);
  }

  .hpm-admin-nav-dropdown-menu > li > a:hover,
  .hpm-admin-account-menu > li > a:hover,
  .hpm-admin-nav-dropdown-menu > li > a:active,
  .hpm-admin-account-menu > li > a:active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .hpm-admin-setup-menu .dropdown-submenu > .dropdown-menu,
  .hpm-admin-account-menu .dropdown-submenu > .dropdown-menu,
  .hpm-admin-nav-dropdown-menu .dropdown-submenu > .dropdown-menu {
    position: static !important;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: none;
    border: 0;
    display: none;
  }

  .hpm-admin-setup-menu .dropdown-submenu.open > .dropdown-menu,
  .hpm-admin-account-menu .dropdown-submenu.open > .dropdown-menu,
  .hpm-admin-nav-dropdown-menu .dropdown-submenu.open > .dropdown-menu {
    display: block;
  }

  /* Dropdown aperto: resta visibile; link figli ricevono i tap */
  .hpm-admin-topnav .dropdown.open > .dropdown-menu {
    display: block !important;
  }

  .hpm-admin-topnav .dropdown-menu {
    pointer-events: auto;
  }
}

/* Scheda cliente admin: niente titolo sezione (già sul tab; absolute top:-48px Perfex spacca i tab) */
#wrapper.customer_profile .customer-profile-group-heading,
body.customer-profile .customer-profile-group-heading,
.customer-profile-group-heading {
  display: none !important;
  visibility: hidden !important;
  position: static !important;
  top: auto !important;
  left: auto !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

/* Scheda cliente admin: tab orizzontali stile WHMCS (hover stabile, no flicker BS3) */
body.customer-profile .hpm-client-tabs-wrap {
  margin: 0 0 -1px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.customer-profile .hpm-client-tabs.nav-tabs {
  display: flex;
  flex-wrap: nowrap;
  border-bottom: 1px solid #d1d5db;
  margin: 0;
  padding: 0;
  gap: 2px;
}

body.customer-profile .hpm-client-tabs > li {
  float: none;
  margin: 0 !important;
}

/*
 * Box bordo IDENTICO su tutti i tab/stati (1px × 4 lati).
 * Niente transparent / niente togliere il bordo sotto: quello causava lo sfarfallio.
 * Attivo = solo sfondo bianco.
 */
body.customer-profile .hpm-client-tabs > li > a,
body.customer-profile .hpm-client-tabs > li > a:hover,
body.customer-profile .hpm-client-tabs > li > a:focus,
body.customer-profile .hpm-client-tabs > li > a:active,
body.customer-profile .hpm-client-tabs > li.active > a,
body.customer-profile .hpm-client-tabs > li.active > a:hover,
body.customer-profile .hpm-client-tabs > li.active > a:focus,
body.customer-profile .hpm-client-tabs > li.active > a:active,
body.customer-profile .nav-tabs > li > a,
body.customer-profile .nav-tabs > li > a:hover,
body.customer-profile .nav-tabs > li > a:focus,
body.customer-profile .nav-tabs > li.active > a,
body.customer-profile .nav-tabs > li.active > a:hover,
body.customer-profile .nav-tabs > li.active > a:focus {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  margin: 0 0 -1px 0 !important;
  padding: 10px 14px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px 4px 0 0;
  background: #e5e7eb !important;
  color: #1e3a5f !important;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none !important;
  outline: none !important;
  box-shadow: none !important;
  position: relative;
  top: 0 !important;
  z-index: 1;
  transition: none !important;
  transform: none !important;
}

body.customer-profile .hpm-client-tabs > li:not(.active) > a:hover,
body.customer-profile .hpm-client-tabs > li:not(.active) > a:focus {
  background: #f3f4f6 !important;
  color: #1a4d80 !important;
}

body.customer-profile .hpm-client-tabs > li.active > a,
body.customer-profile .hpm-client-tabs > li.active > a:hover,
body.customer-profile .hpm-client-tabs > li.active > a:focus,
body.customer-profile .hpm-client-tabs > li.active > a:active,
body.customer-profile .nav-tabs > li.active > a,
body.customer-profile .nav-tabs > li.active > a:hover,
body.customer-profile .nav-tabs > li.active > a:focus {
  background: #fff !important;
  color: #111827 !important;
  z-index: 2;
  cursor: default;
}

body.customer-profile .hpm-client-panel {
  border-top-left-radius: 0;
}

body.customer-profile .hpm-client-panel > .panel-body {
  min-height: 120px;
}

/* Profilo: nasconde la barra sotto-tab se non resta nessuna voce (es. solo "Dettagli cliente" rimosso) */
body.customer-profile .panel-full-width-tabs:not(:has(.customer-profile-tabs > li)) {
  display: none !important;
}

@media (max-width: 767px) {
  body.customer-profile .hpm-client-tabs > li > a,
  body.customer-profile .hpm-client-tabs > li > a:hover,
  body.customer-profile .hpm-client-tabs > li > a:focus {
    padding: 8px 10px !important;
    font-size: 12px;
  }
}

/* —— Riepilogo cliente (stub UI stile WHMCS) —— */
body.customer-profile .hpm-client-riepilogo {
  margin-top: 5px;
}

body.customer-profile .hpm-riepilogo-panels {
  display: flex;
  flex-wrap: wrap;
}

body.customer-profile .hpm-riepilogo-panels > [class*="col-"] {
  display: flex;
  margin-bottom: 15px;
}

body.customer-profile .hpm-riepilogo-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

body.customer-profile .hpm-riepilogo-stack > .hpm-riepilogo-panel {
  min-height: 0;
  flex: 0 0 auto;
}

body.customer-profile .hpm-riepilogo-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 0;
  border: 1px solid #e5e7eb;
  box-shadow: none;
}

body.customer-profile .hpm-riepilogo-panel-heading {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 14px;
}

body.customer-profile .hpm-riepilogo-panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e5a96;
}

body.customer-profile .hpm-riepilogo-panel-body {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
}

body.customer-profile .hpm-riepilogo-kv {
  margin: 0;
  font-size: 12px;
}

body.customer-profile .hpm-riepilogo-kv > tbody > tr > td {
  padding: 6px 12px;
  border-top: none;
  vertical-align: middle;
  color: #374151;
}

body.customer-profile .hpm-riepilogo-kv > tbody > tr:nth-child(odd) > td {
  background: #f9fafb;
}

body.customer-profile .hpm-riepilogo-kv > tbody > tr:nth-child(even) > td {
  background: #fff;
}

body.customer-profile .hpm-riepilogo-panel-footer {
  margin-top: auto;
  padding: 10px 12px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.customer-profile .hpm-riepilogo-actions {
  margin: 0;
  padding: 8px 0;
}

body.customer-profile .hpm-riepilogo-actions > li {
  padding: 7px 12px;
  border-bottom: 1px solid #f3f4f6;
}

body.customer-profile .hpm-riepilogo-actions > li:last-child {
  border-bottom: none;
}

body.customer-profile .hpm-riepilogo-action {
  display: inline-block;
  color: #1e5a96;
  font-size: 12px;
  cursor: default;
  text-decoration: none;
}

body.customer-profile a.hpm-riepilogo-action {
  cursor: pointer;
}

body.customer-profile a.hpm-riepilogo-action:hover,
body.customer-profile a.hpm-riepilogo-action:focus {
  color: #123e6b;
  text-decoration: underline;
}

body.customer-profile .hpm-riepilogo-action .fa {
  width: 16px;
  margin-right: 6px;
  text-align: center;
}

body.customer-profile .hpm-riepilogo-action.text-danger,
body.customer-profile a.hpm-riepilogo-action.text-danger {
  color: #dc2626;
}

body.customer-profile a.hpm-riepilogo-action.text-danger:hover,
body.customer-profile a.hpm-riepilogo-action.text-danger:focus {
  color: #b91c1c;
}

body.customer-profile .hpm-riepilogo-list-panel {
  margin-bottom: 15px;
  border: 1px solid #e5e7eb;
  box-shadow: none;
}

body.customer-profile .hpm-riepilogo-list-heading {
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 14px;
  text-align: center;
}

body.customer-profile .hpm-riepilogo-list-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

body.customer-profile .hpm-riepilogo-list-panel > .panel-body {
  padding: 0;
}

body.customer-profile .hpm-riepilogo-list-table {
  margin: 0;
  font-size: 12px;
  table-layout: fixed;
  width: 100%;
}

/* Stesse proporzioni colonne sulle 3 liste (ID | nome | importo | ciclo | reg | next | stato | edit) */
body.customer-profile .hpm-riepilogo-list-table > thead > tr > th:nth-child(1),
body.customer-profile .hpm-riepilogo-list-table > tbody > tr > td:nth-child(1) { width: 6%; }
body.customer-profile .hpm-riepilogo-list-table > thead > tr > th:nth-child(2),
body.customer-profile .hpm-riepilogo-list-table > tbody > tr > td:nth-child(2) { width: 28%; }
body.customer-profile .hpm-riepilogo-list-table > thead > tr > th:nth-child(3),
body.customer-profile .hpm-riepilogo-list-table > tbody > tr > td:nth-child(3) { width: 12%; }
body.customer-profile .hpm-riepilogo-list-table > thead > tr > th:nth-child(4),
body.customer-profile .hpm-riepilogo-list-table > tbody > tr > td:nth-child(4) { width: 14%; }
body.customer-profile .hpm-riepilogo-list-table > thead > tr > th:nth-child(5),
body.customer-profile .hpm-riepilogo-list-table > tbody > tr > td:nth-child(5) { width: 14%; }
body.customer-profile .hpm-riepilogo-list-table > thead > tr > th:nth-child(6),
body.customer-profile .hpm-riepilogo-list-table > tbody > tr > td:nth-child(6) { width: 14%; }
body.customer-profile .hpm-riepilogo-list-table > thead > tr > th:nth-child(7),
body.customer-profile .hpm-riepilogo-list-table > tbody > tr > td:nth-child(7) { width: 8%; }
body.customer-profile .hpm-riepilogo-list-table > thead > tr > th:nth-child(8),
body.customer-profile .hpm-riepilogo-list-table > tbody > tr > td:nth-child(8) { width: 4%; }

body.customer-profile .hpm-riepilogo-list-table > thead > tr > th {
  background: #1e5a96;
  color: #fff;
  border: none;
  padding: 8px 10px;
  font-weight: 600;
  white-space: nowrap;
}

body.customer-profile .hpm-riepilogo-list-table > tbody > tr > td {
  padding: 8px 10px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 991px) {
  body.customer-profile .hpm-riepilogo-panels {
    display: block;
  }

  body.customer-profile .hpm-riepilogo-panels > [class*="col-"] {
    display: block;
  }
}

/* —— Dashboard admin HPM (4 box allineati, colonna 320px) —— */
.hpm-dashboard .hpm-dash-panels {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.hpm-dashboard .hpm-dash-panels > [class*="col-"] {
  display: flex;
  margin-bottom: 15px;
  height: 320px;
  min-height: 320px;
  max-height: 320px;
}

.hpm-dashboard .hpm-dash-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.hpm-dashboard .hpm-dash-stack > .hpm-dash-panel--stats {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  max-height: none;
}

.hpm-dashboard .hpm-dash-stack > .hpm-dash-panel--assigned {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
}

.hpm-dashboard .hpm-dash-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  margin-bottom: 0;
  border: 1px solid #e5e7eb;
  box-shadow: none;
  overflow: hidden;
}

.hpm-dashboard .hpm-dash-panel-heading {
  flex: 0 0 auto;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 14px;
}

.hpm-dashboard .hpm-dash-panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e5a96;
}

.hpm-dashboard .hpm-dash-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hpm-dashboard .hpm-dash-panel-body--kv,
.hpm-dashboard .hpm-dash-panel-body--list {
  padding: 0;
}

.hpm-dashboard .hpm-dash-panel-body--invoices {
  padding: 0;
  gap: 0;
}

/* Fatture: 3 colonne periodo (altezza pannello invariata 320px) */
.hpm-dashboard .hpm-dash-inv-periods {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.hpm-dashboard .hpm-dash-inv-period {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e7eb;
  overflow: hidden;
}

.hpm-dashboard .hpm-dash-inv-period:last-child {
  border-right: 0;
}

.hpm-dashboard .hpm-dash-inv-period-title {
  flex: 0 0 auto;
  padding: 6px 8px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #1e5a96;
  line-height: 1.2;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

.hpm-dashboard .hpm-dash-inv-period .hpm-dash-inv-table {
  flex: 1 1 auto;
  margin: 0;
}

.hpm-dashboard .hpm-dash-inv-period .hpm-dash-inv-table > tbody > tr > td {
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1.25;
  vertical-align: middle;
}

/* In colonna stretta: label sopra, importo sotto */
.hpm-dashboard .hpm-dash-inv-period .hpm-dash-inv-table > tbody > tr {
  display: flex;
  flex-direction: column;
}

.hpm-dashboard .hpm-dash-inv-period .hpm-dash-inv-table > tbody > tr > td {
  display: block;
  width: 100%;
  text-align: left !important;
  border-top: 0;
}

.hpm-dashboard .hpm-dash-inv-period .hpm-dash-inv-table > tbody > tr > td.text-right {
  padding-top: 0;
  padding-bottom: 6px;
  font-size: 12px;
}

.hpm-dashboard .hpm-dash-inv-period .hpm-dash-inv-table > tbody > tr:nth-child(odd) {
  background: #f8fafc;
}

.hpm-dashboard .hpm-dash-inv-period .hpm-dash-inv-table > tbody > tr:nth-child(even) {
  background: #fff;
}

.hpm-dashboard .hpm-dash-inv-table {
  margin: 0;
}

/* Fatture: stessa tipografia/grassetto delle voci, solo senza “biscotti” */
.hpm-dashboard .hpm-dash-inv-table > tbody > tr > td {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.hpm-dashboard .hpm-dash-inv-table a.hpm-dash-kv-link {
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.hpm-dashboard .hpm-dash-inv-table a.hpm-dash-kv-link:hover {
  text-decoration: underline;
}

.hpm-dashboard .hpm-dash-inv-table a.hpm-dash-kv-link.text-danger,
.hpm-dashboard .hpm-dash-inv-table .text-danger {
  color: #fc2d42;
}

.hpm-dashboard .hpm-dash-inv-table a.hpm-dash-kv-link.text-success,
.hpm-dashboard .hpm-dash-inv-table .text-success {
  color: #84c529;
}

.hpm-dashboard .hpm-dash-inv-table a.hpm-dash-kv-link.text-warning,
.hpm-dashboard .hpm-dash-inv-table .text-warning {
  color: #ff6f00;
}

.hpm-dashboard .hpm-dash-inv-table a.hpm-dash-kv-link.hpm-dash-kv-num,
.hpm-dashboard .hpm-dash-inv-table .hpm-dash-kv-num {
  color: #0f172a;
  font-weight: 700;
}

.hpm-dashboard .hpm-dash-inv-pct {
  font-size: 12px;
  font-weight: 700;
  color: inherit;
}

.hpm-dashboard .hpm-dash-inv-section {
  flex: 0 0 auto;
  border-top: 1px solid #e5e7eb;
}

.hpm-dashboard .hpm-dash-inv-section-title {
  padding: 8px 12px 4px;
  font-size: 12px;
  font-weight: 700;
  color: #1e5a96;
}

/* Network: meno aria tra label pannello e intestazione tabella */
.hpm-dashboard .hpm-dash-panel-body:has(.hpm-dash-network-wrap) {
  padding: 4px 10px 8px;
}

/* Attività Sistema: feed Perfex (pallini + timeline) compatto in 320px */
.hpm-dashboard .hpm-dash-panel-body--activity {
  padding: 6px 10px 8px 4px;
  overflow: hidden;
}

.hpm-dashboard .hpm-dash-activity-feed {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding-left: 8px;
}

.hpm-dashboard .hpm-dash-activity-feed.activity-feed .feed-item {
  padding-bottom: 10px;
  padding-left: 22px;
  margin-left: 8px;
}

.hpm-dashboard .hpm-dash-activity-feed.activity-feed .feed-item .date {
  font-size: 10px;
  margin-bottom: 2px;
}

.hpm-dashboard .hpm-dash-activity-feed.activity-feed .feed-item .text {
  font-size: 11px;
  line-height: 1.35;
  padding-left: 0;
}

/* Riga 2+3: stack sinistra + calendario alto quanto 320+gap+160 */
.hpm-dashboard .hpm-dash-panels--lower {
  align-items: flex-start;
}

.hpm-dashboard .hpm-dash-panels--lower > [class*="col-"] {
  height: auto;
  min-height: 0;
  max-height: none;
}

.hpm-dashboard .hpm-dash-left-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.hpm-dashboard .hpm-dash-panels--half > [class*="col-"] {
  height: 160px;
  min-height: 160px;
  max-height: 160px;
}

.hpm-dashboard .hpm-dash-panel--half {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.hpm-dashboard .hpm-dash-panel--half .hpm-dash-panel-body--kv {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hpm-dashboard .hpm-dash-col-calendar {
  height: 510px !important;
  min-height: 510px !important;
  max-height: 510px !important;
  display: flex;
  overflow: hidden;
}

.hpm-dashboard .hpm-dash-panel--calendar {
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden;
}

/* Calendario: area scrollabile */
.hpm-dashboard .hpm-dash-panel-body--calendar {
  padding: 4px 8px 8px;
}

.hpm-dashboard .hpm-dash-calendar-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.hpm-dashboard .hpm-dash-calendar-wrap .fc {
  font-size: 11px;
}

.hpm-dashboard .hpm-dash-calendar-wrap .fc .fc-toolbar {
  margin-bottom: 0.4em;
}

.hpm-dashboard .hpm-dash-calendar-wrap .fc .fc-toolbar-title {
  font-size: 1.1em;
}

.hpm-dashboard .hpm-dash-placeholder {
  margin: 0;
  font-size: 12px;
  padding: 10px 12px;
}

.hpm-dashboard .hpm-dash-kv {
  margin: 0;
  font-size: 12px;
}

.hpm-dashboard .hpm-dash-kv > tbody > tr > td {
  padding: 6px 12px;
  border-top: none;
  vertical-align: middle;
  color: #374151;
}

.hpm-dashboard .hpm-dash-kv > tbody > tr:nth-child(odd) > td {
  background: #f9fafb;
}

.hpm-dashboard .hpm-dash-kv > tbody > tr:nth-child(even) > td {
  background: #fff;
}

.hpm-dashboard .hpm-dash-kv-link {
  color: inherit;
  text-decoration: none;
}

.hpm-dashboard .hpm-dash-kv-link:hover {
  color: #1e5a96;
  text-decoration: underline;
}

.hpm-dashboard .hpm-dash-kv-link.text-success {
  color: #84c529;
}

.hpm-dashboard .hpm-dash-kv-link.text-danger {
  color: #fc2d42;
}

.hpm-dashboard .hpm-dash-kv-link.text-info {
  color: #03a9f4;
}

.hpm-dashboard .hpm-dash-kv-link.text-warning {
  color: #ff6f00;
}

.hpm-dashboard .hpm-dash-kv-link.text-muted {
  color: #64748b;
}

.hpm-dashboard .hpm-dash-kv-link.text-success:hover,
.hpm-dashboard .hpm-dash-kv-link.text-danger:hover,
.hpm-dashboard .hpm-dash-kv-link.text-info:hover,
.hpm-dashboard .hpm-dash-kv-link.text-warning:hover,
.hpm-dashboard .hpm-dash-kv-link.text-muted:hover {
  text-decoration: underline;
}

.hpm-dashboard .hpm-dash-kv-num {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hpm-dashboard .hpm-dash-kv > tbody > tr.hpm-dash-kv-spacer > td {
  padding-top: 10px;
  padding-bottom: 10px;
  background: #fff !important;
  line-height: 1;
  border-top: none;
}

.hpm-dashboard .hpm-dash-assigned {
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hpm-dashboard .hpm-dash-assigned > li {
  border-bottom: 1px solid #f3f4f6;
}

.hpm-dashboard .hpm-dash-assigned > li:last-child {
  border-bottom: none;
}

.hpm-dashboard .hpm-dash-assigned-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  padding: 7px 12px;
  font-size: 12px;
  color: #1e5a96;
  text-decoration: none;
}

.hpm-dashboard .hpm-dash-assigned-link:hover {
  background: #f9fafb;
  text-decoration: none;
}

.hpm-dashboard .hpm-dash-assigned-id {
  font-weight: 700;
  flex: 0 0 auto;
}

.hpm-dashboard .hpm-dash-assigned-subj {
  flex: 1 1 120px;
  min-width: 0;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hpm-dashboard .hpm-dash-assigned-status {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 11px;
  color: #64748b;
}

.hpm-dashboard .hpm-dash-network-wrap {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hpm-dashboard .hpm-dash-network-table {
  font-size: 12px;
  margin-bottom: 0;
}

.hpm-dashboard .hpm-dash-network-table > thead > tr > th,
.hpm-dashboard .hpm-dash-network-table > tbody > tr > td {
  padding: 4px 6px;
  vertical-align: middle;
  border-top: 1px solid #f0f0f0;
}

.hpm-dashboard .hpm-dash-network-table > thead > tr > th {
  border-top: 0;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  padding-top: 2px;
  padding-bottom: 4px;
}

.hpm-dashboard .hpm-dash-net-name {
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

.hpm-dashboard .hpm-dash-net-load {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #334155;
}

.hpm-dashboard .hpm-dash-net-status .label {
  font-size: 10px;
  font-weight: 600;
}

@media (max-width: 991px) {
  .hpm-dashboard .hpm-dash-panels {
    display: block;
  }

  .hpm-dashboard .hpm-dash-panels > [class*="col-"] {
    display: block;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .hpm-dashboard .hpm-dash-stack {
    height: 320px;
  }

  .hpm-dashboard .hpm-dash-panel:not(.hpm-dash-panel--stats):not(.hpm-dash-panel--assigned):not(.hpm-dash-panel--half):not(.hpm-dash-panel--calendar) {
    height: 320px;
  }

  .hpm-dashboard .hpm-dash-panels--half > [class*="col-"] {
    height: 160px;
    min-height: 160px;
    max-height: 160px;
  }

  .hpm-dashboard .hpm-dash-col-calendar {
    height: 320px;
    min-height: 320px;
    max-height: 320px;
  }
}

/* Vista pubblica preventivo: pagina su bianco (niente grigio attorno al documento) */
body.viewestimate,
body.viewestimate #wrapper {
  background: #fff;
}

/* Admin preventivo: menu «Più» voci su una riga */
.hpm-estimate-more-menu {
  min-width: 220px;
}
.hpm-estimate-more-menu > li > a {
  white-space: nowrap;
}

/* Admin preventivo: menu «Converti a fattura» */
.hpm-estimate-convert-menu {
  min-width: 200px;
}
.hpm-estimate-convert-menu > li > a {
  white-space: nowrap;
}

/* Admin fattura: menu «Più» voci su una riga */
.hpm-invoice-more-menu {
  min-width: 220px;
}
.hpm-invoice-more-menu > li > a {
  white-space: nowrap;
}
