/* ── Reset & base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --nero: #1a1a1a;
    --bianco: #ffffff;
    --bg: #f5f5f0;
    --bg2: #eeede8;
    --bordo: #e0e0d8;
    --grigio: #888888;
    --grigio-testo: #555555;
    --verde: #2d6a2d;
    --verde-bg: #f0f7f0;
    --rosso: #c00000;
    --rosso-bg: #fff0f0;
    --gold: #b8960c;
    --header-h: 56px;
    --radius: 6px;
    --shadow: 0 1px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
}

body {
    font-family: 'Lato', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--nero);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Header ────────────────────────────────────────────────────────────── */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--nero);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 2rem;
    z-index: 200;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-left { flex: 0 0 auto; }

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.logo-img {
    height: 28px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.logo-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.nav-link {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius);
    transition: all 0.15s;
    font-weight: 500;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-link.active { color: #fff; background: rgba(255,255,255,0.12); }

/* Nav dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-btn { background: none; border: none; cursor: pointer; font-family: inherit; letter-spacing: inherit; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    min-width: 170px;
    overflow: hidden;
    z-index: 300;
}
.nav-dropdown-menu.open { display: block; }
.nav-dropdown-menu a {
    display: block;
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    color: var(--nero);
    transition: background 0.1s;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active { background: var(--bg); }
.nav-dropdown-sep { border-top: 1px solid var(--bordo); margin: 3px 0; }

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.header-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    transition: background 0.15s;
    cursor: pointer;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.badge-count {
    position: absolute;
    top: 2px; right: 2px;
    background: #e03030;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

.header-btn-outline {
    color: rgba(255,255,255,0.7);
    font-size: 0.82rem;
    padding: 0.35rem 0.85rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    transition: all 0.15s;
    white-space: nowrap;
}
.header-btn-outline:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

.header-user-menu { position: relative; }

.header-user-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}
.header-user-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    min-width: 190px;
    overflow: hidden;
    z-index: 300;
}
.user-dropdown.open { display: block; }
.user-dropdown a {
    display: block;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    color: var(--nero);
    transition: background 0.1s;
}
.user-dropdown a:hover { background: var(--bg); }
.dropdown-sep { border: none; border-top: 1px solid var(--bordo); margin: 2px 0; }

/* ── Layout ────────────────────────────────────────────────────────────── */
.main-content {
    margin-top: var(--header-h);
    padding: 2rem 1.75rem;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}
.main-content.full-width { max-width: none; padding: 0; }

/* ── Flash ──────────────────────────────────────────────────────────────── */
.flash-container { margin-top: var(--header-h); }
.flash {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    border-left: 3px solid;
}
.flash-success, .flash { background: #fff3cd; border-color: #ffc107; color: #7a5a00; }
.flash-error { background: var(--rosso-bg); border-color: var(--rosso); color: var(--rosso); }
.flash-info { background: #e8f4ff; border-color: #4a90d9; color: #1a4a7a; }

/* ── Bottoni ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-primary { background: var(--nero); color: #fff; }
.btn-primary:hover { background: #333; }
.btn-success { background: var(--verde); color: #fff; }
.btn-success:hover { background: #245224; }
.btn-ghost { background: transparent; color: var(--grigio-testo); border: 1px solid var(--bordo); }
.btn-ghost:hover { background: var(--bg2); }
.btn-danger { background: var(--rosso-bg); color: var(--rosso); border: 1px solid #f0c0c0; }
.btn-danger:hover { background: #ffe0e0; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }

/* ── Home ───────────────────────────────────────────────────────────────── */
.home-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--bordo);
    gap: 1rem;
}
.home-header h1 { font-size: 1.5rem; font-weight: 700; }
.home-header p { color: var(--grigio); font-size: 0.9rem; margin-top: 0.25rem; }

.cataloghi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.catalogo-card {
    background: #fff;
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow 0.15s, border-color 0.15s;
    text-decoration: none;
    color: inherit;
}
.catalogo-card:hover { box-shadow: var(--shadow-md); border-color: #ccc; }

.catalogo-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.catalogo-card-nome { font-weight: 600; font-size: 1rem; }
.catalogo-card-cliente { font-size: 0.85rem; color: var(--grigio); }

.stato-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.stato-bozza { background: var(--bg2); color: var(--grigio-testo); }
.stato-pdf_generato { background: #e8f4ff; color: #1a5a9a; }
.stato-ordine_in_corso { background: var(--verde-bg); color: var(--verde); }

.catalogo-card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: var(--grigio);
    flex-wrap: wrap;
}

.catalogo-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--grigio);
}
.empty-state h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--grigio-testo); }
.empty-state p { font-size: 0.9rem; margin-bottom: 1.5rem; }

/* ── Wizard ─────────────────────────────────────────────────────────────── */
.wizard-container { max-width: 720px; margin: 0 auto; }

.wizard-steps {
    display: flex;
    align-items: center;
    margin-bottom: 2.5rem;
    overflow: hidden;
}
.wizard-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}
.wizard-step-line {
    flex: 1;
    height: 1px;
    background: var(--bordo);
    margin: 0 0.5rem;
}

.step-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid var(--bordo);
    background: #fff;
    color: var(--grigio);
}
.wizard-step.done .step-circle { background: var(--verde); border-color: var(--verde); color: #fff; }
.wizard-step.active .step-circle { background: var(--nero); border-color: var(--nero); color: #fff; }

.step-label { font-size: 0.78rem; color: var(--grigio); white-space: nowrap; }
.wizard-step.active .step-label { color: var(--nero); font-weight: 600; }
.wizard-step.done .step-label { color: var(--verde); }

.wizard-card {
    background: #fff;
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    padding: 2rem;
}
.wizard-card h2 { font-size: 1.25rem; margin-bottom: 0.4rem; }
.wizard-subtitle { color: var(--grigio); font-size: 0.9rem; margin-bottom: 1.75rem; }

.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bordo);
}

/* Form */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--grigio-testo); }
.form-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    font-size: 0.95rem;
    background: #fff;
    color: var(--nero);
    transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--nero); }
textarea.form-input { resize: vertical; min-height: 120px; }

/* Cliente autocomplete */
.cliente-search-box { position: relative; margin-bottom: 1rem; }
.cliente-risultati {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid var(--bordo); border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-md); max-height: 240px; overflow-y: auto; z-index: 100; display: none;
}
.cliente-risultati.open { display: block; }
.cliente-risultato-item { padding: 0.65rem 1rem; cursor: pointer; font-size: 0.9rem; border-bottom: 1px solid var(--bordo); }
.cliente-risultato-item:last-child { border-bottom: none; }
.cliente-risultato-item:hover { background: var(--bg); }
.cliente-risultato-item strong { display: block; }
.cliente-risultato-item span { font-size: 0.8rem; color: var(--grigio); }

.cliente-selezionato {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; background: var(--verde-bg);
    border: 1px solid #b0d8b0; border-radius: var(--radius); margin-bottom: 1rem;
}
.cliente-selezionato strong { display: block; }
.cliente-selezionato span { font-size: 0.82rem; color: var(--grigio-testo); }

.opzione-divider {
    text-align: center; color: var(--grigio); font-size: 0.82rem; margin: 1.25rem 0; position: relative;
}
.opzione-divider::before, .opzione-divider::after {
    content: ''; position: absolute; top: 50%; width: 42%; height: 1px; background: var(--bordo);
}
.opzione-divider::before { left: 0; }
.opzione-divider::after { right: 0; }

/* Listino */
.listino-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 0.5rem; }
.listino-card {
    border: 2px solid var(--bordo); border-radius: var(--radius);
    padding: 1.5rem 1rem; cursor: pointer; text-align: center; transition: all 0.15s;
}
.listino-card:hover { border-color: #aaa; }
.listino-card.selected { border-color: var(--nero); background: var(--nero); color: #fff; }
.listino-num { font-size: 2.5rem; font-weight: 800; line-height: 1; margin-bottom: 0.4rem; }
.listino-nome { font-size: 0.88rem; font-weight: 600; }
.listino-desc { font-size: 0.76rem; color: var(--grigio); margin-top: 0.25rem; }
.listino-card.selected .listino-desc { color: rgba(255,255,255,0.55); }

/* Collezioni */
.collezioni-search { margin-bottom: 1rem; }
.collezioni-list { display: flex; flex-direction: column; gap: 0.4rem; max-height: 420px; overflow-y: auto; }
.collezione-row {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.7rem 1rem; background: #fff;
    border: 1px solid var(--bordo); border-radius: var(--radius); transition: border-color 0.15s;
}
.collezione-row:hover { border-color: #ccc; }
.collezione-row.selected { border-color: var(--nero); background: #fafaf8; }
.collezione-nome { flex: 1; font-weight: 500; font-size: 0.92rem; }
.collezione-count { font-size: 0.78rem; color: var(--grigio); white-space: nowrap; }
.collezione-modo { display: flex; gap: 0.25rem; }
.modo-btn {
    padding: 0.22rem 0.55rem; border: 1px solid var(--bordo);
    border-radius: 4px; font-size: 0.74rem; cursor: pointer;
    background: #fff; color: var(--grigio-testo); transition: all 0.12s;
}
.modo-btn.active { background: var(--nero); color: #fff; border-color: var(--nero); }
.modo-btn:hover:not(.active) { border-color: #aaa; }

/* Selezione prodotti */
.prodotti-sel-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--bordo);
}
.progresso-col { font-size: 0.82rem; color: var(--grigio); }
.prodotti-sel-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem;
    max-height: 480px; overflow-y: auto;
}
.prodotto-sel-card {
    border: 2px solid var(--bordo); border-radius: var(--radius); overflow: hidden;
    cursor: pointer; transition: all 0.15s; position: relative; background: #fff;
}
.prodotto-sel-card:hover { border-color: #aaa; }
.prodotto-sel-card.selected { border-color: var(--verde); }
.sel-check {
    position: absolute; top: 6px; right: 6px; width: 22px; height: 22px;
    background: var(--verde); border-radius: 50%; display: none;
    align-items: center; justify-content: center; color: #fff; font-size: 0.7rem; font-weight: 700;
}
.prodotto-sel-card.selected .sel-check { display: flex; }
.prodotto-sel-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--bg); display: block; }
.prodotto-sel-info { padding: 0.4rem 0.5rem; font-size: 0.76rem; }
.prodotto-sel-info strong { display: block; font-size: 0.8rem; }
.prodotto-sel-info .colore { color: var(--grigio); }
.prodotto-sel-info .prezzo { font-weight: 600; margin-top: 2px; }

/* ── Vista catalogo ─────────────────────────────────────────────────────── */
.catalogo-layout { display: flex; min-height: calc(100vh - var(--header-h)); margin-top: var(--header-h); }

.catalogo-sidebar {
    width: 220px; flex-shrink: 0; background: #fff;
    border-right: 1px solid var(--bordo); padding: 1.25rem 1rem;
    position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.filtro-section { margin-bottom: 1.5rem; }
.filtro-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grigio); margin-bottom: 0.6rem; display: block; }
.filtro-options { display: flex; flex-direction: column; gap: 0.15rem; }
.filtro-opt {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.28rem 0.4rem; border-radius: 4px; cursor: pointer; font-size: 0.84rem; transition: background 0.1s;
}
.filtro-opt:hover { background: var(--bg); }
.filtro-opt input[type=checkbox] { accent-color: var(--nero); width: 14px; height: 14px; flex-shrink: 0; }

.catalogo-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.catalogo-topbar {
    background: #fff; border-bottom: 1px solid var(--bordo);
    padding: 0.85rem 1.5rem; display: flex; align-items: center;
    justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    position: sticky; top: var(--header-h); z-index: 100;
}
.catalogo-topbar-left h2 { font-size: 1rem; font-weight: 700; }
.catalogo-topbar-left p { font-size: 0.82rem; color: var(--grigio); }
.catalogo-topbar-right { display: flex; gap: 0.75rem; align-items: center; }

.btn-carrello {
    position: relative; background: var(--verde); color: #fff;
    border: none; border-radius: var(--radius); padding: 0.55rem 1.1rem;
    font-size: 0.9rem; font-weight: 500; cursor: pointer;
    display: inline-flex; align-items: center; gap: 0.5rem; transition: background 0.15s;
}
.btn-carrello:hover { background: #245224; }
.carrello-count {
    background: #fff; color: var(--verde); font-size: 0.72rem; font-weight: 800;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

.prodotti-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem; padding: 1.25rem;
}

.prodotto-card-cat {
    background: #fff; border: 1px solid var(--bordo);
    border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.15s;
}
.prodotto-card-cat:hover { box-shadow: var(--shadow-md); }
.prodotto-card-img-wrap { width: 100%; aspect-ratio: 1; background: var(--bg); position: relative; overflow: hidden; }
.prodotto-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prodotto-card-img-wrap .no-foto-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; color: var(--grigio); text-align: center; padding: 0.5rem; }
.prodotto-card-body { padding: 0.7rem 0.75rem; }
.prodotto-card-ref { font-weight: 700; font-size: 0.88rem; }
.prodotto-card-info { font-size: 0.78rem; color: var(--grigio); margin-top: 0.1rem; }
.prodotto-card-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; }
.prodotto-card-prezzo { font-weight: 700; font-size: 0.95rem; }
.btn-add-cart {
    width: 32px; height: 32px; border: none; background: var(--nero); color: #fff;
    border-radius: 50%; cursor: pointer; display: flex; align-items: center;
    justify-content: center; font-size: 1rem; transition: background 0.15s; flex-shrink: 0;
}
.btn-add-cart:hover { background: #333; }
.btn-add-cart.in-cart { background: var(--verde); }

/* Modal carrello */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 500; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background: #fff; border-radius: var(--radius); width: min(480px, 94vw);
    max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-md);
    animation: modal-in 0.18s ease;
}
@keyframes modal-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--bordo); }
.modal-header h3 { font-size: 1rem; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--grigio); line-height: 1; padding: 0; }
.modal-body { padding: 1.25rem; }
.modal-prodotto-top { display: flex; gap: 1rem; margin-bottom: 1.25rem; }
.modal-img { width: 100px; height: 100px; object-fit: cover; border-radius: 4px; background: var(--bg); flex-shrink: 0; display: block; }
.modal-prodotto-info h4 { font-size: 1rem; margin-bottom: 0.2rem; }
.modal-prodotto-info p { font-size: 0.84rem; color: var(--grigio-testo); margin-bottom: 0.1rem; }
.modal-prezzo { font-weight: 700; font-size: 1.1rem; margin-top: 0.35rem; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--bordo); display: flex; gap: 0.75rem; justify-content: flex-end; }

/* Pannello carrello */
.cart-panel {
    position: fixed; top: var(--header-h); right: -400px; width: 360px;
    height: calc(100vh - var(--header-h)); background: #fff;
    border-left: 1px solid var(--bordo); box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    z-index: 400; display: flex; flex-direction: column; transition: right 0.28s ease;
}
.cart-panel.open { right: 0; }
.cart-panel-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--bordo); display: flex; align-items: center; justify-content: space-between; }
.cart-panel-header h3 { font-size: 1rem; }
.cart-panel-body { flex: 1; overflow-y: auto; }
.cart-empty { text-align: center; padding: 3rem 1.5rem; color: var(--grigio); font-size: 0.9rem; }
.cart-item { display: flex; gap: 0.75rem; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--bordo); }
.cart-item-img { width: 58px; height: 58px; object-fit: cover; border-radius: 4px; background: var(--bg); flex-shrink: 0; }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-ref { font-weight: 600; font-size: 0.88rem; }
.cart-item-detail { font-size: 0.76rem; color: var(--grigio); }
.cart-item-note { font-size: 0.76rem; color: var(--grigio-testo); font-style: italic; margin-top: 0.2rem; }
.cart-item-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 0.35rem; }
.cart-item-prezzo { font-weight: 700; font-size: 0.88rem; }
.cart-item-remove { background: none; border: none; color: var(--grigio); cursor: pointer; font-size: 1rem; padding: 0; }
.cart-item-remove:hover { color: var(--rosso); }
.cart-panel-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--bordo); }
.cart-total { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 1rem; font-size: 1rem; }

/* ── Segnalazioni ───────────────────────────────────────────────────────── */
.segnalazione-form { max-width: 640px; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.4rem; font-weight: 700; }
.page-header p { color: var(--grigio); font-size: 0.9rem; margin-top: 0.25rem; }

.upload-area {
    border: 2px dashed var(--bordo); border-radius: var(--radius);
    padding: 2rem; text-align: center; cursor: pointer; transition: all 0.15s; background: #fff;
}
.upload-area:hover, .upload-area.dragover { border-color: var(--nero); background: var(--bg); }
.upload-area input { display: none; }
.upload-area p { font-size: 0.88rem; color: var(--grigio); margin-top: 0.4rem; }
.upload-previews { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.75rem; }
.upload-preview { position: relative; width: 80px; height: 80px; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; border: 1px solid var(--bordo); }
.upload-preview-remove {
    position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
    background: var(--nero); color: #fff; border: none; border-radius: 50%;
    cursor: pointer; font-size: 0.7rem; display: flex; align-items: center; justify-content: center;
}

.segnalazioni-lista { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 2rem; }
.segnalazione-item {
    background: #fff; border: 1px solid var(--bordo); border-radius: var(--radius);
    padding: 1rem 1.25rem; display: flex; align-items: flex-start; gap: 1rem;
}
.segnalazione-item-body { flex: 1; }
.segnalazione-item-oggetto { font-weight: 600; }
.segnalazione-item-meta { font-size: 0.8rem; color: var(--grigio); margin-top: 0.2rem; }

/* ── Varianti ───────────────────────────────────────────────────────────── */
.famiglie-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.famiglie-header h2 { margin: 0; }
.badge { background: var(--nero); color: #fff; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.8rem; }
.empty { color: var(--grigio); margin-top: 2rem; }

.famiglia-card { background: #fff; border: 1px solid var(--bordo); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
.famiglia-meta { display: flex; gap: 1rem; margin-bottom: 1rem; font-size: 0.85rem; }
.motivo { background: #f0f0e8; border: 1px solid #d0d0c0; padding: 0.2rem 0.6rem; border-radius: 4px; font-weight: 600; }
.collezione { color: var(--grigio); align-self: center; }
.prodotti-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.prodotto-card { flex: 1; min-width: 160px; max-width: 220px; border: 1px solid #eee; border-radius: 4px; overflow: hidden; }
.foto-box { width: 100%; aspect-ratio: 1; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.foto-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-box.no-foto::after { content: 'Foto non disponibile'; font-size: 0.75rem; color: #aaa; }
.prodotto-info { padding: 0.6rem 0.75rem; display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.82rem; }
.prodotto-info strong { font-size: 0.95rem; }
.prodotto-info .prezzo { font-weight: 600; margin-top: 0.25rem; }
.prodotto-info .muted { color: #aaa; }
.famiglia-azioni { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; border-top: 1px solid #eee; padding-top: 1rem; }
.btn-ok { background: var(--verde); color: #fff; }
.btn-ok:hover { background: #245224; }
.btn-no { background: var(--bg); color: #333; border: 1px solid #ccc; }
.btn-no:hover { background: var(--bg2); }
.btn-manuale { background: var(--nero); color: #fff; }
.btn-manuale:hover { background: #333; }
.btn-nav { background: var(--bg); color: #333; border: 1px solid #ccc; }
.form-manuale { display: flex; gap: 0.5rem; align-items: center; }
.form-manuale input { padding: 0.5rem 0.6rem; border: 1px solid #ccc; border-radius: 4px; font-size: 0.9rem; width: 160px; }
.tab-bar { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--bordo); }
.tab-btn { padding: 0.6rem 1.2rem; border-radius: 4px 4px 0 0; text-decoration: none; color: var(--grigio); font-size: 0.9rem; border: 1px solid transparent; margin-bottom: -2px; display: flex; align-items: center; gap: 0.5rem; }
.tab-btn:hover { background: var(--bg); color: #333; }
.tab-btn.active { background: #fff; color: var(--nero); border-color: var(--bordo); border-bottom-color: #fff; font-weight: 600; }
.tab-count { background: var(--bordo); border-radius: 10px; padding: 0.1rem 0.5rem; font-size: 0.78rem; }
.tab-btn.active .tab-count { background: var(--nero); color: #fff; }
.errata-segnata { opacity: 0.35; border-color: #f0c0c0 !important; background: #fff8f8 !important; }
.info-box { background: #f0f4ff; border: 1px solid #c0d0f0; padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 1.5rem; font-size: 0.9rem; }
.alta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 5rem; }
.alta-card { background: #fff; border: 1px solid var(--bordo); border-radius: var(--radius); overflow: hidden; }
.alta-photos { display: flex; }
.alta-photo { flex: 1; border-right: 1px solid #eee; }
.alta-photo:last-child { border-right: none; }
.alta-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.alta-photo.no-foto { aspect-ratio: 1; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.alta-info { padding: 0.4rem 0.5rem; display: flex; flex-direction: column; font-size: 0.78rem; }
.alta-info strong { font-size: 0.85rem; }
.alta-meta { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.75rem; border-top: 1px solid #eee; background: #fafaf8; }
.collezione-small { font-size: 0.78rem; color: var(--grigio); }
.btn-errata { background: var(--rosso-bg); color: var(--rosso); border: 1px solid #f0c0c0; font-size: 0.82rem; padding: 0.3rem 0.7rem; }
.btn-errata:hover { background: #ffe0e0; }
.conferma-tutte-bar { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 2px solid var(--bordo); padding: 1rem 2rem; text-align: center; z-index: 100; }
.btn-conferma-tutte { background: var(--verde); color: #fff; font-size: 1rem; padding: 0.75rem 2rem; border-radius: 4px; }
.btn-conferma-tutte:hover { background: #245224; }
.paginazione { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #eee; }

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { width: 340px; background: #fff; padding: 2.5rem; border-radius: var(--radius); box-shadow: var(--shadow-md); }
.login-logo { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.login-logo img { height: 70px; width: auto; }
.login-box h1 { margin-bottom: 1.5rem; font-size: 1.1rem; text-align: center; letter-spacing: 0.04em; color: var(--grigio-testo); font-weight: 500; }
.login-box input { display: block; width: 100%; padding: 0.6rem 0.75rem; margin-bottom: 1rem; border: 1px solid var(--bordo); border-radius: var(--radius); font-size: 1rem; }
.login-box button { width: 100%; padding: 0.7rem; background: var(--nero); color: #fff; border: none; border-radius: var(--radius); font-size: 1rem; cursor: pointer; }
.login-box button:hover { background: #333; }

/* ── Bottoni KDK ────────────────────────────────────────────────────────── */
.btn-kdk {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.4rem;
    font-family: 'Lato', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    text-decoration: none;
}
.btn-kdk-solid {
    background: var(--nero);
    color: #fff;
    border: 1px solid var(--nero);
}
.btn-kdk-solid:hover { background: #333; border-color: #333; }
.btn-kdk-solid:disabled,
.btn-kdk-solid[disabled] {
    background: #d0d0d0;
    border-color: #d0d0d0;
    color: #999;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-kdk-outline {
    background: transparent;
    color: var(--nero);
    border: 1px solid var(--nero);
}
.btn-kdk-outline:hover { background: var(--nero); color: #fff; }
.btn-kdk-ghost {
    background: transparent;
    color: var(--grigio-testo);
    border: 1px solid var(--bordo);
}
.btn-kdk-ghost:hover { border-color: #999; color: var(--nero); }
.btn-kdk-sm { padding: 0.42rem 1rem; font-size: 0.75rem; }
.btn-kdk-xs { padding: 0.28rem 0.65rem; font-size: 0.7rem; }
.btn-count {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 0.05rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0;
}
.btn-kdk-outline .btn-count {
    background: rgba(0,0,0,0.06);
    border-color: var(--bordo);
    color: var(--grigio-testo);
}
.btn-kdk-outline:hover .btn-count { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); color: #fff; }

/* ── Vista catalogo (ecommerce) ─────────────────────────────────────────── */
.main-content.vista-layout {
    max-width: none;
    padding: 0;
    margin-top: var(--header-h);
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - var(--header-h));
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.vista-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--bordo);
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    z-index: 50;
}

/* Griglia a 2 colonne: PDF (42px) + nomi */
.sidebar-grid {
    display: grid;
    grid-template-columns: 42px 1fr;
    width: 100%;
}

/* Header row */
.sg-pdf-head {
    background: var(--nero);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 2;
}
.sg-actions-head {
    background: var(--nero);
    height: 40px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 2;
}
.sidebar-header-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 3px;
    font-size: 0.63rem;
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 0.22rem 0.6rem;
    letter-spacing: 0.04em;
    transition: background 0.14s, color 0.14s, border-color 0.14s;
    white-space: nowrap;
}
.sidebar-header-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}
.sidebar-header-sep { color: rgba(255,255,255,0.2); font-size: 0.7rem; user-select: none; }

/* Celle dati */
.sg-pdf-cell {
    background: var(--nero);
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sg-name-cell {
    height: 30px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.6rem 0 0.75rem;
    border-bottom: 1px solid #f0ede8;
    transition: background 0.1s;
}
.sg-name-cell:hover { background: #faf7f4; }

/* Checkbox PDF */
.sidebar-pdf-cb-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 22px;
    height: 22px;
}
.sidebar-pdf-cb-wrap input { display: none; }
.sidebar-pdf-icon {
    width: 15px;
    height: 15px;
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, border-color 0.12s;
    color: transparent;
}
.sidebar-pdf-cb-wrap:hover .sidebar-pdf-icon { border-color: rgba(255,255,255,0.65); }
.sidebar-pdf-cb-wrap input:checked + .sidebar-pdf-icon {
    background: #fff;
    border-color: #fff;
    color: var(--nero);
}

/* Nome collezione + bottone Vai */
.sidebar-col-link {
    font-size: 0.8rem;
    color: var(--grigio-testo);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    transition: color 0.14s;
}
.sg-name-cell:hover .sidebar-col-link { color: var(--nero); }

.sidebar-vai-btn {
    flex-shrink: 0;
    font-size: 0.6rem;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--grigio);
    text-decoration: none;
    border: 1px solid var(--bordo);
    border-radius: 3px;
    padding: 0.1rem 0.4rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.14s, color 0.14s, border-color 0.14s;
}
.sg-name-cell:hover .sidebar-vai-btn { opacity: 1; color: #77573b; border-color: #c4a882; }

.filtro-chip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.2rem 0;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--grigio-testo);
    transition: color 0.12s;
    margin-bottom: 0.15rem;
}
.filtro-chip:hover { color: var(--nero); }
.filtro-chip input[type=checkbox] { accent-color: var(--nero); width: 13px; height: 13px; flex-shrink: 0; cursor: pointer; }
.btn-reset-filtri {
    background: none; border: none; font-size: 0.72rem; color: var(--grigio);
    cursor: pointer; padding: 0; letter-spacing: 0.05em; text-transform: uppercase;
    text-decoration: underline; margin-top: 0.5rem;
}
.btn-reset-filtri:hover { color: var(--nero); }

/* ── Main ───────────────────────────────────────────────────────────────── */
.vista-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fafaf8; }

.vista-topbar {
    background: #fff;
    border-bottom: 1px solid var(--bordo);
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    position: sticky;
    top: var(--header-h);
    z-index: 90;
}
.vista-topbar-info { min-width: 0; }
.vista-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}
.vista-meta { font-size: 0.76rem; color: var(--grigio); letter-spacing: 0.04em; margin-top: 0.1rem; }
.vista-topbar-azioni { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* Search nella topbar */
.topbar-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #f5f4f0;
    border: 1px solid var(--bordo);
    border-radius: 20px;
    padding: 0.3rem 0.65rem;
    transition: border-color 0.14s;
}
.topbar-search:focus-within { border-color: #aaa; background: #fff; }
.topbar-search svg { color: var(--grigio); flex-shrink: 0; }
.topbar-search input {
    border: none;
    background: transparent;
    font-size: 0.82rem;
    font-family: 'Lato', sans-serif;
    color: var(--nero);
    width: 140px;
    outline: none;
}
.topbar-search input::placeholder { color: var(--grigio); }
#search-clear {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--grigio);
}
#search-clear:hover { color: var(--nero); }

/* Filtri dropdown */
.filtri-wrap { position: relative; }
.filtri-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    z-index: 200;
    min-width: 680px;
    overflow: hidden;
}
.filtri-panel.open { display: block; }

.filtri-panel-inner {
    display: flex;
    gap: 0;
    align-items: stretch;
}

/* Sezione attributi (sinistra) */
.filtri-attrs-wrap {
    display: flex;
    flex: 0 0 auto;
    border-right: 2px solid var(--bordo);
}
.filtri-col {
    padding: 1.1rem 1.1rem;
    border-right: 1px solid var(--bordo);
    min-width: 130px;
}
.filtri-col-last {
    border-right: none;
}

/* Sezione collezioni (destra, sfondo scuro) */
.filtri-col-collezioni {
    flex: 1;
    background: var(--nero);
    padding: 1.1rem 1.25rem;
}
.filtri-col-title {
    color: rgba(255,255,255,0.45) !important;
}
.filtri-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
}
.filtro-chip-col {
    color: rgba(255,255,255,0.75) !important;
}
.filtro-chip-col:hover { color: #fff !important; }
.filtro-chip-col input[type=checkbox] {
    accent-color: #fff;
}

.filtri-group-title {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--grigio);
    margin-bottom: 0.6rem;
    display: block;
}
.filtri-panel-footer {
    padding: 0.6rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--bordo);
    background: #fafaf8;
}
.filtri-badge {
    display: inline-block;
    font-size: 0.6rem;
    color: #77573b;
    margin-left: 2px;
    line-height: 1;
}

.vista-content { padding: 0 0 4rem; }

/* ── Sezione collezione ─────────────────────────────────────────────────── */
/* offset per header fisso + topbar */
.col-section {
    margin-bottom: 3.5rem;
    scroll-margin-top: calc(var(--header-h) + 56px + 1rem);
}

.col-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 2rem 0.75rem;
    border-bottom: 1px solid var(--bordo);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    /* sticky: resta visibile mentre si scorre la sezione */
    position: sticky;
    top: calc(var(--header-h) + 57px);
    z-index: 15;
    background: #fafaf8;
}
.col-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--nero);
}
.col-header-azioni {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.col-count { font-size: 0.75rem; color: var(--grigio); letter-spacing: 0.04em; margin-right: 0.25rem; }

/* Separatore di riga per cambio tipologia (funziona su qualsiasi griglia) */
.grid-tipo-break {
    grid-column: 1 / -1;
    height: 0;
}

/* ── Griglia prodotti ───────────────────────────────────────────────────── */
.prodotti-griglia {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 1px;
    padding: 0 2rem;
    background: var(--bordo);
}

.prodotto-card {
    background: #fff;
    overflow: hidden;
    transition: box-shadow 0.18s;
    position: relative;
    flex: none;
    max-width: none;
    min-width: 0;
}
.prodotto-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); z-index: 1; }
.prodotto-card.in-cart::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid #77573b;
    pointer-events: none;
}

/* Checkbox PDF */
.pdf-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    cursor: pointer;
}
.pdf-checkbox input { display: none; }
.pdf-cb-icon {
    width: 20px;
    height: 20px;
    border: 1.5px solid rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.14s, border-color 0.14s;
    backdrop-filter: blur(2px);
}
.pdf-checkbox input:checked + .pdf-cb-icon {
    background: var(--nero);
    border-color: var(--nero);
}
.pdf-cb-icon svg { opacity: 0; transition: opacity 0.12s; }
.pdf-checkbox input:checked + .pdf-cb-icon svg { opacity: 1; }

/* Immagine prodotto */
.prodotto-img-wrap {
    width: 100%;
    aspect-ratio: 1;
    background: #f0eeeb;
    position: relative;
    overflow: hidden;
}
.prodotto-img-wrap.no-foto::after {
    content: 'No foto';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #bbb;
    letter-spacing: 0.06em;
}
.prodotto-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.prodotto-card:hover .prodotto-img { transform: scale(1.04); }

/* Bottone carrello overlay — sempre visibile (tablet) */
.btn-add-cart {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border: none;
    background: #fff;
    color: var(--nero);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    box-shadow: 0 1px 6px rgba(0,0,0,0.18);
}
.btn-add-cart:hover { background: var(--nero); color: #fff; }
.btn-add-cart.active { background: #77573b; color: #fff; }

/* Info prodotto */
.prodotto-info {
    padding: 0.65rem 0.75rem 0.8rem;
    border-top: 1px solid var(--bordo);
}
.prodotto-ref {
    font-family: 'Lato', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--nero);
}
.prodotto-colore { font-size: 0.72rem; color: var(--grigio); margin-top: 0.1rem; letter-spacing: 0.03em; }
.prodotto-prezzo { font-size: 0.85rem; font-weight: 700; color: var(--nero); margin-top: 0.3rem; }

.no-risultati {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--grigio);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}

/* ── Modal prodotto ─────────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20,18,16,0.55);
    z-index: 600;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.modal-overlay.open { display: flex; }

.modal-box {
    background: #fff;
    width: min(620px, 96vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    position: relative;
    animation: modal-in 0.2s ease;
}
.modal-box-wide { width: min(820px, 96vw); }
@keyframes modal-in { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--grigio);
    padding: 4px;
    display: flex;
    align-items: center;
    z-index: 10;
    transition: color 0.14s;
}
.modal-close:hover { color: var(--nero); }

.modal-inner {
    display: flex;
    gap: 0;
}
.modal-foto-col {
    flex: 0 0 220px;
    background: #f0eeeb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.modal-foto {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    display: block;
    border-radius: 2px;
}
.modal-dati-col {
    flex: 1;
    padding: 1.75rem 1.5rem 1.5rem;
    min-width: 0;
}
.modal-ref {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    margin-bottom: 0.2rem;
}
.modal-collezione { font-size: 0.78rem; color: var(--grigio); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 1rem; }
.modal-specs { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.spec-row { display: flex; gap: 0.75rem; font-size: 0.83rem; }
.spec-row dt { color: var(--grigio); min-width: 60px; }
.spec-row dd { color: var(--nero); font-weight: 600; }
.modal-prezzo { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 400; color: #77573b; }
.modal-azioni { display: flex; gap: 0.75rem; margin-top: 1.25rem; }

/* Varianti nel modal */
.modal-varianti {
    border-top: 1px solid var(--bordo);
    padding: 1rem 1.5rem 1.25rem;
}
.modal-varianti-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--grigio);
}
.varianti-lista { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.variante-mini {
    width: 72px;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.14s;
}
.variante-mini:hover { opacity: 0.75; }
.variante-mini img { width: 72px; height: 72px; object-fit: cover; display: block; background: #f0eeeb; }
.variante-mini div { font-size: 0.68rem; margin-top: 0.3rem; font-weight: 700; }
.variante-colore { font-size: 0.65rem !important; color: var(--grigio); font-weight: 400 !important; }

/* ── Variante picker modal ───────────────────────────────────────────────── */
.variante-picker-header {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--bordo);
}
.variante-picker-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.variante-picker-main img { width: 64px; height: 64px; object-fit: cover; background: #f0eeeb; }
.vp-main-ref { font-weight: 700; font-size: 0.9rem; }
.vp-main-col { font-size: 0.75rem; color: var(--grigio); }
.vp-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--grigio); margin-bottom: 0.5rem; }
.vp-search { max-width: 260px; font-size: 0.85rem; }

.vp-griglia {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1px;
    background: var(--bordo);
    max-height: 55vh;
    overflow-y: auto;
}
.vp-card {
    background: #fff;
    cursor: pointer;
    transition: background 0.14s;
    padding-bottom: 0.5rem;
}
.vp-card:hover { background: #fafaf8; }
.vp-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #f0eeeb; }
.vp-card-ref { font-size: 0.72rem; font-weight: 700; padding: 0.3rem 0.5rem 0.1rem; }
.vp-card-colore { font-size: 0.65rem; color: var(--grigio); padding: 0 0.5rem; }

/* ── Pannello carrello ───────────────────────────────────────────────────── */
.carrello-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.22);
    z-index: 450;
}
.carrello-overlay.open { display: block; }

.carrello-panel {
    position: fixed;
    top: var(--header-h);
    right: -400px;
    width: 360px;
    height: calc(100vh - var(--header-h));
    background: #fff;
    border-left: 1px solid var(--bordo);
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
    z-index: 460;
    display: flex;
    flex-direction: column;
    transition: right 0.28s cubic-bezier(.4,0,.2,1);
}
.carrello-panel.open { right: 0; }

.carrello-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--bordo);
}
.carrello-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}
.carrello-items { flex: 1; overflow-y: auto; }
.ci-empty { text-align: center; padding: 3rem 1.5rem; color: var(--grigio); font-size: 0.85rem; letter-spacing: 0.04em; }

.ci-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--bordo);
}
.ci-info { flex: 1; min-width: 0; font-size: 0.84rem; display: flex; flex-direction: column; gap: 0.15rem; }
.ci-info strong { font-weight: 700; letter-spacing: 0.03em; }
.ci-info span { font-size: 0.76rem; color: var(--grigio); }
.ci-info em { font-size: 0.75rem; color: var(--grigio-testo); font-style: italic; }
.ci-remove {
    background: none;
    border: none;
    color: var(--grigio);
    cursor: pointer;
    padding: 3px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: color 0.14s;
}
.ci-remove:hover { color: var(--rosso); }

.carrello-footer {
    padding: 1.1rem 1.25rem;
    border-top: 1px solid var(--bordo);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.ci-totale { font-size: 0.8rem; color: var(--grigio); letter-spacing: 0.04em; }

/* ── Card generica ──────────────────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ── Utility ────────────────────────────────────────────────────────────── */
.text-muted { color: var(--grigio); font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }

/* ── Memory varianti ─────────────────────────────────────────────────────── */
.main-content.memory-layout {
    max-width: none;
    padding: 0;
    margin-top: var(--header-h);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-h));
    background: #fafaf8;
}

.memory-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: #fff;
    border-bottom: 1px solid var(--bordo);
    position: sticky;
    top: var(--header-h);
    z-index: 80;
    gap: 1rem;
}
.memory-topbar-center {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    flex: 1;
    justify-content: center;
}
.memory-col-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}
.memory-col-subtitle {
    font-size: 0.68rem;
    color: var(--grigio);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.memory-col-progress {
    font-size: 0.72rem;
    color: var(--grigio);
    letter-spacing: 0.06em;
}
.memory-topbar-left,
.memory-topbar-right { min-width: 140px; }
.memory-topbar-right { text-align: right; }

.mem-toggle {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--bordo);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
    margin-top: 0.4rem;
}
.mem-toggle-btn {
    padding: 0.2rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    border: none;
    background: transparent;
    color: var(--grigio);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.mem-toggle-btn:hover { color: var(--testo); }
.mem-toggle-btn.active {
    background: var(--bianco);
    color: var(--testo);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Griglia card */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    padding: 1.5rem 2rem 7rem;
}

/* Singola card */
.mem-card {
    position: relative;
    background: #fff;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.14s, box-shadow 0.14s, opacity 0.2s;
    overflow: hidden;
    user-select: none;
}
.mem-card:hover:not(.mem-grouped) {
    border-color: #c4a882;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.mem-card.selected {
    border-color: #77573b;
    box-shadow: 0 0 0 3px rgba(119,87,59,0.18);
}
/* Card nuova (importata nell'ultimo sync) */
.mem-card.mem-nuovo {
    border-color: #d94f3d;
    border-width: 2px;
}
.mem-new-label {
    position: absolute;
    top: 0;
    right: 0;
    background: #d94f3d;
    color: #fff;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 2px 6px;
    border-radius: 0 var(--radius) 0 4px;
    z-index: 3;
}

.mem-card.mem-grouped {
    border-color: #4a9e5c;
    border-width: 3px;
    cursor: pointer;
    transition: box-shadow 0.14s, opacity 0.14s;
    opacity: 0.55;
}
.mem-card.mem-grouped:hover {
    opacity: 0.85;
    box-shadow: 0 2px 10px rgba(74,158,92,0.25);
}

/* Icona undo — visibile solo su grouped al hover */
.mem-undo-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.14s;
    z-index: 2;
}
.mem-card.mem-grouped:hover .mem-undo-icon { opacity: 1; }

/* Badge gruppo (numero) */
.mem-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #4a9e5c;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* Check icon (appare su selected) */
.mem-check-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: #77573b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.14s;
    z-index: 2;
}
.mem-card.selected .mem-check-icon { opacity: 1; }

/* Immagine */
.mem-img-wrap {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f4f0;
    overflow: hidden;
}
.mem-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mem-img-wrap.no-foto {
    display: flex;
    align-items: center;
    justify-content: center;
}
.mem-img-wrap.no-foto::after {
    content: '—';
    color: var(--grigio);
    font-size: 1.2rem;
}

/* ── Merged card (correlati / parure) ────────────────────────────────── */

.mgc-img-area {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f5f4f0;
    overflow: hidden;
}

/* Slide: nascosta di default, visibile solo se .active */
.mgc-slide {
    display: none;
    width: 100%;
    height: 100%;
}
.mgc-slide.active { display: block; }
.mgc-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mgc-slide.no-foto {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grigio);
    font-size: 1.2rem;
}
.mgc-slide.no-foto::after { content: '—'; }

/* Frecce prev/next — sempre visibili, nere */
.mgc-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.88);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 0;
    color: #1a1a1a;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    transition: background 0.12s;
}
.mgc-arrow:hover { background: #fff; }
.mgc-prev { left: 5px; }
.mgc-next { right: 5px; }

/* Badge contatore varianti — angolo in alto a destra */
.mgc-count-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background 0.12s;
}
.mgc-count-badge:hover { background: #444; }

/* Popup varianti */
.mgc-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.mgc-popup-overlay.open { display: flex; }

.mgc-popup {
    position: relative;
    background: var(--bianco);
    border-radius: 10px;
    padding: 1.5rem;
    max-width: 90vw;
    box-shadow: 0 8px 40px rgba(0,0,0,0.22);
}

.mgc-popup-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--grigio);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
}
.mgc-popup-close:hover { color: var(--nero); }

.mgc-popup-cards {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.mgc-popup-card {
    width: 150px;
    flex-shrink: 0;
}

.mgc-popup-img-wrap {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f4f0;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}
.mgc-popup-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mgc-popup-img-wrap.no-foto::after {
    content: '—';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ccc;
}

.mgc-popup-ref {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}
.mgc-popup-tipo {
    font-size: 0.6rem;
    color: var(--grigio);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.25rem;
}
.mgc-popup-specs {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.mgc-popup-specs span {
    font-size: 0.65rem;
    color: #666;
}
.mgc-popup-prezzo {
    font-weight: 700 !important;
    color: var(--nero) !important;
    margin-top: 0.2rem;
}

/* Info testo */
.mem-info {
    padding: 0.4rem 0.5rem 0.5rem;
}
.mem-ref {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--nero);
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mem-tipo {
    font-size: 0.6rem;
    color: var(--grigio);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.15rem;
}
.mem-row2 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.2rem;
    margin-bottom: 0.15rem;
}
.mem-colore { font-size: 0.6rem; color: var(--grigio-testo); }
.mem-prezzo { font-size: 0.67rem; font-weight: 700; color: var(--nero); }
.mem-row3 {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    border-top: 1px solid #eee;
    padding-top: 0.15rem;
    margin-top: 0.05rem;
}
.mem-peso {
    font-size: 0.6rem;
    color: var(--grigio-testo);
}
.mem-diam {
    font-size: 0.58rem;
    color: var(--grigio);
}

/* Barra inferiore sticky */
.memory-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--bordo);
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 100;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}
.memory-bar-left { display: flex; align-items: center; gap: 0.75rem; }
.memory-bar-right { display: flex; align-items: center; gap: 0.65rem; }
.mem-bar-count { font-size: 0.82rem; color: var(--grigio); }

/* Index panoramica */
.memory-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    padding: 1.5rem 2rem;
}
.mi-card {
    display: block;
    background: #fff;
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    text-decoration: none;
    transition: border-color 0.14s, box-shadow 0.14s;
}
.mi-card:hover { border-color: #77573b; box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.mi-card-nuovi { border-color: #d94f3d; }
.mi-card-nuovi:hover { border-color: #b83a2a; }
.mi-nome {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    color: var(--nero);
    margin-bottom: 0.35rem;
}
.mi-nuovo-badge {
    background: #d94f3d;
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.mi-stats { font-size: 0.72rem; color: var(--grigio); margin-bottom: 0.5rem; }
.mi-abbinati { color: #77573b; font-weight: 600; }
.mi-sep { margin: 0 0.3rem; }
.mi-bar {
    height: 3px;
    background: #ece9e3;
    border-radius: 2px;
    overflow: hidden;
}
.mi-bar-fill {
    height: 100%;
    background: #77573b;
    border-radius: 2px;
    transition: width 0.3s;
}


/* ═══════════════════════════════════════════════════════════
   STILL MANAGER
   ═══════════════════════════════════════════════════════════ */

/* ── Layout still: full-width, no padding, flex column ────────────────── */
.still-layout {
    max-width: none;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-h));
    overflow: hidden;
}

/* Topbar inside still-layout: remove sticky, be a normal flex item */
.still-layout .memory-topbar {
    position: relative;
    top: auto;
    z-index: 1;
    flex-shrink: 0;
    padding: 0.65rem 1.5rem;
}

/* ── Corpo a due colonne ────────────────────────────────── */

.still-body {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

/* Colonna sinistra: 40% — gestione still */
.still-left-col {
    width: 40%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--bordo);
}

/* Colonna destra: 60% — griglia prodotti */
.still-right-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: var(--bg-secondary);
}

.still-right-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid var(--bordo);
    background: var(--bianco);
    flex-shrink: 0;
    gap: 1rem;
}
.still-right-counter {
    font-size: 0.72rem;
    color: var(--grigio-testo);
    font-weight: 500;
    white-space: nowrap;
}
.still-right-counter strong {
    color: var(--nero);
    font-weight: 700;
}
.still-right-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 1rem 1.5rem;
    min-height: 0;
}
.still-right-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    align-content: start;
}

/* Badge slot sulle card della colonna destra */
.still-prod-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--nero);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    z-index: 3;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.22);
}

/* Card colonna destra: eredita pkr-card, aggiunge relative per il badge */
.still-right-card {
    position: relative;
}
.still-right-card.is-assigned {
    opacity: 0.55;
}
.still-right-card.still-hidden { display: none; }

/* ── Zona slot ─────────────────────────────────────────── */

.still-slots-section {
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--bordo);
    background: var(--bg-secondary);
    overflow-x: auto;
    flex-shrink: 0;
}

.still-slots-row {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    min-width: max-content;
}

.still-slots-divider {
    width: 1px;
    height: 140px;
    background: var(--bordo);
    margin: 0 0.25rem;
    flex-shrink: 0;
    align-self: center;
}

.still-numbered-zone {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: nowrap;
}

.still-slot-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.still-slot-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grigio);
}

/* Cover box */
.still-cover-box {
    width: 105px;
    height: 140px;
    border: 1.5px solid #c4a43a;
    border-radius: 6px;
    background: #fdfbf5;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.still-cover-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #f5f4f0;
}
.still-cover-empty {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}
.still-cover-star-hint {
    font-size: 1.4rem;
    color: #c4a43a;
    opacity: 0.5;
}
.still-cover-hint-txt {
    font-size: 0.55rem;
    color: var(--grigio);
    text-align: center;
    line-height: 1.4;
    letter-spacing: 0.02em;
}

/* Drop zones */
.still-drop-zone {
    width: 95px;
    height: 126px;
    border: 1.5px solid var(--bordo);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bianco);
    position: relative;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.still-drop-zone.sortable-over { border-color: var(--verde); border-style: dashed; }
.still-drop-zone.sortable-ghost { opacity: 0.4; }

.still-drop-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pool card when inside a slot */
.still-slot-clone {
    width: 100%;
    height: 100%;
    cursor: grab;
    position: relative;
}
.still-slot-clone:active { cursor: grabbing; }
.still-slot-clone .still-pool-footer { display: none; }
.still-slot-clone .still-cover-btn,
.still-slot-clone .still-abbinati-btn,
.still-slot-clone .still-slot-badge { display: none !important; }

.still-slot-nome {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.52);
    color: #fff;
    font-size: 0.54rem;
    letter-spacing: 0.04em;
    padding: 2px 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.still-slot-remove-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    cursor: pointer;
    color: #c00;
    font-size: 0.9rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.12s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.still-slot-clone:hover .still-slot-remove-btn { opacity: 1; }

/* Bottone + aggiungi slot */
.still-add-slot-btn {
    width: 40px;
    height: 126px;
    border: 1.5px dashed var(--bordo);
    border-radius: 6px;
    background: transparent;
    color: var(--grigio);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
}
.still-add-slot-btn:hover { border-color: var(--nero); color: var(--nero); }

/* ── Pool ──────────────────────────────────────────────── */

.still-pool-section {
    flex: 1;
    padding: 1rem 1.5rem 1.5rem;
    overflow-y: auto;
    min-height: 0;
}

.still-pool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    font-size: 0.72rem;
    color: var(--grigio);
    letter-spacing: 0.03em;
}
.still-pool-count {
    font-weight: 600;
    color: var(--testo);
    font-size: 0.72rem;
}

.still-pool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    min-height: 60px;
}

/* Pool card */
.still-pool-card {
    cursor: grab;
    border: 1px solid var(--bordo);
    border-radius: 7px;
    overflow: visible;
    background: var(--bianco);
    transition: box-shadow 0.15s;
    position: relative;
}
.still-pool-card:active { cursor: grabbing; }
.still-pool-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.1); }

.still-pool-img-wrap {
    aspect-ratio: 3 / 4;
    background: #f5f4f0;
    overflow: hidden;
    border-radius: 6px 6px 0 0;
}
.still-pool-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.still-pool-img-wrap.no-foto {
    display: flex;
    align-items: center;
    justify-content: center;
}
.still-pool-img-wrap.no-foto::after { content: '—'; color: #ccc; font-size: 1.2rem; }

.still-pool-footer {
    display: flex;
    align-items: center;
    padding: 0.2rem 0.45rem 0;
}
.still-pool-nome {
    font-size: 0.58rem;
    color: var(--grigio);
    letter-spacing: 0.03em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Bottone "vedi abbinati" sotto le pool card */
.still-abbinati-btn {
    display: block;
    width: calc(100% - .6rem);
    margin: 0.2rem 0.3rem 0.3rem;
    padding: 0.22rem 0;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: center;
    background: transparent;
    border: 1px solid var(--bordo);
    border-radius: 4px;
    cursor: pointer;
    color: var(--grigio-testo);
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.still-abbinati-btn:hover {
    background: var(--bg-secondary);
    border-color: #999;
    color: var(--nero);
}

/* Bottone ★ copertina */
.still-cover-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.88);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #aaa;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.12s, color 0.12s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    line-height: 1;
}
.still-pool-card:hover .still-cover-btn { opacity: 1; }
.still-cover-btn.is-cover {
    opacity: 1;
    color: #c4a43a;
    background: rgba(255,255,255,0.96);
}
.still-cover-btn:hover { color: #c4a43a; }

/* Slot badge (numero slot su card del pool) */
/* Badge slot sulle pool card (numero in alto a sinistra) */
.still-slot-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--nero);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    z-index: 3;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.still-slot-badge.visible { display: flex; }

/* ── Overlay & Popup (condivisi) ───────────────────────── */

.sp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 900;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.sp-overlay.open { display: flex; }

/* Popup base: 80% schermo */
.sp-popup {
    background: var(--bianco);
    border-radius: 10px;
    box-shadow: 0 12px 50px rgba(0,0,0,0.28);
    position: relative;
    width: 80vw;
    height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sp-popup-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--testo);
    z-index: 10;
    transition: background 0.12s;
}
.sp-popup-close:hover { background: var(--bordo); }

/* ── Popup 1: Prodotti abbinati ────────────────────────── */

/* ── Popup 1: layout interno ───────────────────────────── */

/* Griglia still | contenuto — riempie tutto il popup */
.sp-popup-inner {
    display: grid;
    grid-template-columns: 22% 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Colonna still (sinistra) */
.sp-popup-still-col {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-right: 1px solid var(--bordo);
    background: #fafaf8;
    gap: 0.4rem;
    overflow: hidden;
}
.sp-popup-still-img {
    width: 100%;
    flex: 1;
    min-height: 0;
    object-fit: contain;
    border-radius: 5px;
    background: #f0ede8;
    display: block;
}
.sp-popup-still-nome {
    font-size: 0.65rem;
    color: var(--grigio);
    text-align: center;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

/* Colonna griglia (destra) */
.sp-popup-content-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.sp-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bordo);
    flex-shrink: 0;
}
.sp-popup-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.1rem;
    letter-spacing: 0.02em;
}
.sp-popup-count {
    font-size: 0.68rem;
    color: var(--grigio);
}

/* Griglia 3×3 — NO scroll, riempie lo spazio disponibile */
.spp-grid-wrap {
    flex: 1;
    min-height: 0;
    padding: 0.6rem 0.9rem;
    display: flex;         /* chain flex per passare l'altezza */
    flex-direction: column;
    overflow: hidden;
}

.spp-preview-grid {
    flex: 1;              /* riempie il wrap */
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);   /* 3 righe di altezza uguale */
    gap: 0.45rem;
}

/* Slot fisso */
.spp-slot {
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    min-height: 0;
}
.spp-slot-empty {
    border: 2px dashed #ddd;
    background: #fafaf8;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.spp-slot-empty:hover {
    border-color: #aaa;
    background: #f2f1ed;
}
.spp-slot.spp-drag-over {
    outline: 2.5px solid var(--verde);
    background: #f0faf4;
}

/* Placeholder slot vuoto: + al centro, numero in alto a destra */
.spp-slot-ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.spp-slot-num {
    position: absolute;
    top: 5px;
    right: 6px;
    font-size: 0.58rem;
    font-weight: 700;
    color: #ccc;
    letter-spacing: 0.05em;
    user-select: none;
}
.spp-slot-plus {
    font-size: 1.6rem;
    font-weight: 300;
    color: #ccc;
    line-height: 1;
    user-select: none;
    transition: color 0.12s;
}
.spp-slot-empty:hover .spp-slot-plus { color: #888; }

/* Card prodotto nel slot — riempie la cella */
.spp-gc {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bianco);
    border: 1px solid var(--bordo);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.12s;
}
.spp-gc:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.spp-gc:active { cursor: grabbing; }
.spp-gc-dragging { opacity: 0.28; }

.spp-gc-img {
    flex: 1;
    min-height: 0;
    background: #f5f4f0;
    overflow: hidden;
    position: relative;
}
.spp-gc-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.spp-gc-img.no-foto { display: flex; align-items: center; justify-content: center; }
.spp-gc-img.no-foto::after { content: '—'; color: #ccc; font-size: 1rem; }

.spp-gc-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    border: none;
    cursor: pointer;
    color: #c00;
    font-size: 0.85rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.12s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    z-index: 2;
}
.spp-gc:hover .spp-gc-remove { opacity: 1; }

/* Testo card — compatto per stare nella cella */
.spp-gc-ref  { font-size: 0.58rem; font-weight: 700; letter-spacing: 0.04em; padding: 2px 4px 1px; flex-shrink: 0; }
.spp-gc-desc { font-size: 0.52rem; color: var(--grigio); padding: 0 4px 2px; line-height: 1.3; flex-shrink: 0; }
.spp-gc-unknown .spp-gc-img { background: #f8f5f0; }

/* Footer popup 1 */
.sp-popup-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--bordo);
    flex-shrink: 0;
    background: var(--bianco);
}
.sp-popup-count-sm { font-size: 0.7rem; color: var(--grigio); }

/* ── Popup 2: Picker ────────────────────────────────────── */

.sp-popup-wide {
    width: 80vw;
    height: 80vh;
}

/* Header: [search] [tabs] · X assoluta in alto a destra */
.sp-picker-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    padding-right: 3rem; /* spazio per il bottone X */
    border-bottom: 1px solid var(--bordo);
    background: var(--bianco);
    flex-shrink: 0;
}

.sp-picker-tabs {
    display: flex;
    gap: 0.2rem;
}
.sp-picker-tab {
    padding: 0.3rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid var(--bordo);
    border-radius: 20px;
    background: transparent;
    color: var(--grigio-testo);
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    white-space: nowrap;
}
.sp-picker-tab:hover { border-color: #999; color: var(--nero); }
.sp-picker-tab.active { background: var(--nero); border-color: var(--nero); color: #fff; }

/* Search field */
.sp-picker-search {
    width: 180px;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--bordo);
    border-radius: 20px;
    font-size: 0.7rem;
    background: var(--bg-secondary);
    outline: none;
    transition: border-color 0.12s;
    flex-shrink: 0;
}
.sp-picker-search:focus { border-color: #999; background: #fff; }
.sp-picker-search::placeholder { color: #bbb; }

/* Body: [still+suggeriti] | [griglia prodotti] */
.sp-picker-body {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

/* Colonna still + ref suggerite */
.sp-picker-still-col {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid var(--bordo);
    background: #fafaf8;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;
    overflow-y: auto;
}
.sp-picker-still-img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: contain;
    background: #f0ede8;
    border-radius: 5px;
    flex-shrink: 0;
    display: block;
}
.sp-picker-still-nome {
    font-size: 0.65rem;
    color: var(--grigio);
    text-align: center;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}
.sp-picker-sug-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grigio);
    flex-shrink: 0;
}
.sp-picker-sug-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.sp-sug-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--bordo);
    border-radius: 5px;
    cursor: pointer;
    background: var(--bianco);
    transition: background 0.1s, border-color 0.1s;
}
.sp-sug-card:hover { background: #f0ede8; border-color: #c4a43a; }
.sp-sug-foto {
    width: 32px;
    height: 32px;
    border-radius: 3px;
    background: #f5f4f0;
    overflow: hidden;
    flex-shrink: 0;
}
.sp-sug-foto img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sp-sug-foto.no-foto { display: flex; align-items: center; justify-content: center; }
.sp-sug-foto.no-foto::after { content: '—'; font-size: 0.6rem; color: #ccc; }
.sp-sug-ref { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.03em; }
.sp-sug-desc { font-size: 0.56rem; color: var(--grigio); margin-top: 1px; }
.sp-sug-card.in-grid { border-color: #4a9e5c; background: #f2faf4; }

/* Scroll wrapper (destra) — flex child puro, gestisce overflow */
.sp-picker-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 0.85rem 1rem;
}

/* Griglia prodotti — espande per contenuto, auto-fill almeno 130px */
.sp-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    align-content: start;
}

/* Card picker — layout identico allo screenshot prodotto */
.pkr-card {
    border: 2px solid transparent;
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.12s, box-shadow 0.12s, transform 0.08s;
    user-select: none;
}
.pkr-card:hover {
    border-color: #c4a882;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.pkr-card.pkr-hidden { display: none; }

/* Già presente nella griglia 3×3 della still corrente */
.pkr-card.pkr-card-in-grid {
    cursor: default;
    border-color: #4a9e5c;
    box-shadow: inset 0 0 0 1px #4a9e5c22;
}
.pkr-card.pkr-card-in-grid:hover {
    transform: none;
    box-shadow: inset 0 0 0 1px #4a9e5c22;
}

/* Già abbinata a un'altra still: oscurata */
.pkr-card.pkr-card-used {
    opacity: 0.38;
    cursor: not-allowed;
}
.pkr-card.pkr-card-used:hover {
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

/* Badge/overlay sulle card picker */
.pkr-card-overlay {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    pointer-events: none;
    z-index: 3;
    line-height: 1.4;
}
.pkr-card-overlay-check {
    background: #4a9e5c;
    color: #fff;
}
.pkr-card-overlay-used {
    background: #999;
    color: #fff;
}

/* Il pkr-card deve essere relative per l'overlay */
.pkr-card { position: relative; }

/* Immagine prodotto */
.pkr-img-wrap {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f4f0;
    overflow: hidden;
}
.pkr-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.pkr-img-wrap.no-foto {
    display: flex;
    align-items: center;
    justify-content: center;
}
.pkr-img-wrap.no-foto::after {
    content: '—';
    color: #ccc;
    font-size: 1rem;
}

/* Info prodotto */
.pkr-info { padding: 0.45rem 0.5rem 0.55rem; }
.pkr-ref {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--nero);
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pkr-tipo {
    font-size: 0.58rem;
    color: var(--grigio);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.2rem;
}
.pkr-row2 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.2rem;
}
.pkr-colore { font-size: 0.62rem; color: var(--grigio-testo); }
.pkr-prezzo { font-size: 0.72rem; font-weight: 700; color: var(--nero); white-space: nowrap; }
.pkr-details {
    border-top: 1px solid #eee;
    padding-top: 0.2rem;
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}
.pkr-peso { font-size: 0.6rem; color: var(--grigio-testo); }
.pkr-diam { font-size: 0.6rem; color: var(--grigio-testo); }

/* ── Gestione Utenti ────────────────────────────────────────────────────── */

/* Tab nav */
.tab-nav { display: flex; gap: .25rem; border-bottom: 2px solid var(--bordo); }
.tab-btn {
    padding: .5rem 1.25rem;
    font-size: .9rem;
    color: var(--grigio-testo);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: color .15s;
}
.tab-btn:hover { color: var(--nero); }
.tab-btn.active { color: var(--nero); font-weight: 700; border-bottom-color: var(--nero); }
.tab-count {
    background: var(--bg2);
    color: var(--grigio-testo);
    font-size: .75rem;
    font-weight: 600;
    padding: .1rem .45rem;
    border-radius: 99px;
}
.tab-btn.active .tab-count { background: var(--nero); color: #fff; }

/* KPI grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-card {
    background: #fff;
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}
.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--nero);
    line-height: 1.2;
}
.kpi-label {
    font-size: .8rem;
    color: var(--grigio);
    margin-top: .25rem;
}

/* Charts grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.chart-card {
    background: #fff;
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}
.chart-card--wide { grid-column: 1; }
.chart-header {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    margin-bottom: 1rem;
}
.chart-title { font-weight: 700; font-size: .95rem; }
.chart-subtitle { font-size: .78rem; color: var(--grigio); }
.chart-body { position: relative; }
.chart-body--pie { max-width: 260px; margin: 0 auto; }

/* Analytics grid */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.table-card--full { grid-column: 1 / -1; }

/* Table card */
.table-card {
    background: #fff;
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    overflow: hidden;
}
.table-card-header {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--bordo);
}
.table-card-title { font-weight: 700; font-size: .9rem; }
.table-card-subtitle { font-size: .78rem; color: var(--grigio); }

/* Compact table */
.data-table--compact td, .data-table--compact th {
    padding: .45rem .9rem;
    font-size: .85rem;
}
.data-table--log td, .data-table--log th {
    padding: .35rem .8rem;
    font-size: .8rem;
}

/* Count bar */
.count-bar-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    justify-content: flex-end;
}
.count-bar {
    display: inline-block;
    height: 6px;
    background: var(--gold);
    border-radius: 3px;
    opacity: .5;
    min-width: 4px;
}
.count-bar-val { font-weight: 600; font-size: .83rem; min-width: 24px; text-align: right; }

/* Status pills */
.status-pill {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 99px;
    font-size: .75rem;
    font-weight: 600;
}
.status-active  { background: var(--verde-bg); color: var(--verde); }
.status-inactive { background: var(--rosso-bg); color: var(--rosso); }

/* Badge lingua */
.badge-lingua {
    background: var(--bg2);
    color: var(--grigio-testo);
    font-size: .72rem;
    font-weight: 700;
    padding: .1rem .4rem;
    border-radius: 4px;
    letter-spacing: .04em;
}
.badge-active   { background: var(--verde-bg); color: var(--verde); }
.badge-inactive { background: var(--rosso-bg); color: var(--rosso); }

/* Event type badges */
.event-badge {
    display: inline-block;
    padding: .1rem .45rem;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 600;
    background: var(--bg2);
    color: var(--grigio-testo);
}
.event-login    { background: #e8f4e8; color: #2d6a2d; }
.event-logout   { background: #fdf0e8; color: #8a4000; }
.event-view_catalog  { background: #e8eef8; color: #1a3a7a; }
.event-view_product  { background: #f0e8f8; color: #5a1a8a; }
.event-add_cart      { background: #fff8e0; color: #7a5a00; }
.event-checkout      { background: #e0f0ff; color: #004a8a; }
.event-heartbeat     { background: #f0f0f0; color: #888; }

/* Misc */
.row-disabled td { opacity: .5; }
.empty-state-sm { padding: 1.5rem; text-align: center; color: var(--grigio); font-size: .85rem; }
.font-mono { font-family: 'Courier New', monospace; }
.text-sm { font-size: .82rem; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* form-static */
.form-static {
    padding: .5rem .75rem;
    background: var(--bg2);
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    font-size: .9rem;
    color: var(--grigio-testo);
}
