/* Alea Commerce Manager - Override e responsive */

/* Ospite (login): la sidebar del tema può ignorare .d-none — forziamo layout a pannello unico */
body.acm-shell-guest .sidebar,
body.acm-shell-guest .sidebar-offcanvas,
body.acm-shell-guest #sidebar {
  display: none !important;
}
body.acm-shell-guest .footer {
  display: none !important;
}
body.acm-shell-guest .main-panel {
  width: 100% !important;
  margin-left: 0 !important;
}

/* ========== Header / Navbar ========== */
.acm-toast-wrap {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acm-toast {
  min-width: 220px;
  max-width: 420px;
  background: #1f2937;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}
.acm-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.acm-toast-success { background: #14532d; }
.acm-toast-warning { background: #9a3412; }
.acm-toast-danger { background: #991b1b; }

.navbar .navbar-brand-wrapper {
  width: 280px !important;
  min-width: 200px;
}
.navbar .navbar-brand-wrapper .navbar-brand.brand-logo {
  width: 100% !important;
  font-size: 1.1rem !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 1.5rem !important;
}
.navbar .navbar-brand-wrapper .navbar-brand.brand-logo-mini {
  font-size: 1rem !important;
}
.navbar .navbar-menu-wrapper {
  width: calc(100% - 280px) !important;
}

/* Sidebar ridotta - brand più stretto */
.sidebar-mini .navbar .navbar-brand-wrapper {
  width: 75px !important;
}
.sidebar-mini .navbar .navbar-menu-wrapper {
  width: calc(100% - 75px) !important;
}

/* ========== Sidebar - Allineamento menu (icona + testo vicini) ========== */
.sidebar .nav .nav-item .nav-link {
  justify-content: flex-start;
  gap: 0.75rem;
}
.sidebar .nav .nav-item .nav-link i.menu-icon {
  margin-left: 0 !important;
  flex-shrink: 0;
}

/* ========== Card Dashboard - Responsive ========== */
.row.grid-margin {
  margin-bottom: 1.5rem;
}
.stretch-card {
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .stretch-card,
  .col-md-4.stretch-card {
    margin-bottom: 1rem;
  }
}

/* ========== Layout generale responsive ========== */
@media (max-width: 991px) {
  .navbar .navbar-brand-wrapper {
    width: auto !important;
    min-width: 120px;
  }
  .navbar .navbar-brand-wrapper .navbar-brand.brand-logo {
    font-size: 1rem !important;
    max-width: 140px;
  }
  .search-field .text-white {
    display: none !important;
  }
  .content-wrapper {
    padding: 1rem !important;
  }
}

@media (max-width: 576px) {
  .navbar .navbar-brand-wrapper .navbar-brand.brand-logo {
    font-size: 0.9rem !important;
    max-width: 110px;
  }
  .page-header .page-title {
    font-size: 1.25rem !important;
  }
  .card-body h2,
  .card-body h4 {
    font-size: 1.25rem !important;
  }
}

/* ========== Footer ========== */
.footer {
  padding: 1rem 1.5rem !important;
}
.footer span {
  font-size: 0.8rem;
}

/* ========== Tabelle responsive ========== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  .table {
    font-size: 0.85rem;
  }
  .table th,
  .table td {
    padding: 0.5rem !important;
  }
}

/* ========== Content area ========== */
.content-wrapper {
  min-height: calc(100vh - 180px);
}
#content .row {
  margin-bottom: 1.5rem;
}

/* ========== Utility ========== */
.nav-link[data-view] {
  cursor: pointer;
}
.nav-link[data-view].active {
  background: rgba(255, 255, 255, 0.1);
}
.page-link {
  cursor: pointer;
}

/* Filtri ordini responsive */
#orders-filter-form .col-auto {
  min-width: 120px;
}
@media (max-width: 768px) {
  #orders-filter-form .col-auto.flex-grow-1 {
    min-width: 100%;
  }
}

/* Mobile polish specifico: filtri ordini */
@media (max-width: 767.98px) {
  #orders-filter-form {
    row-gap: 0.6rem !important;
  }
  #orders-filter-form .col-auto,
  #orders-filter-form .col-auto.flex-grow-1 {
    min-width: 100% !important;
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }
  #orders-filter-form .form-label.small {
    margin-bottom: 0.22rem !important;
    font-size: 0.78rem;
  }
  #orders-filter-form .form-control,
  #orders-filter-form .form-select {
    width: 100%;
    min-height: 38px;
  }
  #orders-filter-form #filter-after,
  #orders-filter-form #filter-before {
    min-width: 100% !important;
  }
  #orders-filter-form #filter-search-order {
    min-width: 100% !important;
  }
  #orders-filter-form .btn {
    min-height: 38px;
  }
  #orders-filter-form #filter-reset {
    margin-left: 0 !important;
    margin-top: 0.45rem;
  }
}

/* Filtri prodotti e clienti responsive */
#products-filter-form .col-auto,
#customers-filter-form .col-auto {
  min-width: 120px;
}
@media (max-width: 768px) {
  #products-filter-form .col-auto.flex-grow-1,
  #customers-filter-form .col-auto.flex-grow-1 {
    min-width: 100%;
  }
}

/* Fix overflow header su schermi piccoli */
@media (max-width: 400px) {
  .navbar .navbar-brand-wrapper .navbar-brand.brand-logo {
    font-size: 0.85rem !important;
    max-width: 90px;
  }
}

/* ========== Scheda prodotto — galleria ========== */
.product-detail-gallery .product-main-img-wrap {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 0.25rem;
}
.product-detail-gallery .product-thumb.active img {
  outline: 2px solid #4b49ac;
  outline-offset: 2px;
}
.product-detail-gallery .product-thumb img {
  cursor: pointer;
}
.product-desc-scroll {
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.product-desc-scroll--short {
  max-height: 120px;
}

/* Anteprima descrizioni (HTML da WooCommerce) */
.prod-desc-preview {
  font-size: 0.95rem;
  line-height: 1.5;
}
.prod-desc-preview img {
  max-width: 100%;
  height: auto;
}
.prod-desc-preview h1,
.prod-desc-preview h2,
.prod-desc-preview h3 {
  font-size: 1.1rem;
  margin-top: 0.75rem;
}

/* Quill nella scheda prodotto */
.product-quill-wrap {
  background: #fff;
}
.product-quill-wrap .ql-toolbar {
  border-top-left-radius: 0.25rem;
  border-top-right-radius: 0.25rem;
  border-color: #dee2e6;
}
.product-quill-wrap .ql-container {
  border-bottom-left-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
  border-color: #dee2e6;
  font-family: inherit;
  font-size: 0.95rem;
}
.product-quill-wrap--short .ql-editor {
  min-height: 100px;
}
.product-quill-wrap--long .ql-editor {
  min-height: 260px;
}

/* ========== Coerenza tema Connect Plus (public/assets/css/style.css) ==========
   Stessi gradienti, bordi e tipografia del template nella cartella assets. */

:root {
  --acm-primary: #b66dff;
  --acm-primary-deep: #9a55ff;
  --acm-shadow-card: 0 0.25rem 1rem rgba(154, 85, 255, 0.08);
}

#content .card {
  box-shadow: var(--acm-shadow-card);
  border: 1px solid rgba(231, 222, 233, 0.9);
  border-radius: 5px;
}

#content .card .card-title {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 0.65rem;
  margin-bottom: 1rem;
  font-family: "ubuntu-medium", sans-serif;
  color: #343a40;
}

#content .card .card-description {
  line-height: 1.55;
}

/* Schede riepilogo prodotto in evidenza */
#content .acm-card-highlight {
  border-left: 4px solid #b66dff;
}

/* Form modifica / crea prodotto — barra superiore come btn-gradient-primary */
#content .acm-card-form .card-body {
  background-image: linear-gradient(to right, #da8cff, #9a55ff), linear-gradient(#fff, #fff);
  background-size: 100% 3px, 100% 100%;
  background-position: top left, 0 3px;
  background-repeat: no-repeat;
  padding-top: 2rem;
}

/* Indietro nelle pagine dettaglio */
.acm-page-back {
  width: 38px;
  height: 38px;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 8px !important;
  line-height: 1;
}
.acm-page-back:hover {
  border-color: #b66dff !important;
  color: #9a55ff !important;
}

.acm-icon-inline {
  font-size: 0.9em;
  vertical-align: -0.06em;
}

.acm-external-link {
  font-weight: 500;
}

#content .form-label.small {
  font-weight: 500;
  color: #5a5a5a;
  margin-bottom: 0.3rem;
}

#content .form-control:focus,
#content .form-select:focus {
  border-color: rgba(182, 109, 255, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(182, 109, 255, 0.12);
}

/* Pannelli secondari (upload immagini, ecc.) */
.acm-subpanel {
  padding: 1.25rem 1.35rem !important;
  background: #fff !important;
  border: 1px solid #e3dcec !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 12px rgba(154, 85, 255, 0.06);
}

/* —— Galleria: layout a due colonne (tema) —— */
.acm-media-panel__head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(182, 109, 255, 0.15);
}

.acm-media-panel__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(218, 140, 255, 0.25), rgba(154, 85, 255, 0.15));
  color: #7b4dc4;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.acm-media-panel__title {
  font-family: "ubuntu-medium", sans-serif;
  font-size: 1rem;
  color: #343a40;
  margin: 0 0 0.2rem 0;
}

.acm-media-panel__hint {
  line-height: 1.45;
}

.acm-media-panel__cols {
  margin-top: 0.25rem;
}

.acm-media-col {
  padding: 1rem 1.1rem 1.1rem;
}

@media (min-width: 768px) {
  .acm-media-col--upload {
    padding-right: 1.5rem;
  }
  .acm-media-col--url {
    border-left: 1px solid rgba(182, 109, 255, 0.18);
    padding-left: 1.5rem;
  }
}

.acm-media-col__badge {
  display: inline-block;
  font-size: 0.68rem;
  font-family: "ubuntu-medium", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #765d8c;
  background: rgba(182, 109, 255, 0.1);
  padding: 0.28rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.acm-file-input.form-control {
  padding: 0.4rem 0.65rem;
  border-style: dashed;
  border-color: #d4c6e2;
  background: #fcfbfe;
}

.acm-file-input:hover {
  border-color: #b66dff;
  background: #faf7ff;
}

.acm-code-textarea,
.acm-code-editor {
  font-size: 0.8125rem !important;
  line-height: 1.45 !important;
  border-color: #ddd5e8 !important;
  background: #faf8fc !important;
  border-radius: 8px !important;
  resize: vertical;
}

.acm-code-editor {
  min-height: 180px;
  tab-size: 2;
}

/* Meta JSON blocco */
.acm-json-field {
  margin-top: 0.25rem;
  padding: 1.15rem 1.25rem;
  background: linear-gradient(180deg, #fff 0%, #faf8fc 100%);
  border: 1px solid #e8e0ef;
  border-radius: 10px;
  border-left: 4px solid rgba(182, 109, 255, 0.45);
}

.acm-json-field__label {
  display: block;
  font-family: "ubuntu-medium", sans-serif;
  font-size: 0.9rem;
  color: #4a3d5c;
  margin-bottom: 0.35rem;
}

.acm-json-field__help {
  color: #6c757d;
  margin-bottom: 0.65rem !important;
  line-height: 1.5;
}

.acm-json-field__help code {
  font-size: 0.78em;
  color: #9a55ff;
  background: rgba(154, 85, 255, 0.08);
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
}

/* Azioni salva */
.acm-save-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 0.5rem;
  padding: 1.15rem 0 0.5rem;
  border-top: 1px solid rgba(182, 109, 255, 0.12);
}

.acm-save-bar__msg {
  flex: 1 1 200px;
  margin: 0 !important;
}

.acm-inline-feedback {
  display: block;
  margin-top: 0.45rem;
  width: 100%;
}

/* Meta / dati aggiuntivi (liste chiave-valore) */
.acm-meta-kv {
  max-height: 260px;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
  background: #faf8fc;
  border: 1px solid #ede8f0;
  border-radius: 6px;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.acm-meta-row {
  display: grid;
  grid-template-columns: minmax(96px, 36%) 1fr;
  gap: 0.4rem 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  align-items: start;
}

.acm-meta-row:last-child {
  border-bottom: 0;
}

.acm-meta-key {
  font-family: "ubuntu-medium", sans-serif;
  color: #765d8c;
  font-size: 0.78rem;
  word-break: break-all;
}

.acm-meta-val {
  color: #333;
  word-break: break-word;
}

.acm-table-wrap {
  border-radius: 6px;
  border: 1px solid #ede8f0;
  overflow: hidden;
}

#content .acm-table thead th {
  background: linear-gradient(to right, rgba(218, 140, 255, 0.12), rgba(154, 85, 255, 0.08));
  color: #4a3d5c;
  font-family: "ubuntu-medium", sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid rgba(182, 109, 255, 0.28);
  padding: 0.65rem 0.75rem;
  white-space: nowrap;
}

#content .acm-table tbody td {
  padding: 0.55rem 0.75rem;
  vertical-align: middle;
}

#content .acm-table tbody tr:hover {
  background-color: rgba(154, 85, 255, 0.045);
}

/* Zona eliminazione prodotto */
.acm-danger-zone {
  margin-top: 1.5rem;
  padding: 1.25rem 1.35rem 1.15rem;
  background: linear-gradient(165deg, rgba(254, 124, 150, 0.1) 0%, rgba(255, 255, 255, 0.95) 55%, #fff 100%);
  border: 1px solid rgba(254, 124, 150, 0.45);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 4px 18px rgba(254, 124, 150, 0.08);
}

.acm-danger-zone__header {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.acm-danger-zone__icon {
  font-size: 1.75rem;
  color: #fe7c96;
  line-height: 1;
  flex-shrink: 0;
}

.acm-danger-zone__title {
  color: #a12c47;
  font-size: 0.95rem;
  font-family: "ubuntu-medium", sans-serif;
}

.acm-danger-zone__subtitle {
  color: #8e5868;
  margin-top: 0.2rem !important;
  line-height: 1.45;
  max-width: 40rem;
}

.acm-danger-zone__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
}

.acm-danger-zone__force {
  margin: 0 !important;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 6px;
  border: 1px solid rgba(254, 124, 150, 0.25);
}

.acm-danger-zone__force .form-check-label {
  color: #7a3d4d;
  cursor: pointer;
}

.acm-danger-zone__feedback:empty {
  display: none !important;
}

/* Galleria */
.product-detail-gallery .product-main-img-wrap {
  background: linear-gradient(155deg, #faf8fc 0%, #f2edf3 100%);
  border: 1px solid #e7dee9;
  border-radius: 8px;
}

.product-detail-gallery .product-thumb.active img {
  outline: 2px solid #9a55ff;
  outline-offset: 2px;
}

.product-quill-wrap {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e7dee9;
}

.product-quill-wrap .ql-toolbar {
  background: #faf8fc;
  border-color: #e7dee9 !important;
}

.product-quill-wrap .ql-container {
  border-color: #e7dee9 !important;
}

.product-quill-wrap .ql-toolbar button:hover .ql-stroke,
.product-quill-wrap .ql-toolbar button.ql-active .ql-stroke {
  stroke: #9a55ff;
}

.product-quill-wrap .ql-toolbar button:hover .ql-fill,
.product-quill-wrap .ql-toolbar button.ql-active .ql-fill {
  fill: #9a55ff;
}

#content .card hr,
#content hr.my-1 {
  border-color: rgba(182, 109, 255, 0.15);
  opacity: 1;
}

.page-header .page-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.acm-product-page .stretch-card,
.acm-entity-page .stretch-card {
  margin-bottom: 1.25rem;
}

.prod-desc-preview {
  border-color: #e7dee9 !important;
  border-radius: 8px;
}

/* Liste ordini / prodotti / clienti: card filtri */
#content .card .card-body.py-3 {
  padding-top: 1.25rem !important;
  padding-bottom: 1.25rem !important;
}

@media (max-width: 576px) {
  .acm-meta-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .acm-meta-key {
    font-size: 0.72rem;
    opacity: 0.9;
  }
}

/* Picker categorie / tag (prodotto) */
.acm-taxonomy-chips .acm-chip {
  display: inline-flex;
  align-items: center;
}
.acm-taxonomy-dd {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 40;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 2px;
  background: #fff;
  border: 1px solid rgba(182, 109, 255, 0.25);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.acm-taxonomy-dd__item:hover {
  background: rgba(154, 85, 255, 0.08);
}

/* Editor magazzino (griglia bulk) */
.acm-bulk-editor-card .form-check-label {
  cursor: pointer;
}

.acm-bulk-table-card {
  border-radius: 12px;
  overflow: hidden;
}

.acm-bulk-table-scroll {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.acm-bulk-grid {
  --acm-bulk-border: #e8e6ef;
  --acm-bulk-header-bg: #f3f0f8;
  --acm-bulk-header-text: #3d3550;
  --acm-bulk-input-bg: #ffffff;
  --acm-bulk-input-border: #d4cfe0;
  --acm-bulk-locked-bg: #f1f3f7;
  --acm-bulk-accent: #5c6bc0;
}

.acm-bulk-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--acm-bulk-header-bg);
  color: var(--acm-bulk-header-text);
  box-shadow: 0 1px 0 var(--acm-bulk-border);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  white-space: nowrap;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--acm-bulk-border);
}

.acm-bulk-grid .acm-bulk-th-check {
  width: 42px;
  text-align: center;
  vertical-align: middle;
}

.acm-bulk-th-id {
  min-width: 4.5rem;
}
.acm-bulk-th-img {
  width: 52px;
}
.acm-bulk-th-title {
  min-width: 200px;
}
.acm-bulk-th-type {
  min-width: 5.5rem;
}
.acm-bulk-th-status {
  min-width: 9.75rem;
}
.acm-bulk-th-num {
  min-width: 5.5rem;
}
.acm-bulk-th-sku {
  min-width: 6.5rem;
}
.acm-bulk-th-center {
  width: 4.25rem;
  text-align: center;
}
.acm-bulk-th-qty {
  min-width: 4.5rem;
}
.acm-bulk-th-avail {
  min-width: 10.5rem;
}
.acm-bulk-th-actions {
  min-width: 5.5rem;
}

.acm-bulk-grid > tbody > tr > td {
  vertical-align: middle;
  padding: 0.65rem 0.65rem;
  border-color: var(--acm-bulk-border);
}

.acm-bulk-grid > tbody > tr:hover > td {
  background: rgba(154, 85, 255, 0.035);
}

.acm-bulk-td--check {
  text-align: center;
}

.acm-bulk-td--thumb {
  width: 52px;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.acm-bulk-thumb {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--acm-bulk-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.acm-bulk-td--title .acm-bulk-name {
  min-width: 180px;
  max-width: 320px;
}

.acm-bulk-type-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.acm-bulk-type-badge--simple {
  color: #2e7d32;
  background: rgba(46, 125, 50, 0.08);
  border-color: rgba(46, 125, 50, 0.25);
}

.acm-bulk-type-badge--variable {
  color: var(--acm-bulk-accent);
  background: rgba(92, 107, 192, 0.1);
  border-color: rgba(92, 107, 192, 0.35);
}

.acm-bulk-type-badge--other {
  color: #5c5866;
  background: #f0eef5;
  border-color: #d8d3e4;
}

/* Campi editabili: bordo visibile e focus */
.acm-bulk-grid .acm-bulk-input:not(:disabled) {
  background: var(--acm-bulk-input-bg);
  border: 1px solid var(--acm-bulk-input-border);
  border-radius: 6px;
  min-height: 32px;
  font-size: 0.8125rem;
}

.acm-bulk-grid .acm-bulk-input:not(:disabled):focus {
  border-color: rgba(154, 85, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(154, 85, 255, 0.12);
  outline: none;
}

/* Campi non applicabili (padre variabile, ecc.): blocco grigio coerente */
.acm-bulk-grid .acm-bulk-input:disabled,
.acm-bulk-grid select.acm-bulk-input:disabled {
  background: var(--acm-bulk-locked-bg) !important;
  border-color: #dde1e9 !important;
  color: #64748b;
  cursor: not-allowed;
  opacity: 1;
}

.acm-bulk-grid .acm-bulk-status:not(:disabled),
.acm-bulk-grid .acm-bulk-stock-status:not(:disabled) {
  padding-right: 1.75rem;
  background-position: right 0.4rem center;
}

.acm-bulk-row--parent {
  background: linear-gradient(90deg, rgba(92, 107, 192, 0.07) 0%, rgba(255, 255, 255, 0) 48%);
}

.acm-bulk-row--parent > td {
  border-top: 1px solid rgba(92, 107, 192, 0.15);
}

.acm-bulk-row--variation {
  background: rgba(248, 249, 252, 0.95);
}

.acm-bulk-row--variation > td:nth-child(4) {
  padding-left: 1.1rem;
  box-shadow: inset 4px 0 0 var(--acm-bulk-accent);
}

.acm-bulk-row--dirty > td {
  background: rgba(255, 243, 205, 0.45);
}

.acm-bulk-row--dirty:hover > td {
  background: rgba(255, 236, 179, 0.55);
}

.acm-bulk-actions .acm-bulk-action-btn {
  padding: 0.25rem 0.4rem;
  line-height: 1;
  border-radius: 6px;
  border-color: var(--acm-bulk-border);
  color: #5a5268;
}

.acm-bulk-actions .acm-bulk-action-btn:hover {
  background: rgba(154, 85, 255, 0.08);
  border-color: rgba(154, 85, 255, 0.35);
  color: #6b21a8;
}

.acm-bulk-footer-bar {
  background: #faf9fc;
  padding-top: 0.85rem !important;
  padding-bottom: 0.85rem !important;
}

.acm-bulk-footer-meta {
  color: #5a5268;
}

/* Paginazione: allineamento e pulsanti uniformi */
.acm-bulk-pagination__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
}

.acm-bulk-pagination .page-link {
  min-width: 2.35rem;
  text-align: center;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
  border-color: var(--acm-bulk-border);
  color: #4a4458;
}

.acm-bulk-pagination .page-item.active .page-link {
  background: var(--acm-bulk-accent);
  border-color: var(--acm-bulk-accent);
  color: #fff;
}

.acm-bulk-pagination__ellipsis .page-link {
  min-width: 2rem;
  border: none;
  background: transparent;
  color: #94a3b8;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

/* Popup creazione ordine offline */
.acm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 30, 0.45);
  z-index: 1060;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 2rem 1rem;
}

.acm-modal-card {
  width: min(1060px, 98vw);
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(182, 109, 255, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  padding: 1rem;
}

#offline-lines-wrap .off-line-suggestions {
  max-height: 180px;
  overflow-y: auto;
}

#offline-lines-wrap .off-line-suggestions .btn-link {
  color: #4b5563;
  text-decoration: none;
}

#offline-lines-wrap .off-line-suggestions .btn-link:hover {
  background: rgba(154, 85, 255, 0.08);
}

.acm-customer-results {
  border: 1px solid #e6ddf2;
  border-radius: 8px;
  max-height: 180px;
  overflow-y: auto;
  background: #fff;
}

.acm-customer-results__empty {
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
  color: #7a7a8d;
}

.acm-customer-result-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid #f0ebf8;
}

.acm-customer-result-item:last-child {
  border-bottom: 0;
}

.acm-customer-result-item:hover {
  background: rgba(154, 85, 255, 0.08);
}

.acm-customer-result-item__name {
  display: block;
  font-size: 0.84rem;
  color: #2f2f45;
  font-weight: 500;
}

.acm-customer-result-item__email {
  display: block;
  font-size: 0.75rem;
  color: #7a7a8d;
}

#offline-lines-wrap .off-line-price[readonly] {
  background: #f8f6fc;
  color: #6b7280;
}

/* ==========================================================================
   MASTER VISUAL REFRESH (coerente con Connect Plus)
   ========================================================================== */

:root {
  --acm-radius-sm: 8px;
  --acm-radius-md: 12px;
  --acm-radius-lg: 16px;
  --acm-space-1: 8px;
  --acm-space-2: 12px;
  --acm-space-3: 16px;
  --acm-space-4: 24px;
  --acm-space-5: 32px;
  --acm-ink-1: #2f2b3d;
  --acm-ink-2: #5f5873;
  --acm-border-soft: #ece6f3;
  --acm-surface-soft: #fbf9fe;
  --acm-shadow-soft: 0 10px 28px rgba(76, 29, 149, 0.08);
  --acm-shadow-lift: 0 16px 38px rgba(76, 29, 149, 0.14);
}

body {
  background:
    radial-gradient(circle at 95% 3%, rgba(154, 85, 255, 0.07), rgba(154, 85, 255, 0) 42%),
    radial-gradient(circle at 0% 100%, rgba(218, 140, 255, 0.08), rgba(218, 140, 255, 0) 38%),
    #f5f2fa;
  color: var(--acm-ink-1);
}

/* Topbar: usa stile nativo tema (public/assets/css/style.css) */

.sidebar {
  border-right: 1px solid var(--acm-border-soft);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.7);
}

.sidebar .nav {
  padding-top: 0.4rem;
}

.sidebar .nav .nav-item .nav-link {
  margin: 0.15rem 0.65rem;
  border-radius: 10px;
  min-height: 42px;
}

.sidebar .nav .nav-item .nav-link .menu-title {
  color: #4b4360;
  font-weight: 500;
}

.sidebar .nav .nav-item .nav-link.active,
.sidebar .nav .nav-item .nav-link:hover {
  background: linear-gradient(90deg, rgba(154, 85, 255, 0.15), rgba(218, 140, 255, 0.1));
}

.main-panel .content-wrapper {
  padding: var(--acm-space-4) !important;
}

#content {
  max-width: 1520px;
}

.page-header {
  margin-bottom: 1.1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(154, 85, 255, 0.12);
}

.page-header .page-title {
  font-size: clamp(1.12rem, 0.98rem + 0.5vw, 1.55rem);
  letter-spacing: 0.01em;
}

#content .card {
  border-radius: var(--acm-radius-md);
  border-color: var(--acm-border-soft);
  box-shadow: var(--acm-shadow-soft);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

#content .card:hover {
  transform: translateY(-1px);
  box-shadow: var(--acm-shadow-lift);
}

#content .card .card-body {
  padding: 1rem 1.1rem;
}

#stats-cards .card {
  overflow: hidden;
  border: 0;
  border-radius: var(--acm-radius-lg);
}

#stats-cards .card .card-body {
  padding: 1.25rem 1.2rem 1.1rem;
}

#stats-cards h2 {
  font-size: clamp(1.55rem, 1.3rem + 1vw, 2.2rem);
  margin-bottom: 0.25rem !important;
}

#stats-cards h4 {
  opacity: 0.95;
}

.acm-table-wrap {
  border-radius: 10px;
  border-color: #e7deef;
}

#content .acm-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(3px);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

#content .acm-table tbody td {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
  color: #3b3550;
}

#content .acm-table tbody tr:nth-child(even) {
  background-color: rgba(154, 85, 255, 0.018);
}

#content .form-control,
#content .form-select {
  border-radius: var(--acm-radius-sm);
  border-color: #ddd3ea;
  min-height: 36px;
  background-color: #fff;
}

#content .form-control::placeholder {
  color: #a29ab5;
}

#content .btn {
  border-radius: 9px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

#content .btn-sm {
  min-height: 32px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

#content .btn-outline-secondary,
#content .btn-outline-primary {
  border-width: 1px;
}

#content .btn-outline-secondary:hover,
#content .btn-outline-primary:hover {
  transform: translateY(-1px);
}

#content .badge {
  border-radius: 999px;
  padding: 0.42rem 0.55rem;
}

.acm-modal-backdrop {
  backdrop-filter: blur(2px);
}

.acm-modal-card {
  border-radius: var(--acm-radius-lg);
  border: 1px solid rgba(182, 109, 255, 0.28);
  padding: 1.15rem;
}

.acm-toast-wrap {
  top: 68px;
  right: 14px;
}

.acm-toast {
  border-radius: 10px;
}

@media (max-width: 1199.98px) {
  .main-panel .content-wrapper {
    padding: 1rem !important;
  }
  #content .card .card-body {
    padding: 0.9rem 0.9rem;
  }
}

@media (max-width: 991.98px) {
  .page-header {
    margin-bottom: 0.9rem;
    padding-bottom: 0.5rem;
  }
  #stats-cards .stretch-card {
    margin-bottom: 0.85rem;
  }
  #content .table-responsive {
    border-radius: 9px;
  }
}

@media (max-width: 767.98px) {
  .sidebar .nav .nav-item .nav-link {
    margin-left: 0.35rem;
    margin-right: 0.35rem;
  }
  #content .card {
    border-radius: 10px;
  }
  #content .card .card-title {
    font-size: 0.98rem;
  }
  #content .btn-sm {
    min-height: 34px;
  }
  .acm-modal-backdrop {
    padding: 0.75rem;
    align-items: flex-start;
  }
  .acm-modal-card {
    width: min(1060px, 100vw);
    max-height: calc(100vh - 1.5rem);
    overflow: auto;
    padding: 0.9rem;
  }
}

@media (max-width: 575.98px) {
  .navbar .navbar-brand-wrapper .navbar-brand.brand-logo {
    max-width: 132px;
  }
  #content .card .card-body {
    padding: 0.8rem 0.78rem;
  }
  #content .acm-table thead th,
  #content .acm-table tbody td {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }
  .acm-toast-wrap {
    left: 10px;
    right: 10px;
    top: 62px;
  }
  .acm-toast {
    min-width: 0;
    width: 100%;
  }
}

/* ==========================================================================
   Sidebar personalizzata + topbar nativa del tema
   ========================================================================== */

.acm-sidebar {
  background: linear-gradient(180deg, #f8f4ff 0%, #f3ecff 100%) !important;
  border-right: 1px solid #e8ddf7;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.9);
}

.acm-sidebar .nav {
  padding-top: 0.65rem;
}

.acm-sidebar-profile {
  margin: 0 0.75rem 0.8rem;
}

.acm-sidebar-profile-link {
  border-radius: 12px !important;
  background: linear-gradient(135deg, #9a55ff 0%, #b66dff 100%);
  border: 1px solid rgba(154, 85, 255, 0.2);
  box-shadow: 0 8px 18px rgba(154, 85, 255, 0.22);
  padding: 0.92rem 0.9rem !important;
}

.acm-sidebar-profile-link .font-weight-bold {
  color: #fff;
  font-size: 0.95rem;
}

.acm-sidebar-profile-link .text-secondary {
  color: rgba(255, 255, 255, 0.86) !important;
}

.acm-sidebar .nav .nav-item .nav-link {
  margin: 0.2rem 0.58rem;
  border-radius: 10px;
  min-height: 42px;
  padding: 0.52rem 0.72rem;
  transition: all 0.18s ease;
}

.acm-sidebar .nav .nav-item .nav-link .menu-title {
  color: #4c4161;
  font-weight: 500;
}

.acm-sidebar .nav .nav-item .nav-link .menu-icon {
  color: #7c56bf !important;
}

.acm-sidebar .nav .nav-item .nav-link:hover {
  background: #efe5ff;
  box-shadow: inset 0 0 0 1px #dcc8fb;
}

.acm-sidebar .nav .nav-item .nav-link.active {
  background: linear-gradient(90deg, #9a55ff 0%, #b66dff 100%);
  box-shadow: 0 8px 16px rgba(154, 85, 255, 0.28);
}

.acm-sidebar .nav .nav-item .nav-link.active .menu-title,
.acm-sidebar .nav .nav-item .nav-link.active .menu-icon {
  color: #fff !important;
}

@media (max-width: 991.98px) {
  #auth-user-label {
    max-width: 32vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 767.98px) {
  #auth-user-label {
    display: none;
  }
  #env-host {
    max-width: 38vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Navbar: ripristino look tema originale + minimi fix leggibilità */
#auth-user-label {
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #2f2b3d;
  font-size: 0.92rem;
}

.acm-user-chip {
  gap: 0.5rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
}

.acm-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f2eef8;
  color: #8a7aa9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.acm-user-caret {
  color: #9a8bb8;
  font-size: 1rem;
}

.acm-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid #e7dfef;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(30, 18, 51, 0.12);
  padding: 0.3rem;
  z-index: 1200;
}

.acm-user-menu-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  color: #51486a;
}

.acm-user-menu-item:hover {
  background: #f5f0ff;
}

.acm-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  border: 1px solid #e4deef;
  color: #8c84a0;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.acm-icon-btn:hover {
  background: #f7f4fb;
}

.acm-woo-chip {
  padding: 0.25rem 0.55rem;
  border-left: 1px solid #ece8f2;
  margin-left: 0.2rem;
}

.acm-woo-chip .nav-profile-text p {
  color: #7c7392;
  font-size: 0.78rem;
  line-height: 1.1;
}

.acm-env-host-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.acm-env-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.acm-env-status-dot-connected { background: #22c55e; }
.acm-env-status-dot-offline { background: #ef4444; }

#env-host {
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #6e6683;
  font-size: 0.72rem;
}

@media (max-width: 991.98px) {
  #auth-user-label { max-width: 170px; }
  .acm-woo-chip { border-left: 0; margin-left: 0; }

  /* Mobile/tablet: usa solo toggler offcanvas (menu laterale) */
  .navbar .navbar-menu-wrapper > .navbar-toggler.align-self-center:not(.navbar-toggler-right) {
    display: none !important;
  }
  .navbar .navbar-menu-wrapper {
    position: relative;
    padding-right: 3rem !important; /* spazio riservato al toggler mobile */
  }
  .navbar .navbar-menu-wrapper > .navbar-toggler.navbar-toggler-right {
    display: inline-flex !important;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-left: auto;
    position: static;
    transform: none;
    background: rgba(154, 85, 255, 0.1);
    border: 1px solid rgba(154, 85, 255, 0.24);
    color: #6f3fd1;
    z-index: 5;
    position: relative;
  }
  .navbar .navbar-menu-wrapper > .navbar-toggler.navbar-toggler-right .mdi {
    display: none;
  }
  .navbar .navbar-menu-wrapper > .navbar-toggler.navbar-toggler-right::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 2px;
    background: #6f3fd1;
    border-radius: 2px;
    transform: translate(-50%, -50%);
    box-shadow: 0 -5px 0 #6f3fd1, 0 5px 0 #6f3fd1;
  }
}

@media (max-width: 767.98px) {
  #auth-user-label { display: none; }
  #env-host { max-width: 120px; }
  .acm-user-caret,
  .acm-user-avatar {
    display: none;
  }
  .acm-user-chip {
    padding: 0;
    display: none !important;
  }
  .acm-woo-chip {
    display: none !important;
  }
  #auth-logout-btn {
    display: none !important;
  }
  .navbar .navbar-menu-wrapper .navbar-nav.navbar-nav-right {
    margin-right: 0;
    width: 0;
    overflow: hidden;
  }
  .navbar .navbar-brand-wrapper {
    min-width: 90px;
  }
  .navbar .navbar-brand-wrapper .navbar-brand.brand-logo {
    max-width: 90px;
    font-size: 1rem !important;
    padding-left: 0.9rem !important;
  }
  .navbar .navbar-menu-wrapper {
    padding-right: 0.65rem !important;
  }
}
