/**
 * QlickMenu Dashboard — stili per interfaccia gestore + login.
 * Design pulito, mobile-first, orientato SaaS.
 */

/* -------------------------------------------------------------------------- */
/*  Reset base                                                                */
/* -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

.qm-dashboard-body,
.qm-auth-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: #1a1a1a;
    background: #f4f5f7;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.qm-dashboard-body a,
.qm-auth-body a { color: #d4522a; text-decoration: none; }
.qm-dashboard-body a:hover,
.qm-auth-body a:hover { text-decoration: underline; }

.qm-dashboard-body img,
.qm-auth-body img { max-width: 100%; height: auto; display: block; }

.qm-muted { color: #6b7280; }
.qm-link { color: #d4522a; font-weight: 500; }


/* -------------------------------------------------------------------------- */
/*  AUTH (login, lost password)                                               */
/* -------------------------------------------------------------------------- */

.qm-auth-body {
    background: linear-gradient(135deg, #f9e6dc 0%, #f4f5f7 100%);
}

.qm-auth-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.qm-auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 40px 32px;
    width: 100%;
    max-width: 400px;
}

.qm-auth-brand {
    text-align: center;
    margin-bottom: 28px;
}
.qm-auth-brand img { margin: 0 auto 16px; }
.qm-auth-brand h1 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
}
.qm-auth-brand p { margin: 0; font-size: 14px; }

.qm-auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 14px;
    color: #6b7280;
}

.qm-auth-legal {
    margin-top: 24px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
}
.qm-auth-legal a { color: inherit; margin: 0 4px; }


/* -------------------------------------------------------------------------- */
/*  FORM elements                                                             */
/* -------------------------------------------------------------------------- */

.qm-form { display: flex; flex-direction: column; gap: 16px; }

.qm-field { display: flex; flex-direction: column; gap: 6px; }
.qm-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.qm-field input[type="text"],
.qm-field input[type="email"],
.qm-field input[type="password"],
.qm-field input[type="tel"],
.qm-field input[type="url"],
.qm-field input[type="number"],
.qm-field textarea,
.qm-field select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.qm-field input:focus,
.qm-field textarea:focus,
.qm-field select:focus {
    outline: none;
    border-color: #d4522a;
    box-shadow: 0 0 0 3px rgba(212, 82, 42, 0.15);
}

.qm-field-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-top: -4px;
}

.qm-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #4b5563;
}
.qm-check input { margin: 0; }
.qm-check-inline {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}
.qm-check-inline input { transform: scale(0.9); }


/* -------------------------------------------------------------------------- */
/*  Buttons                                                                   */
/* -------------------------------------------------------------------------- */

.qm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: transform 0.1s ease, opacity 0.15s ease, background 0.15s ease;
    font-family: inherit;
}
.qm-btn svg { width: 16px; height: 16px; }
.qm-btn:hover { transform: translateY(-1px); }
.qm-btn:active { transform: translateY(0); }

.qm-btn-primary {
    background: #d4522a;
    color: #fff !important;
    border-color: #d4522a;
}
.qm-btn-primary:hover { background: #b8451e; border-color: #b8451e; }

.qm-btn-ghost {
    background: transparent;
    color: #374151 !important;
    border-color: transparent;
}
.qm-btn-ghost:hover { background: rgba(0,0,0,0.05); }

.qm-btn-outline {
    background: #fff;
    color: #374151 !important;
    border-color: #d1d5db;
}
.qm-btn-outline:hover { background: #f9fafb; }

.qm-btn-block { width: 100%; }


/* -------------------------------------------------------------------------- */
/*  Alerts                                                                    */
/* -------------------------------------------------------------------------- */

.qm-alert {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.qm-alert-error   { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.qm-alert-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.qm-alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.qm-alert-info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.qm-alert a { color: inherit; font-weight: 700; text-decoration: underline; }

/* Badge Premium */
.qm-badge-premium {
    display: inline-block;
    background: linear-gradient(135deg, #d4522a 0%, #ffb14a 100%);
    color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    margin-left: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    vertical-align: middle;
}


/* -------------------------------------------------------------------------- */
/*  DASHBOARD LAYOUT                                                          */
/* -------------------------------------------------------------------------- */

.qm-app {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 60px 1fr;
    grid-template-areas:
        "header header"
        "sidebar main";
    min-height: 100vh;
}

.qm-app-header {
    grid-area: header;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.qm-app-brand { display: inline-flex; align-items: center; }
.qm-app-brand img {
    display: block;
    height: 32px !important;
    width: auto !important;
    max-width: none;
}
.qm-app-brand:hover { text-decoration: none; }
.qm-app-header-actions { margin-left: auto; display: flex; gap: 6px; }

.qm-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #374151;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}
.qm-menu-toggle svg { width: 22px; height: 22px; }
.qm-menu-toggle:hover { background: rgba(0,0,0,0.05); }

.qm-app-sidebar {
    grid-area: sidebar;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 20px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.qm-app-sidebar nav { display: flex; flex-direction: column; gap: 2px; }

.qm-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #4b5563 !important;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease;
}
.qm-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.qm-nav-item:hover { background: #f4f5f7; color: #1a1a1a !important; }
.qm-nav-item.active {
    background: rgba(212, 82, 42, 0.10);
    color: #d4522a !important;
    font-weight: 600;
}

/* Selettore locale in sidebar */
.qm-locale-picker {
    background: #f4f5f7;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}
.qm-locale-picker-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6b7280;
    font-weight: 700;
    margin-bottom: 6px;
}
.qm-locale-picker-form select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}
.qm-locale-picker-manage {
    display: block;
    text-align: right;
    font-size: 11px;
    color: #d4522a !important;
    text-decoration: none !important;
    margin-top: 6px;
    font-weight: 600;
}

/* Card locale nella pagina Sedi */
.qm-locale-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}
.qm-locale-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.qm-locale-card.is-active {
    box-shadow: 0 0 0 2px #d4522a, 0 6px 20px rgba(212, 82, 42, 0.15);
}
.qm-locale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #d4522a;
    color: #fff;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}
.qm-locale-cover {
    height: 120px;
    background: linear-gradient(135deg, #f3e7dd, #f9e6dc);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qm-locale-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.qm-locale-body h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.qm-locale-tipi { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.qm-locale-tipi .qm-tag {
    background: rgba(212, 82, 42, 0.1);
    color: #d4522a;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    margin: 0;
}
.qm-locale-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 12px;
}
.qm-locale-actions form { margin: 0; }

.qm-sidebar-locale {
    background: #f9e6dc;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: auto;
}
.qm-sidebar-locale-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #b8451e;
    font-weight: 700;
}
.qm-sidebar-locale-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 3px 0 2px;
}
.qm-sidebar-locale-status {
    font-size: 12px;
    color: #6b7280;
}

.qm-app-main {
    grid-area: main;
    padding: 28px 32px;
    max-width: 100%;
    overflow-x: hidden;
}


/* -------------------------------------------------------------------------- */
/*  Page header / cards                                                       */
/* -------------------------------------------------------------------------- */

.qm-page-header {
    margin-bottom: 24px;
}
.qm-page-header h1 {
    margin: 0 0 4px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.qm-page-header p { margin: 0; font-size: 15px; }

.qm-card {
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}
.qm-card h2 {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 700;
}

.qm-card-cta {
    background: linear-gradient(135deg, #d4522a 0%, #b8451e 100%);
    color: #fff;
    text-align: center;
    padding: 40px 22px;
}
.qm-card-cta h2 { color: #fff; margin-bottom: 8px; font-size: 24px; }
.qm-card-cta p { margin: 0 0 20px; opacity: 0.9; font-size: 15px; }
.qm-card-cta .qm-btn-primary {
    background: #fff;
    color: #d4522a !important;
    border-color: #fff;
}
.qm-card-cta .qm-btn-primary:hover { background: #f9fafb; }


/* -------------------------------------------------------------------------- */
/*  Grid / Stats                                                              */
/* -------------------------------------------------------------------------- */

.qm-grid { display: grid; gap: 20px; margin-bottom: 20px; }
.qm-grid-cards { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.qm-grid-2 { grid-template-columns: 1fr 1fr; }

.qm-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-decoration: none !important;
    color: inherit !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: block;
}
.qm-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.qm-stat-value {
    font-size: 32px;
    font-weight: 800;
    color: #d4522a;
    line-height: 1;
    margin-bottom: 6px;
}
.qm-stat-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}
.qm-stat-status .qm-stat-value {
    font-size: 20px;
    color: #16a34a;
}


/* -------------------------------------------------------------------------- */
/*  Quick actions                                                             */
/* -------------------------------------------------------------------------- */

.qm-quick-actions { display: flex; flex-direction: column; gap: 8px; }

.qm-quick-action {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f9fafb;
    color: #1a1a1a !important;
    text-decoration: none !important;
    border: 1px solid transparent;
    transition: border-color 0.15s ease, transform 0.1s ease;
}
.qm-quick-action:hover { border-color: #d4522a; transform: translateX(2px); }
.qm-quick-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(212, 82, 42, 0.15);
    color: #d4522a;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}
.qm-quick-title { font-weight: 600; font-size: 14px; }
.qm-quick-sub { font-size: 12px; color: #6b7280; }


/* -------------------------------------------------------------------------- */
/*  QR preview                                                                */
/* -------------------------------------------------------------------------- */

.qm-qr-preview {
    display: flex;
    justify-content: center;
    background: #f9fafb;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 12px;
}
.qm-qr-preview img { border-radius: 6px; }


/* -------------------------------------------------------------------------- */
/*  FORM APP (Info locale, prodotti add/edit)                                 */
/* -------------------------------------------------------------------------- */

.qm-form-app { display: flex; flex-direction: column; gap: 0; }
.qm-form-app .qm-card { margin-bottom: 20px; }

.qm-form-app .qm-field { margin-bottom: 16px; }
.qm-form-app .qm-field:last-child { margin-bottom: 0; }

.qm-field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
    align-items: end;
}
.qm-field-row .qm-field { margin-bottom: 0; }

.qm-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 0;
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, #f4f5f7 60%, transparent);
    margin-top: -10px;
}


/* Tipi attività: checkbox tags a griglia */

.qm-checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.qm-check-tag {
    position: relative;
    cursor: pointer;
    display: inline-block;
}
.qm-check-tag input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.qm-check-tag span {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f4f5f7;
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}
.qm-check-tag input:checked + span {
    background: #d4522a;
    color: #fff;
    font-weight: 600;
}
.qm-check-tag:hover span { border-color: #d4522a; }


/* Image picker */

.qm-image-picker {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    transition: border-color 0.15s ease;
}
.qm-image-picker.has-image {
    background: #fff;
    border-style: solid;
    border-color: #d4522a33;
}
.qm-image-preview {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: #9ca3af;
    font-size: 13px;
}
.qm-image-preview:empty::before {
    content: "🖼 Nessuna immagine";
}
.qm-image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
}
.qm-image-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}
.qm-image-picker:not(.has-image) .qm-image-remove { display: none; }

.qm-image-uploading {
    display: none;
    font-size: 12px;
    color: #d4522a;
    font-weight: 600;
    margin: -4px 0 10px;
}
.qm-image-picker.is-uploading .qm-image-uploading { display: block; }
.qm-image-picker.is-uploading .qm-image-actions { opacity: 0.5; pointer-events: none; }

.qm-image-error {
    font-size: 12px;
    color: #b91c1c;
    margin-top: 8px;
    min-height: 0;
}
.qm-image-error:empty { display: none; }


/* Gallery grid */

.qm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.qm-gallery-grid .qm-image-picker { padding: 10px; }
.qm-gallery-grid .qm-image-preview { min-height: 80px; }
.qm-gallery-grid .qm-image-preview img { max-height: 120px; }


/* Orari form */

.qm-orari-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.qm-orari-day-row {
    display: grid;
    grid-template-columns: 100px 100px 1fr 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.qm-orari-day-row:last-child { border-bottom: none; }
.qm-orari-day-label { font-weight: 600; font-size: 14px; }
.qm-orari-chiuso-wrap {
    font-size: 13px;
    white-space: nowrap;
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
}
.qm-orari-day-row.is-closed .qm-orari-chiuso-wrap {
    color: #dc2626;
    border-color: #dc2626;
    background: #fef2f2;
}
.qm-orari-day-row input[type="text"] {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}
.qm-orari-day-row.is-closed input[type="text"] {
    background: #f4f5f7;
    color: #9ca3af;
    pointer-events: none;
}


/* -------------------------------------------------------------------------- */
/*  Page header with actions                                                  */
/* -------------------------------------------------------------------------- */

.qm-page-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}


/* -------------------------------------------------------------------------- */
/*  Toolbar                                                                   */
/* -------------------------------------------------------------------------- */

.qm-toolbar { padding: 14px 18px; }
.qm-toolbar-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.qm-toolbar-search { flex: 1; min-width: 200px; }
.qm-toolbar-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #f9fafb;
}
.qm-toolbar-search input:focus {
    outline: none;
    background: #fff;
    border-color: #d4522a;
}
.qm-toolbar-form select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    font-family: inherit;
}


/* -------------------------------------------------------------------------- */
/*  Table Prodotti                                                            */
/* -------------------------------------------------------------------------- */

.qm-card-plain { padding: 0; overflow: hidden; }
.qm-empty-state { text-align: center; padding: 40px; }

.qm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.qm-table th {
    text-align: left;
    padding: 12px 14px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    font-weight: 600;
}
.qm-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.qm-table tr:last-child td { border-bottom: none; }
.qm-table tr:hover { background: #fafbfc; }

/* Categoria in filigrana sotto al nome prodotto — visibile solo su mobile,
   dove la colonna categoria è nascosta */
.qm-row-cat-sub {
    display: none;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.qm-row-order { padding: 4px 6px !important; }
.qm-order-btn {
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    width: 22px;
    height: 20px;
    font-size: 10px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease;
}
.qm-order-btn:hover { background: #f4f5f7; color: #d4522a; }

.qm-row-thumb {
    width: 56px; height: 56px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}
.qm-row-thumb-empty {
    background: #f4f5f7;
    display: inline-block;
}

.qm-row-title {
    font-weight: 600;
    color: #1a1a1a !important;
    text-decoration: none !important;
}
.qm-row-title:hover { color: #d4522a !important; }

.qm-row-prezzo {
    font-weight: 600;
    color: #d4522a;
    white-space: nowrap;
}
.qm-old {
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 400;
    font-size: 12px;
    margin-right: 4px;
}

.qm-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}
.qm-tag-warn { background: #fef3c7; color: #92400e; }


/* Toggle "star" evidenza */
.qm-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #d1d5db;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.qm-toggle:hover { background: #fef3c7; color: #f59e0b; }
.qm-toggle.is-on { color: #f59e0b; }


/* Toggle switch (disponibile) */
.qm-toggle-round {
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: #d1d5db;
    padding: 0;
    position: relative;
    transition: background 0.15s ease;
    font-size: 0;
}
.qm-toggle-round span {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.qm-toggle-round.is-on { background: #16a34a; }
.qm-toggle-round.is-on span { transform: translateX(18px); }
.qm-toggle-round:hover { opacity: 0.9; }


/* Small button variants */
.qm-btn-sm { padding: 6px 12px; font-size: 12px; }
.qm-btn-danger { color: #dc2626 !important; }
.qm-btn-danger:hover { background: #fee2e2; }


/* -------------------------------------------------------------------------- */
/*  AI CTA (Genera con AI)                                                    */
/* -------------------------------------------------------------------------- */

.qm-ai-cta {
    background: linear-gradient(135deg, #f4e6dc 0%, #ffe8d1 100%);
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.qm-ai-cta button { flex-shrink: 0; }

.qm-ai-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: qm-spin 0.7s linear infinite;
    margin-right: 6px;
    vertical-align: -1px;
}
@keyframes qm-spin { to { transform: rotate(360deg); } }


/* -------------------------------------------------------------------------- */
/*  Form Prodotti (2 colonne)                                                 */
/* -------------------------------------------------------------------------- */

.qm-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}
.qm-form-col-main .qm-card,
.qm-form-col-side .qm-card { margin-bottom: 20px; }

.qm-check-block {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f9fafb;
    margin-bottom: 8px;
    cursor: pointer;
}
.qm-check-block:hover { background: #f4f5f7; }
.qm-check-block input {
    margin-top: 2px;
}
.qm-check-block span { font-size: 14px; line-height: 1.3; }
.qm-check-block small { display: block; font-size: 12px; margin-top: 2px; }


/* -------------------------------------------------------------------------- */
/*  WIZARD                                                                    */
/* -------------------------------------------------------------------------- */

.qm-wizard-body {
    background: linear-gradient(180deg, #f9e6dc 0%, #f4f5f7 300px);
    min-height: 100vh;
}

.qm-wizard {
    max-width: 780px;
    margin: 0 auto;
    padding: 20px;
}

.qm-wizard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 24px;
}
.qm-wizard-logo { height: 36px; width: auto; display: block; }
.qm-wizard-exit {
    color: #6b7280 !important;
    font-size: 13px;
    text-decoration: none !important;
}
.qm-wizard-exit:hover { color: #d4522a !important; }

.qm-wizard-progress {
    background: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 20px;
}
.qm-wizard-progress-bar {
    height: 6px;
    background: #f0f0f0;
    border-radius: 999px;
    overflow: hidden;
}
.qm-wizard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #d4522a 0%, #ffb14a 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
}
.qm-wizard-progress-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.qm-wizard-main {
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.05);
}

.qm-wizard-content h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
    text-align: center;
}
.qm-wizard-content-wide h1 { text-align: left; }
.qm-wizard-lead {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0 0 30px;
    text-align: center;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}
.qm-wizard-content-wide .qm-wizard-lead { text-align: left; margin-left: 0; }

.qm-wizard-form { display: flex; flex-direction: column; gap: 20px; }
.qm-wizard-form textarea {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    width: 100%;
}
.qm-wizard-form textarea:focus { outline: none; border-color: #d4522a; }

/* Fieldset stile wizard */
.qm-wizard-fs {
    border: 1px solid #e5e7eb;
    padding: 16px 18px;
    border-radius: 12px;
    margin: 0;
}
.qm-wizard-fs legend {
    font-weight: 700;
    font-size: 14px;
    padding: 0 8px;
}
.qm-wizard-fs-collapsible summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #d4522a;
    padding: 4px 0;
}
.qm-wizard-group { margin-top: 14px; }
.qm-wizard-group-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6b7280;
    margin: 0 0 8px;
    font-weight: 700;
}

/* Actions row */
.qm-wizard-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}
.qm-wizard-actions-center { justify-content: center; border-top: none; padding-top: 0; }

.qm-btn-hero { padding: 12px 24px; font-size: 15px; }

.qm-wizard-hint {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    margin: 20px 0 0;
}

/* Step 1 - hero */
.qm-wizard-hero { text-align: center; }
.qm-wizard-hero-icon { margin-bottom: 22px; display: flex; justify-content: center; }
.qm-wizard-hero-icon img { border-radius: 20px; }

.qm-wizard-steps-preview {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin: 26px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.qm-wizard-step-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}
.qm-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #d4522a;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 13px;
}

/* Step 3 - foto grid */
.qm-wizard-photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.qm-tiny { font-size: 11px; margin-top: 4px; }

/* Wizard content wide (for step tema, categorie) */
.qm-wizard-content-wide { max-width: none; }

/* Complete */
.qm-wizard-complete { text-align: center; }
.qm-wizard-confetti {
    font-size: 60px;
    margin-bottom: 10px;
    animation: qm-bounce 1s ease infinite alternate;
}
@keyframes qm-bounce { from { transform: translateY(0); } to { transform: translateY(-8px); } }
.qm-wizard-qr {
    display: inline-block;
    padding: 16px;
    background: #f9fafb;
    border-radius: 12px;
    margin: 10px 0 20px;
}
.qm-wizard-qr img { border-radius: 6px; display: block; }
.qm-wizard-url-box {
    background: #f4f5f7;
    padding: 12px 16px;
    border-radius: 10px;
    margin: 0 auto 24px;
    max-width: 480px;
}
.qm-wizard-url-box a {
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
}


/* Wizard - griglia scelta settore */

.qm-sector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.qm-sector-choice { cursor: pointer; display: block; position: relative; }
.qm-sector-choice input { position: absolute; opacity: 0; pointer-events: none; }
.qm-sector-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px 20px 20px;
    text-align: center;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    height: 100%;
}
.qm-sector-choice:hover .qm-sector-card {
    transform: translateY(-2px);
    border-color: #d1d5db;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}
.qm-sector-choice input:checked + .qm-sector-card {
    border-color: #d4522a;
    background: #fef8f5;
    box-shadow: 0 4px 16px rgba(212, 82, 42, 0.15);
}
.qm-sector-choice input:checked + .qm-sector-card .qm-tema-check {
    opacity: 1;
    transform: scale(1);
}

.qm-sector-icon {
    width: 56px; height: 56px;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: #d4522a15;
    color: #d4522a;
    display: flex; align-items: center; justify-content: center;
}
.qm-sector-icon svg { width: 30px; height: 30px; }

.qm-sector-name { font-weight: 700; font-size: 16px; margin-bottom: 6px; color: #1a1a1a; }
.qm-sector-tagline { font-size: 12px; color: #6b7280; line-height: 1.4; }

.qm-sector-details {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 6px;
}


/* Subtitle nel wizard */
.qm-wizard-subtitle {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.qm-wizard-subtitle-spaced { margin-top: 24px; }

/* Layout picker (cards con miniature) */
.qm-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 6px;
}
.qm-layout-choice {
    cursor: pointer;
    display: block;
    position: relative;
}
.qm-layout-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.qm-layout-card {
    background: #fff;
    border: 3px solid transparent;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.qm-layout-choice:hover .qm-layout-card {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}
.qm-layout-choice input:checked + .qm-layout-card {
    border-color: #d4522a;
    box-shadow: 0 4px 16px rgba(212, 82, 42, 0.2);
}
.qm-layout-choice input:checked + .qm-layout-card .qm-tema-check {
    opacity: 1;
    transform: scale(1);
}

.qm-layout-preview {
    background: #f9fafb;
    padding: 14px;
    height: 130px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}
/* Miniature per gallery */
.qm-layout-preview .qm-lp-row {
    display: flex;
    gap: 6px;
    flex: 1;
}
.qm-lp-img {
    flex: 1;
    background: linear-gradient(135deg, #d4522a 0%, #ffb14a 100%);
    border-radius: 6px;
    opacity: 0.7;
}
/* Miniature per list */
.qm-lp-cat-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.qm-lp-cat-icon {
    width: 14px; height: 14px;
    background: #d4522a;
    border-radius: 3px;
}
.qm-lp-cat-name {
    height: 8px;
    width: 60px;
    background: #d4522a;
    border-radius: 3px;
}
.qm-lp-line {
    height: 6px;
    background: #d1d5db;
    border-radius: 3px;
}
.qm-lp-line-short { width: 60%; }
/* Miniature per mixed */
.qm-lp-featured {
    height: 55px;
    background: linear-gradient(135deg, #d4522a 0%, #ffb14a 100%);
    border-radius: 6px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.qm-layout-meta {
    padding: 12px 14px;
    background: #fff;
}
.qm-layout-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.qm-layout-desc { font-size: 12px; color: #6b7280; line-height: 1.4; }


/* Responsive wizard */
@media (max-width: 700px) {
    .qm-wizard-main { padding: 26px 20px; }
    .qm-wizard-photo-grid { grid-template-columns: 1fr; }
    .qm-wizard-actions { flex-direction: column-reverse; }
    .qm-wizard-actions .qm-btn { width: 100%; }
}


/* -------------------------------------------------------------------------- */
/*  Sezione Abbonamento                                                       */
/* -------------------------------------------------------------------------- */

.qm-plan-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.qm-plan-status-info { flex: 1; min-width: 240px; }
.qm-plan-status.is-premium {
    background: linear-gradient(135deg, #f4e6dc 0%, #fff 100%);
    border: 1px solid #d4522a44;
}
.qm-plan-status h2 { margin: 0 0 4px; font-size: 20px; }

.qm-plan-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(0,0,0,0.05);
    color: #6b7280;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.qm-plan-status.is-premium .qm-plan-badge {
    background: linear-gradient(135deg, #d4522a 0%, #ffb14a 100%);
    color: #fff;
}


/* Grid piani */

.qm-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.qm-plan-card {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.qm-plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.qm-plan-card.is-current {
    border-color: #16a34a;
    background: #f0fdf4;
}
.qm-plan-premium {
    border-color: #d4522a;
    box-shadow: 0 4px 20px rgba(212, 82, 42, 0.15);
}
.qm-plan-premium.is-current { border-color: #16a34a; background: #f0fdf4; }

.qm-plan-ribbon {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #d4522a 0%, #ffb14a 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(212, 82, 42, 0.3);
}

.qm-plan-header { margin-bottom: 20px; }
.qm-plan-header h3 { margin: 0 0 12px; font-size: 20px; font-weight: 700; }

.qm-plan-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 6px;
}
.qm-price-value { font-size: 40px; font-weight: 800; line-height: 1; color: #1a1a1a; }
.qm-price-period { color: #6b7280; font-size: 14px; }

.qm-plan-tagline { color: #6b7280; font-size: 13px; margin: 0; }

.qm-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    flex: 1;
}
.qm-plan-features li {
    padding: 6px 0;
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
}
.qm-plan-features li:first-child { color: #16a34a; font-weight: 500; }

.qm-plan-cta button:disabled { opacity: 0.5; cursor: not-allowed; }


/* -------------------------------------------------------------------------- */
/*  Sezione QR                                                                */
/* -------------------------------------------------------------------------- */

.qm-qr-layout {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 20px;
    align-items: start;
}

.qm-qr-preview-card {
    text-align: center;
    position: sticky;
    top: 80px;
}
.qm-qr-large {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 8px;
}
.qm-qr-large img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}
.qm-qr-caption {
    font-size: 12px;
    margin-bottom: 12px;
}

.qm-qr-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.qm-qr-side .qm-card { margin-bottom: 0; }

/* URL copy */
.qm-url-copy {
    display: flex;
    gap: 8px;
}
.qm-url-copy input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    background: #f9fafb;
    color: #374151;
}
.qm-url-copy input:focus { outline: none; border-color: #d4522a; }

/* Download sizes grid */
.qm-qr-sizes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.qm-qr-size-btn {
    display: block;
    padding: 14px;
    background: #f9fafb;
    border: 2px solid #eef0f2;
    border-radius: 10px;
    text-decoration: none !important;
    color: #1a1a1a !important;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
    position: relative;
}
.qm-qr-size-btn:hover {
    border-color: #d4522a;
    transform: translateY(-2px);
}
.qm-qr-size-btn.is-primary {
    background: #d4522a10;
    border-color: #d4522a55;
}
.qm-qr-size-btn.is-locked {
    background: #f9fafb;
    opacity: 0.75;
}
.qm-qr-size-btn.is-locked .qm-qr-size-value { color: #9ca3af; }
.qm-qr-size-btn.is-locked:hover { border-color: #d4522a; opacity: 1; }
.qm-qr-size-value {
    font-weight: 700;
    font-size: 15px;
    color: #d4522a;
}
.qm-qr-size-desc {
    font-size: 11px;
    color: #6b7280;
    margin-top: 3px;
    line-height: 1.3;
}
.qm-qr-size-icon {
    position: absolute;
    top: 10px;
    right: 12px;
    color: #9ca3af;
    font-weight: 700;
    font-size: 16px;
}

/* Share buttons */
.qm-share-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}
.qm-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    transition: transform 0.1s ease, opacity 0.15s ease;
}
.qm-share-btn:hover { transform: translateY(-1px); }
.qm-share-btn svg { width: 18px; height: 18px; }
.qm-share-wa   { background: #25D366; color: #fff !important; }
.qm-share-mail { background: #f3f4f6; color: #374151 !important; }
.qm-share-open { background: #d4522a; color: #fff !important; }

/* Tips */
.qm-tips {
    margin: 10px 0;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.8;
}
.qm-tips li { margin-bottom: 2px; }


/* -------------------------------------------------------------------------- */
/*  Tema switcher (delivery style — 4 varianti cromatiche)                    */
/* -------------------------------------------------------------------------- */

.qm-tema-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.qm-tema-choice { position: relative; cursor: pointer; display: block; }
.qm-tema-choice input { position: absolute; opacity: 0; pointer-events: none; }

.qm-tema-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', system-ui, sans-serif;
}
.qm-tema-choice:hover .qm-tema-card {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.10);
}
.qm-tema-choice input:checked + .qm-tema-card {
    border-color: #d4522a;
    box-shadow: 0 8px 24px rgba(212,82,42,.20);
}
.qm-tema-choice input:checked + .qm-tema-card .qm-tema-check {
    opacity: 1;
    transform: scale(1);
}

.qm-tema-preview { padding: 0 12px 12px; flex: 1; }

.qm-tema-cover {
    position: relative;
    height: 90px;
    margin: 0 -12px 0;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    padding: 12px;
}
.qm-tema-locale-badge {
    position: relative; z-index: 2;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.qm-tema-nav {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    overflow: hidden;
}
.qm-tema-pill {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.qm-tema-product-row {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 12px;
    margin-top: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.qm-tema-product-img {
    position: relative;
    width: 56px; height: 56px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.qm-tema-product-img svg { width: 28px; height: 28px; }
.qm-tema-badge {
    position: absolute;
    top: -6px; left: -4px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.qm-tema-product-body { min-width: 0; }
.qm-tema-product-name {
    font-size: 13px; font-weight: 700;
    line-height: 1.2;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qm-tema-product-desc {
    font-size: 11px; margin-top: 2px;
    line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.qm-tema-product-price {
    font-size: 14px; font-weight: 700;
    padding-left: 6px;
    white-space: nowrap;
}

.qm-tema-meta {
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(0,0,0,.06);
    margin-top: 12px;
}
.qm-tema-name { font-size: 16px; font-weight: 700; margin-bottom: 3px; }
.qm-tema-desc { font-size: 12px; line-height: 1.4; }

.qm-tema-check {
    position: absolute;
    top: 10px; right: 10px;
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700;
    opacity: 0;
    transform: scale(.5);
    transition: opacity .18s ease, transform .18s ease;
    z-index: 3;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* Raggruppamento per layout (5 gruppi da 4 temi) */
.qm-tema-layout-group { margin-bottom: 32px; }
.qm-tema-layout-title { font-size: 18px; font-weight: 800; margin: 0 0 2px; color: #1a1a1a; }
.qm-tema-layout-desc { margin-top: 0; margin-bottom: 14px; font-size: 13px; }

/* Lucchetto Premium sui temi non sbloccati */
.qm-tema-choice.is-locked .qm-tema-card { opacity: .55; filter: grayscale(.35); cursor: default; }
.qm-tema-choice.is-locked:hover .qm-tema-card { transform: none; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.qm-tema-lock {
    position: absolute;
    top: 10px; right: 10px;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    z-index: 4;
    text-decoration: none !important;
    cursor: pointer;
    opacity: 1 !important;
}

/* Preview layout "card": mini griglia 2 colonne con foto in alto */
.qm-tema-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}
.qm-tema-mini-card { border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.qm-tema-mini-card-img { height: 44px; display: flex; align-items: center; justify-content: center; }
.qm-tema-mini-card-img svg { width: 22px; height: 22px; }
.qm-tema-mini-card-name { font-size: 12px; font-weight: 700; padding: 6px 8px 0; }
.qm-tema-mini-card-price { font-size: 11px; font-weight: 700; padding: 2px 8px 8px; }

/* Preview layout senza foto (trattoria/fine/ledger): righe nome+prezzo */
.qm-tema-row-list { margin-top: 12px; }
.qm-tema-noimg-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 2px;
    font-size: 12px;
    font-weight: 600;
}


/* -------------------------------------------------------------------------- */
/*  Icon picker (griglia icone standard SVG)                                  */
/* -------------------------------------------------------------------------- */

.qm-icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 6px;
    background: #f9fafb;
    border-radius: 10px;
    padding: 12px;
}
.qm-icon-choice {
    cursor: pointer;
    display: block;
    position: relative;
}
.qm-icon-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.qm-icon-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: #fff;
    border: 2px solid #eef0f2;
    border-radius: 10px;
    color: #6b7280;
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.qm-icon-tile svg { width: 26px; height: 26px; }
.qm-icon-tile-empty {
    color: #9ca3af;
    font-size: 20px;
    font-weight: 700;
}
.qm-icon-tile-empty small {
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}
.qm-icon-choice:hover .qm-icon-tile {
    border-color: #d4522a;
    color: #d4522a;
    transform: translateY(-1px);
}
.qm-icon-choice input:checked + .qm-icon-tile {
    border-color: #d4522a;
    background: #d4522a;
    color: #fff;
}


/* -------------------------------------------------------------------------- */
/*  Categorie                                                                 */
/* -------------------------------------------------------------------------- */

.qm-cat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}
.qm-cat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #eef0f2;
}
.qm-cat-item:hover { background: #f4f5f7; }
.qm-cat-item-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #d4522a1a;
    color: #d4522a;
    border-radius: 10px;
    flex-shrink: 0;
}
.qm-cat-item-icon .qm-cat-icon-svg { width: 24px; height: 24px; }
.qm-cat-item-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

.qm-cat-item-info { flex: 1; min-width: 0; }
.qm-cat-item-name { font-weight: 700; color: #1a1a1a; font-size: 14px; }
.qm-cat-item-desc { color: #6b7280; font-size: 12px; margin-top: 2px; }
.qm-cat-item-meta { color: #9ca3af; font-size: 11px; margin-top: 3px; }

.qm-cat-item-actions { display: flex; gap: 4px; align-items: center; }

/* Ordine categorie (drag-free: frecce su/giù) */
.qm-cat-order-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
}
.qm-cat-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #eef0f2;
}
.qm-cat-order-icon {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: #d4522a1a;
    color: #d4522a;
    border-radius: 8px;
    flex-shrink: 0;
}
.qm-cat-order-icon .qm-cat-icon-svg { width: 20px; height: 20px; }
.qm-cat-order-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.qm-cat-order-name { flex: 1; min-width: 0; font-weight: 700; color: #1a1a1a; font-size: 14px; }
.qm-cat-order-actions { display: flex; gap: 4px; align-items: center; }
.qm-cat-order-actions button[disabled] { opacity: 0.3; cursor: default; }


/* Categorie master (read-only) */
.qm-cat-group { margin-top: 20px; }
.qm-cat-group:first-of-type { margin-top: 10px; }
.qm-cat-group-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6b7280;
    font-weight: 700;
    margin: 0 0 10px;
}

.qm-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
}
.qm-cat-master-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px solid #eef0f2;
    font-size: 13px;
}
.qm-cat-master-item.is-used {
    background: #d4522a0f;
    border-color: #d4522a55;
}
.qm-cat-master-icon {
    color: #d4522a;
    display: inline-flex;
    align-items: center;
}
.qm-cat-master-icon .qm-cat-icon-svg { width: 18px; height: 18px; }
.qm-cat-master-icon img { width: 22px; height: 22px; border-radius: 4px; object-fit: cover; }
.qm-cat-master-name { flex: 1; color: #374151; font-weight: 500; }
.qm-cat-master-count {
    background: #d4522a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}


/* -------------------------------------------------------------------------- */
/*  Responsive                                                                */
/* -------------------------------------------------------------------------- */

.qm-hide-mobile {}

@media (max-width: 900px) {
    .qm-app {
        grid-template-columns: 1fr;
        grid-template-areas: "header" "main";
    }
    .qm-app-sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        bottom: 0;
        width: 260px;
        z-index: 20;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .qm-app.sidebar-open .qm-app-sidebar { transform: translateX(0); }
    .qm-menu-toggle { display: inline-flex; }
    .qm-app-main { padding: 20px; }
    .qm-grid-2 { grid-template-columns: 1fr; }
    .qm-hide-mobile { display: none; }

    .qm-orari-day-row {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "day chiuso"
            "mattina pomeriggio";
    }
    .qm-orari-day-label { grid-area: day; }
    .qm-orari-chiuso-wrap { grid-area: chiuso; justify-self: end; margin-right: 2px; }
    .qm-orari-day-row input[name*="mattina"] { grid-area: mattina; }
    .qm-orari-day-row input[name*="pomeriggio"] { grid-area: pomeriggio; }

    .qm-form-grid { grid-template-columns: 1fr; }
    .qm-page-header-actions { flex-direction: column; align-items: stretch; }
    .qm-table th:nth-child(4),
    .qm-table td:nth-child(4) { display: none; }

    /* Tabelle larghe (es. prodotti): scroll orizzontale per raggiungere
       le azioni Modifica/Elimina anche da smartphone */
    .qm-card-plain {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .qm-table-prodotti { min-width: 620px; }

    /* Categoria in filigrana sotto al nome (la colonna categoria è nascosta su mobile) */
    .qm-row-cat-sub { display: block; }

    .qm-qr-layout { grid-template-columns: 1fr; }
    .qm-qr-preview-card { position: static; }
}
