/* Menù servizi, Menù operatori, permessi poltrona, approvazione clienti e catalogo cliente.
   Regole circoscritte alle classi bm-*, category-*, operator-*, permission-*, approval-*. */

.bm-page {max-width:980px;}
.bm-page .card-title {font-size:1.15rem;font-weight:600;}
.bm-section-help {color:#6c757d;margin-bottom:1rem;}
.dark-mode .bm-section-help {color:#adb5bd;}

/* Riga di opzione: casella di spunta + titolo + spiegazione */
.bm-page .bm-option, .bm-option {display:flex;align-items:flex-start;gap:.75rem;padding:.85rem 1rem;border:1px solid rgba(128,128,128,.25);border-radius:.4rem;margin-bottom:.75rem;cursor:pointer;font-weight:normal;}
.bm-option input[type=checkbox],.bm-option input[type=radio] {width:1.2rem;height:1.2rem;margin-top:.15rem;flex-shrink:0;}
.bm-option-title {display:block;font-weight:600;}
.bm-option-help {display:block;color:#6c757d;font-size:.9rem;font-weight:400;}
.dark-mode .bm-option-help {color:#adb5bd;}
.bm-option:has(input:checked) {border-color:#007bff;background:rgba(0,123,255,.06);}
.bm-option:has(input:disabled) {cursor:not-allowed;opacity:.6;}
.bm-option-group {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:0 .75rem;}

.bm-state {display:inline-block;font-size:.8rem;font-weight:600;padding:.15rem .55rem;border-radius:1rem;vertical-align:middle;}
.bm-state-on {background:#e2f2e6;color:#19692c;}
.bm-state-off {background:#e9ecef;color:#495057;}
.dark-mode .bm-state-on {background:#203d29;color:#7ddc93;}
.dark-mode .bm-state-off {background:#343a40;color:#ced4da;}
.bm-actions {display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;}
.bm-status:empty {display:none;}
.bm-status {margin-top:.75rem;font-size:.9rem;}

/* Editor categorie */
.category-create {display:flex;flex-wrap:wrap;gap:.5rem;align-items:flex-end;}
.category-create .form-group {flex:1 1 260px;margin-bottom:0;}
.category-item {position:relative;margin-bottom:.6rem;}
.category-editor {border:1px solid rgba(128,128,128,.25);border-radius:.4rem;}
.category-editor > summary {display:flex;align-items:center;gap:.75rem;padding:.6rem 6.5rem .6rem .75rem;cursor:pointer;list-style:none;}
.category-editor > summary::-webkit-details-marker {display:none;}
.category-editor > summary::after {content:"\f078";font-family:"Font Awesome 6 Free",sans-serif;font-weight:900;font-size:.8rem;color:#6c757d;position:absolute;right:.9rem;top:1.6rem;transition:transform .15s;}
.category-editor[open] > summary::after {transform:rotate(180deg);}
.category-editor[open] > summary {border-bottom:1px solid rgba(128,128,128,.25);}
.category-thumb {width:48px;height:48px;border-radius:.35rem;object-fit:cover;flex-shrink:0;background:#e9ecef;display:flex;align-items:center;justify-content:center;color:#495057;}
.category-summary-text {flex:1;min-width:0;}
.category-summary-title {display:block;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.category-summary-meta {display:block;font-size:.85rem;color:#6c757d;}
.category-move {position:absolute;top:.6rem;right:2.25rem;display:flex;gap:.25rem;height:48px;align-items:center;}
.category-move .btn {width:2.25rem;padding-left:0;padding-right:0;}
.category-editor-body {padding:1rem;}
.category-editor-body .bm-actions .category-delete {margin-left:auto;}

/* Assegnazione servizi */
.category-assignment {display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;padding:.6rem 0;border-bottom:1px solid rgba(128,128,128,.2);}
.category-assignment:last-child {border-bottom:0;}
.category-assignment-name {flex:1 1 220px;margin:0;font-weight:normal;overflow-wrap:anywhere;}
.category-assignment-control {display:flex;gap:.5rem;flex:1 1 280px;}
.category-assignment-control select {flex:1;min-width:0;}
.category-assignment.is-dirty {background:rgba(255,193,7,.08);}

/* Caricamento immagine */
.menu-image-upload {display:flex;flex-wrap:wrap;gap:1rem;align-items:center;border:1px dashed #adb5bd;border-radius:.4rem;padding:.75rem;}
.menu-image-preview {width:120px;height:90px;border-radius:.35rem;object-fit:cover;flex-shrink:0;}
.menu-image-placeholder {width:120px;height:90px;border-radius:.35rem;flex-shrink:0;display:flex;align-items:center;justify-content:center;background:#e9ecef;color:#495057;font-size:.8rem;text-align:center;padding:.25rem;}
.menu-image-controls {flex:1 1 200px;min-width:0;}
.menu-image-controls input[type=file] {max-width:100%;}
.menu-image-note {font-size:.85rem;color:#6c757d;margin:.35rem 0 0;}

/* Schede operatore (admin) */
#operatorMenuCards {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,380px),1fr));gap:1rem;}
.operator-menu-card {margin-bottom:0;display:flex;flex-direction:column;}
.operator-menu-card .operator-menu-name {font-size:1.15rem;font-weight:600;margin-bottom:.75rem;}
.operator-menu-card .bm-actions {margin-top:auto;}

/* Permessi */
.permission-options {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:.25rem 1rem;padding:.75rem 1rem;border:1px solid rgba(128,128,128,.25);border-radius:.4rem;margin-bottom:1rem;}
.bm-page .permission-options label {display:flex;align-items:center;gap:.5rem;margin:0;padding:.25rem 0;font-weight:normal;}
.permission-options input {width:1.1rem;height:1.1rem;flex-shrink:0;}
.permission-options:has(input:disabled) {opacity:.55;}
.permission-subtitle {font-size:1rem;font-weight:600;margin:1.25rem 0 .35rem;}
.permission-note {font-size:.9rem;color:#6c757d;margin-bottom:.5rem;}

/* Approvazione clienti */
.approval-toolbar {display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-bottom:1rem;}
.approval-toolbar .approval-search {flex:1 1 220px;max-width:360px;}
.approval-filters .btn {white-space:nowrap;}
.approval-row {display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;padding:.65rem .25rem;border-bottom:1px solid rgba(128,128,128,.2);}
.approval-row-name {flex:1 1 200px;font-weight:600;overflow-wrap:anywhere;}
.approval-row-actions {display:flex;flex-wrap:wrap;gap:.35rem;}
.approval-badge {font-size:.8rem;}
.approval-row-name a {color:inherit;}
.approval-details {list-style:none;padding:0;margin:.3rem 0 0;display:flex;flex-wrap:wrap;gap:.15rem 1rem;font-size:.85rem;font-weight:400;color:#6c757d;}
.dark-mode .approval-details {color:#adb5bd;}
.approval-details li {display:inline-flex;align-items:center;gap:.35rem;overflow-wrap:anywhere;}
.approval-details i {width:1em;text-align:center;opacity:.8;}
.approval-rule {border-left:4px solid #17a2b8;}

/* Catalogo cliente: griglia di schede servizio ed extra */
.service-catalog {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:1rem;align-items:start;}
.service-catalog > :not(.serviceCard) {grid-column:1/-1;}
.service-catalog > .service-category-heading {margin-top:1rem;margin-bottom:0;}
.service-catalog > .service-category-heading:first-child {margin-top:0;}
.serviceCard {position:relative;display:flex;flex-direction:column;margin:0;overflow:hidden;cursor:pointer;border:1px solid rgba(128,128,128,.2);border-radius:.5rem;box-shadow:0 1px 2px rgba(0,0,0,.06);transition:box-shadow .15s,border-color .15s,transform .15s;}
.serviceCard:hover,.serviceCard:focus {border-color:#007bff;box-shadow:0 .25rem .75rem rgba(0,0,0,.12);outline:0;}
.serviceCard:focus-visible {box-shadow:0 0 0 .2rem rgba(0,123,255,.35);}
.serviceCard:active {transform:scale(.99);}
.service-card-image {display:block;width:100%;aspect-ratio:16/10;max-height:200px;object-fit:cover;background:rgba(128,128,128,.08);}
.service-card-body {display:flex;flex-direction:column;flex:1;gap:.5rem;padding:1rem;}
.service-card-head {display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;}
.service-card-head .serviceNameB {font-size:1.1rem;font-weight:600;line-height:1.3;overflow-wrap:anywhere;}
.service-card-check {display:none;flex-shrink:0;width:1.75rem;height:1.75rem;border-radius:50%;align-items:center;justify-content:center;background:#0056b3;color:#fff;font-size:.85rem;}
.service-card-description {color:#495057;font-size:.95rem;}
.dark-mode .service-card-description {color:#ced4da;}
.service-card-description p:last-child,.service-card-description ul:last-child {margin-bottom:0;}
.service-card-prices {display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;margin-top:auto;padding-top:.6rem;border-top:1px solid rgba(128,128,128,.2);font-size:.9rem;color:#6c757d;}
.dark-mode .service-card-prices {color:#adb5bd;}
.service-card-price-list {text-align:right;font-weight:600;color:#343a40;}
.dark-mode .service-card-price-list {color:#f8f9fa;}
.serviceCard.is-selected {border-color:#007bff;box-shadow:0 0 0 2px #007bff;background:rgba(0,123,255,.06);}
.serviceCard.is-selected .service-card-check {display:inline-flex;}
.service-extras-actions {position:sticky;bottom:0;z-index:5;display:flex;flex-wrap:wrap;gap:.75rem;align-items:center;margin-top:.5rem;padding:.75rem 0;background:#f4f6f9;border-top:1px solid rgba(128,128,128,.2);}
.dark-mode .service-extras-actions {background:#454d55;}
.service-extras-actions .btn {min-width:10rem;}
.dark-mode .service-extras-actions .noExtraBtn {color:#f8f9fa;border-color:#adb5bd;}
@media (max-width:575.98px) {.service-extras-actions .btn {flex:1 1 0;min-width:0;}}

/* Catalogo cliente: intestazione di categoria */
.service-category-heading {margin-top:1.75rem;margin-bottom:.75rem;padding-left:0;padding-right:0;}
.service-category-heading:first-child {margin-top:.5rem;}
.service-category-inner {display:flex;gap:1rem;align-items:flex-start;padding-bottom:.75rem;border-bottom:2px solid rgba(128,128,128,.25);}
.service-category-image {width:96px;height:96px;object-fit:cover;border-radius:.5rem;flex-shrink:0;}
.service-category-text {flex:1;min-width:0;}
.service-category-title {font-size:1.35rem;font-weight:600;margin:0 0 .25rem;}
.service-category-description {color:#495057;}
.dark-mode .service-category-description {color:#ced4da;}
.service-category-description p:last-child,.service-category-description ul:last-child {margin-bottom:0;}
@media (min-width:768px) {.service-category-image {width:140px;height:140px;}}

/* Catalogo cliente: schede operatore */
.operator-choice {display:flex;flex-direction:column;height:100%;padding:0;overflow:hidden;text-align:left;border:1px solid rgba(128,128,128,.2);transition:box-shadow .15s,border-color .15s;}
.operator-choice:hover,.operator-choice:focus {border-color:#007bff;box-shadow:0 .25rem .75rem rgba(0,0,0,.12);outline:0;}
.operator-choice-image {width:100%;aspect-ratio:16/10;max-height:200px;object-fit:cover;}
.operator-choice-any {width:100%;height:96px;display:flex;align-items:center;justify-content:center;background:#eaf3ff;color:#0056b3;font-size:2.5rem;}
.operator-choice-body {padding:1rem;display:flex;flex-direction:column;flex:1;width:100%;}
.operator-choice-name {font-size:1.2rem;font-weight:600;margin:0 0 .35rem;}
.operator-choice-description {margin-bottom:.5rem;}
.operator-choice-description p:last-child,.operator-choice-description ul:last-child {margin-bottom:0;}
.category-editor-body .editor-toolbar,.operator-menu-card .editor-toolbar {opacity:1;}
.category-editor-body .CodeMirror,.operator-menu-card .CodeMirror {min-height:120px;}
.category-editor-body .CodeMirror-scroll,.operator-menu-card .CodeMirror-scroll {min-height:120px;}
.operator-choice-services {list-style:none;padding:0;margin:0;display:flex;flex-wrap:wrap;gap:.3rem;}
.operator-choice-services li {font-size:.8rem;padding:.15rem .5rem;border-radius:1rem;background:rgba(128,128,128,.15);}
.operator-choices {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:1rem;margin-bottom:1rem;}
.permission-group-title {grid-column:1/-1;font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:#6c757d;margin-top:.5rem;}
.permission-group-title:first-child {margin-top:0;}

.dark-mode .category-thumb,
.dark-mode .menu-image-placeholder {background:#343a40;color:#ced4da;}
.dark-mode .operator-choice-any {background:#20364b;color:#8fc6ff;}
