/* ============================================================
   Darplee — DEMO app shell (replica fedele dell'app reale)
   Tema chiaro, sidebar scura. Dati statici di esempio.
   ============================================================ */

:root {
    /* Valori presi 1:1 dal componente reale (AppShell.tsx + style.css), non dedotti */
    --d-bg:        #F5F6FC;
    --d-card:      rgba(255,255,255,.86);
    --d-border:    rgba(107,91,210,.20);
    --d-line:      rgba(107,91,210,.12);
    --d-text:      #1a1f33;
    --d-muted:     #5d6480;
    --d-faint:     #9099b5;

    /* Sidebar: BIANCA in tema chiaro (AppShell.tsx pal.bg), non navy — quella era una
       variabile CSS legacy/inutilizzata in style.css, non quello che il componente renderizza. */
    --d-side:      #ffffff;
    --d-side-line: rgba(27,30,59,.08);
    --dp-ic:       #8A6FB0;
    --dp-tx:       #3A3E63;
    --dp-ink:      #1B1E3B;
    --dp-mut:      #6A6F92;
    --dp-hov:      rgba(139,89,201,.09);
    --dp-dot:      #C2A0D6;
    --dp-chip:     rgba(139,89,201,.12);
    --dp-chip-tx:  #7A4FB0;

    --magenta:     #C64291;
    --teal:        #009BB0;
    --indigo:      #6d5ce7;
    --green:       #16a34a;
    --red:         #e0405a;
    --orange:      #e0913a;
    --yellow:      #e0b13a;
    --grad:        linear-gradient(120deg, #C64291 0%, #8B59C9 52%, #009BB0 100%);
    --grad-soft:   linear-gradient(120deg, rgba(198,66,145,.12), rgba(0,155,176,.12));

    --d-radius:    16px;
    --d-radius-s:  11px;
    --d-shadow:    0 4px 24px rgba(14,37,71,.06), 0 1px 3px rgba(0,0,0,.04);
}

/* Tema scuro: NON implementato in questa demo — troppi colori fissi (non
   variabili CSS) sparsi nel resto del foglio avrebbero reso alcune sezioni
   poco leggibili. "Tema scuro" nella sidebar è un .demo-locked (toast),
   scelta deliberata invece di spedire un dark mode mezzo funzionante. */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--d-bg); color: var(--d-text);
    -webkit-font-smoothing: antialiased; line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
/* Sora per titoli/sidebar, Inter per il corpo — stessa coppia font dell'app reale */
h1,h2,h3,h4 { font-family: 'Sora', 'Inter', sans-serif; }
.side-logo, .user .nm, .merch, .side-btn, .dp-secname { font-family: 'Sora', 'Inter', sans-serif; }
.num { font-variant-numeric: tabular-nums; }

/* Badge quadrato a gradiente (titolo di pagina + icone KPI) — stesso identico
   pattern inline usato in DashboardPage.tsx (page-title / Tile): 34x34, radius 9,
   gradiente pieno, icona Tabler bianca. NON badge di colore diverso per voce. */
.grad-badge {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 34px; height: 34px; border-radius: 9px; background: var(--grad); color: #fff; font-size: 18px;
}
.grad-badge.sm { width: 32px; height: 32px; font-size: 16px; }

/* ---------- Demo banner ---------- */
.demo-banner {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
    background: var(--grad); color: #fff; padding: 10px 18px; font-size: 14px; font-weight: 500;
}
.demo-banner b { font-weight: 700; }
.demo-banner .acts { display: flex; gap: 10px; }
.demo-banner a {
    font-family: 'Inter'; font-weight: 600; font-size: 13px; padding: 7px 15px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.5); transition: background .15s;
}
.demo-banner a.solid { background: #fff; color: #5a2a78; border-color: #fff; }
.demo-banner a:hover { background: rgba(255,255,255,.18); }
.demo-banner a.solid:hover { background: #f2f0ff; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

/* ---------- Sidebar (1:1 con .dp-row/.dp-sub/.dp-secname di AppShell.tsx) ---------- */
.side {
    background: var(--d-side); border-right: 1px solid var(--d-side-line);
    color: var(--dp-tx); display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh; font-family: 'Sora', system-ui, sans-serif;
}
.side-scroll { flex: 1; overflow-y: auto; padding: 16px 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.side-scroll::-webkit-scrollbar { width: 6px; }
.side-scroll::-webkit-scrollbar-thumb { background: rgba(107,91,210,.18); border-radius: 6px; }
.side-logo { padding: 4px 8px 12px; }
.side-logo img { height: 26px; }
.user { display: flex; align-items: center; gap: 10px; padding: 0 8px 14px; }
.user .av {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    background: var(--dp-chip); color: var(--dp-chip-tx); font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user .nm { font-weight: 600; font-size: 14px; color: var(--dp-ink); }
.user .rl { font-size: 11.5px; color: var(--dp-mut); }

.dp-secname { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--dp-mut); font-weight: 600; padding: 14px 12px 5px; opacity: .85; }
.menu { display: flex; flex-direction: column; gap: 1px; }
.menu a, .menu button.dp-row {
    display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
    font-size: 14px; font-weight: 500; color: var(--dp-tx); transition: background .12s, color .12s;
    border: none; background: none; width: 100%; text-align: left; cursor: pointer; font-family: inherit;
}
.menu a .ic { width: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--dp-ic); font-size: 16px; }
.menu a:hover, .menu button.dp-row:hover { background: var(--dp-hov); color: var(--dp-ink); }
.menu a.active {
    background: var(--grad); color: #fff; font-weight: 600;
    box-shadow: 0 10px 22px -13px rgba(198,66,145,.6);
}
.menu a.active .ic { color: #fff; }
.menu a .count { margin-left: auto; font-size: 11px; color: var(--dp-mut); font-variant-numeric: tabular-nums; }
.menu a .flag { width: 20px; flex-shrink: 0; }
.dp-chev { margin-left: auto; color: var(--dp-mut); display: inline-flex; padding: 4px; transition: transform .2s; }
.dp-chev.open { transform: rotate(180deg); }
.menu a.active .dp-chev { color: #fff; }
.submenu { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 4px; }
.dp-sub {
    display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 32px; border-radius: 9px;
    font-size: 13px; font-weight: 500; color: var(--dp-mut); transition: background .12s, color .12s;
}
.dp-sub:hover { background: var(--dp-hov); color: var(--dp-ink); }
.dp-sub.active { color: var(--dp-ink); font-weight: 600; }
.dp-sub.active .dp-dot { background: var(--grad); transform: scale(1.4); }
.dp-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--dp-dot); flex-shrink: 0; }
.dp-sub .flag { width: 18px; flex-shrink: 0; }
.dp-sub .count { margin-left: auto; font-size: 11px; color: var(--dp-mut); }

/* Sidebar footer */
.side-foot { border-top: 1px solid var(--d-side-line); padding: 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.side-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 8px 12px;
    border-radius: 8px; font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--d-side-line);
    background: transparent; color: var(--dp-tx); font-family: 'Sora', sans-serif;
}
.side-btn.chip { background: var(--dp-chip); color: var(--dp-chip-tx); }
.side-btn.grad { background: var(--grad); color: #fff; border: none; font-size: 13px; padding: 9px 12px; }
.side-btn.danger { background: rgba(239,68,68,.14); color: #ef4444; border-color: rgba(239,68,68,.3); }
.side-btn.safe { background: rgba(16,185,129,.14); color: #10b981; border-color: rgba(16,185,129,.3); }
.fontctl { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border: 1px solid var(--d-side-line); border-radius: 8px; }
.fontctl .lbl { font-size: 11px; color: var(--dp-mut); flex: 1; }
.fontctl button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--d-side-line); background: transparent; color: var(--dp-ink); cursor: pointer; font-size: 13px; font-weight: 700; }
.lang-toggle { display: flex; border: 1px solid var(--d-side-line); border-radius: 8px; overflow: hidden; }
.lang-toggle a { flex: 1; text-align: center; font-size: 12px; font-weight: 600; padding: 6px 0; color: var(--dp-mut); }
.lang-toggle a.on { background: var(--dp-chip); color: var(--dp-ink); }

/* ---------- Main ---------- */
.main { padding: 22px 26px 70px; position: relative; min-width: 0; }
.main-top { display: flex; justify-content: center; }
.update-pill { display: inline-flex; margin: 0 auto 16px; background: #1c1d2e; color: #fff; font-size: 12.5px; font-weight: 600; padding: 8px 18px; border-radius: 999px; box-shadow: var(--d-shadow); }

.head-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.head-row h1 { font-size: 30px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.period { display: flex; align-items: center; gap: 9px; }
.period .lbl { color: var(--d-muted); font-size: 13px; }
.period .pick { background: var(--d-card); border: 1px solid var(--d-border); border-radius: 9px; padding: 8px 14px; color: var(--d-faint); font-size: 13px; }
.period .reset { background: var(--d-card); border: 1px solid var(--d-border); border-radius: 9px; padding: 8px 12px; font-size: 12.5px; cursor: pointer; }

.kpi-ref { color: var(--d-muted); font-size: 12.5px; font-weight: 600; margin: 16px 0 0; }
.kpi-ref b { color: var(--indigo); }

/* KPI cards */
.kpi-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 14px; }
.kpic { background: var(--d-card); border: 0.5px solid var(--d-border); border-radius: 12px; padding: 14px; box-shadow: var(--d-shadow); }
.kpic .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 18px; margin-bottom: 12px; }
.kpic .lbl { color: var(--d-muted); font-size: 12.5px; }
.kpic .val { font-family: 'Inter'; font-weight: 700; font-size: 27px; margin-top: 3px; }
.kpic .spark { height: 28px; margin-top: 8px; }

/* Warning */
.warn { display: flex; align-items: center; gap: 11px; margin-top: 20px; background: #fdf6e3; border: 1px solid #f0e2b6; color: #9a7b1f; border-radius: 13px; padding: 13px 17px; font-size: 14px; font-weight: 500; }
.warn b { font-weight: 700; }

/* Metric cards */
.metrics-head { display: flex; justify-content: flex-end; margin: 22px 0 10px; }
.metrics-head .expand { background: var(--d-card); border: 1px solid var(--d-border); border-radius: 9px; padding: 7px 15px; font-size: 12.5px; cursor: pointer; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (min-width: 1280px) { .metrics { grid-template-columns: repeat(6, 1fr); } }
.metric { background: var(--d-card); border: 1px solid var(--d-border); border-radius: var(--d-radius); padding: 16px; box-shadow: var(--d-shadow); }
.metric .top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.metric .top .ic { font-size: 16px; }
.metric .top .nm { font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--d-muted); }
.metric .top .plus { margin-left: auto; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--d-border); display: grid; place-items: center; color: var(--d-faint); font-size: 14px; }
.metric .big { font-family: 'Inter'; font-weight: 800; font-size: 24px; }
.metric .big.g { color: var(--green); } .metric .big.i { color: var(--indigo); } .metric .big.r { color: var(--red); }
.metric .foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: 11.5px; color: var(--d-muted); }
.metric .foot b { color: var(--d-text); font-weight: 600; }

/* ---------- Marketplace summary + table ---------- */
.mk-title { font-size: 20px; font-weight: 700; margin: 32px 0 14px; }
.mk-tabs { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-bottom: 12px; }
.mk-tab { background: var(--d-card); border: 1px solid var(--d-border); border-radius: 9px; padding: 8px 14px; font-size: 12.5px; cursor: pointer; }
.mk-tab.on { background: var(--grad-soft); border-color: transparent; color: var(--indigo); font-weight: 600; }

.mk-summary { background: var(--d-card); border: 1px solid var(--d-border); border-radius: var(--d-radius); padding: 20px 24px; box-shadow: var(--d-shadow); }
.mk-sum-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr 1.1fr; gap: 18px; align-items: center; }
.mk-sum-grid .cell { text-align: center; }
.mk-sum-grid .cell .h { font-size: 11px; color: var(--d-faint); letter-spacing: .07em; font-weight: 700; }
.mk-sum-grid .cell .v { font-family: 'Inter'; font-weight: 800; font-size: 24px; margin-top: 3px; }
.mk-sum-grid .cell .v.green { color: var(--green); }
.mk-sum-grid .cell .delta { font-size: 12px; font-weight: 600; margin-top: 2px; }
.mk-sum-grid .cell .delta.up { color: var(--green); } .mk-sum-grid .cell .delta.down { color: var(--red); }
.mk-sum-grid .cell.left { text-align: left; }
.mk-sum-grid .cell .ttl { font-family: 'Inter'; font-weight: 700; font-size: 17px; }
.mk-sum-grid .cell .sub { color: var(--d-muted); font-size: 12.5px; }
.mk-sum-grid .cell.note { text-align: right; color: var(--d-faint); font-size: 12px; }

.mk-table { width: 100%; margin-top: 16px; background: var(--d-card); border: 1px solid var(--d-border); border-radius: var(--d-radius); box-shadow: var(--d-shadow); overflow: hidden; }
.mk-table table { width: 100%; border-collapse: collapse; }
.mk-table th { text-align: right; font-size: 10.5px; letter-spacing: .07em; color: var(--d-faint); font-weight: 700; padding: 14px 18px; border-bottom: 1px solid var(--d-line); }
.mk-table th:first-child { text-align: left; }
.mk-table td { padding: 13px 18px; border-bottom: 1px solid var(--d-line); text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.mk-table tr:last-child td { border-bottom: 0; }
.mk-table tr:hover td { background: #faf9ff; }
.mk-table td:first-child { text-align: left; }
.mk-country { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mk-country .flag { font-size: 17px; }
.alert-badge { display: inline-flex; align-items: center; gap: 3px; background: rgba(224,64,90,.1); color: var(--red); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.mk-margin { font-weight: 700; color: var(--green); }
.mk-mom { font-weight: 700; color: var(--red); }
.mk-trend svg { width: 90px; height: 22px; vertical-align: middle; }

/* ---------- Top prodotti ---------- */
.section-h { display: flex; align-items: center; justify-content: space-between; margin: 34px 0 6px; }
.section-h h2 { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.section-h .sel { background: var(--d-card); border: 1px solid var(--d-border); border-radius: 9px; padding: 8px 14px; font-size: 12.5px; }
.section-sub { color: var(--d-muted); font-size: 13px; margin-bottom: 14px; }
.section-sub b { color: var(--d-text); }

.top-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.top-card { display: flex; align-items: center; gap: 10px; background: var(--d-card); border: 1px solid var(--d-border); border-radius: var(--d-radius-s); padding: 10px; box-shadow: var(--d-shadow); transition: transform .12s; }
.top-card:hover { transform: translateY(-2px); }
.top-card .rank { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; font-family: 'Inter'; }
.top-card .ph { width: 42px; height: 42px; flex: none; border-radius: 9px; }
.top-card .info { min-width: 0; flex: 1; }
.top-card .l1 { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--d-faint); }
.top-card .l1 .mk { background: var(--grad-soft); color: var(--indigo); font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.top-card .ti { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 2px 0; }
.top-card .l3 { display: flex; align-items: baseline; gap: 8px; }
.top-card .rev { font-family: 'Inter'; font-weight: 700; font-size: 15px; }
.top-card .uu { font-size: 11px; color: var(--d-muted); }
.top-card .uu b { color: var(--green); }

/* ---------- Allerta marginalità ---------- */
.alert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.alert-card { display: flex; align-items: center; gap: 10px; background: var(--d-card); border: 1px solid var(--d-border); border-left: 3px solid var(--red); border-radius: var(--d-radius-s); padding: 10px 12px; box-shadow: var(--d-shadow); }
.alert-card .ph { width: 38px; height: 38px; flex: none; border-radius: 8px; }
.alert-card .info { min-width: 0; flex: 1; }
.alert-card .mk { font-size: 10px; color: var(--d-faint); font-weight: 700; }
.alert-card .ti { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-card .l3 { display: flex; justify-content: space-between; margin-top: 2px; }
.alert-card .mg { color: var(--red); font-weight: 700; font-size: 13px; }
.alert-card .rv { color: var(--d-muted); font-size: 12px; }

/* ---------- Attività recente ---------- */
.activity { background: var(--d-card); border: 1px solid var(--d-border); border-radius: var(--d-radius); padding: 8px 20px; box-shadow: var(--d-shadow); }
.act-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--d-line); }
.act-row:last-child { border-bottom: 0; }
.act-row .ico { font-size: 18px; }
.act-row .main-t { font-size: 14px; font-weight: 600; }
.act-row .main-t .x { color: var(--d-faint); font-weight: 500; font-size: 12px; margin-left: 6px; }
.act-row .sub-t { font-size: 12px; color: var(--d-muted); font-family: ui-monospace, monospace; }

/* ---------- Prodotti (catalogo) ---------- */
.view-head h1 { font-size: 26px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.flag-sel { display: flex; gap: 5px; flex-wrap: wrap; }
.flag-sel a { width: 30px; height: 26px; display: grid; place-items: center; border-radius: 7px; font-size: 16px; border: 1px solid var(--d-border); background: var(--d-card); filter: grayscale(.4); opacity: .8; }
.flag-sel a.on { filter: none; opacity: 1; border-color: var(--indigo); box-shadow: 0 0 0 2px rgba(109,92,231,.2); }

.act-btns { display: flex; gap: 9px; flex-wrap: wrap; margin: 14px 0; }
.act-btn { background: var(--d-card); border: 1px solid var(--d-border); border-radius: 9px; padding: 9px 15px; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.act-btn.on { background: var(--grad); color: #fff; border-color: transparent; }
.act-btn.warn { color: var(--orange); border-color: rgba(224,145,58,.4); }
.lead-txt { color: var(--d-muted); font-size: 13px; margin-bottom: 14px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .search { flex: 1; min-width: 200px; background: var(--d-card); border: 1px solid var(--d-border); border-radius: 9px; padding: 10px 14px; font-size: 13px; color: var(--d-muted); }
.filters .drop { background: var(--d-card); border: 1px solid var(--d-border); border-radius: 9px; padding: 9px 14px; font-size: 12.5px; color: var(--d-muted); }
.filters .ck { font-size: 12.5px; color: var(--d-muted); display: inline-flex; align-items: center; gap: 6px; }
.filters .toggle { display: flex; background: var(--d-card); border: 1px solid var(--d-border); border-radius: 9px; padding: 3px; }
.filters .toggle span { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 7px; color: var(--d-muted); }
.filters .toggle span.on { background: var(--grad); color: #fff; }
.filters .count { font-size: 12px; color: var(--d-faint); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { background: var(--d-card); border: 1px solid var(--d-border); border-radius: 9px; padding: 8px 12px; font-size: 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; color: var(--d-muted); }
.chip:hover { border-color: var(--indigo); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip .dot.g { background: var(--green); } .chip .dot.y { background: var(--yellow); } .chip .dot.o { background: var(--orange); } .chip .dot.r { background: var(--red); }

.hidden-note { display: flex; justify-content: space-between; align-items: center; background: #f0eff9; border-radius: 10px; padding: 11px 16px; font-size: 13px; color: var(--d-muted); margin-bottom: 16px; }
.hidden-note a { color: var(--indigo); font-weight: 600; }

/* Product cards (catalogo, dettagliate) */
.prod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 1100px) { .prod-grid { grid-template-columns: 1fr; } }
.prod {
    background: var(--d-card); border: 1px solid var(--d-border); border-left: 4px solid var(--d-faint);
    border-radius: var(--d-radius); padding: 16px; box-shadow: var(--d-shadow); cursor: pointer; transition: transform .12s, box-shadow .2s;
}
.prod:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -18px rgba(30,29,60,.3); }
.prod.s-green { border-left-color: var(--green); } .prod.s-yellow { border-left-color: var(--yellow); }
.prod.s-orange { border-left-color: var(--orange); } .prod.s-red { border-left-color: var(--red); }
.prod.s-purple { border-left-color: var(--indigo); }
.prod-top { display: flex; gap: 12px; }
.prod-top .ph { width: 64px; height: 64px; flex: none; border-radius: 10px; }
.prod-main { flex: 1; min-width: 0; }
.prod-row1 { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.asin-badge { font-family: ui-monospace, monospace; font-size: 11px; font-weight: 700; background: #f0eff9; color: var(--indigo); padding: 2px 7px; border-radius: 6px; letter-spacing: .02em; }
.mini-badge { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: #eceaf6; color: var(--d-muted); }
.mini-badge.flag { background: transparent; font-size: 13px; padding: 0; }
.seller-badge { font-size: 11px; color: var(--d-faint); }
.best-pos { margin-left: auto; text-align: right; }
.best-pos .p { font-family: 'Inter'; font-weight: 800; font-size: 16px; color: var(--green); }
.best-pos .s { font-size: 10px; color: var(--d-faint); display: block; }
.best-pos .p.oos { color: var(--orange); font-size: 13px; }
.prod-ti { font-size: 13.5px; font-weight: 600; line-height: 1.35; margin: 7px 0 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-meta { font-size: 11.5px; color: var(--d-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.prod-meta .stars { color: var(--orange); font-weight: 600; }
.prod-rank-cat { font-size: 11px; color: var(--d-faint); margin-top: 4px; }

.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; }
.tile { background: #faf9fe; border: 1px solid var(--d-line); border-radius: 10px; padding: 10px; text-align: center; }
.tile .h { font-size: 9.5px; color: var(--d-faint); text-transform: uppercase; letter-spacing: .04em; }
.tile .v { font-family: 'Inter'; font-weight: 700; font-size: 16px; margin-top: 3px; }
.tile .v.g { color: var(--green); } .tile .v.r { color: var(--red); } .tile .v.o { color: var(--orange); }
.tile .s { font-size: 9.5px; color: var(--d-faint); margin-top: 2px; }
.tiles.row2 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .tiles, .tiles.row2 { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Product detail ---------- */
.detail-bar { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.dprod { background: var(--d-card); border: 1px solid var(--d-border); border-radius: var(--d-radius); padding: 22px; box-shadow: var(--d-shadow); margin-bottom: 18px; }
.dprod-head { display: flex; gap: 18px; }
.dprod-head .ph { width: 110px; height: 110px; flex: none; border-radius: 12px; }
.dprod-head .info { flex: 1; min-width: 0; }
.dprod-flags { display: flex; gap: 5px; flex-wrap: wrap; margin: 8px 0; }
.dflag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 7px; background: #f0eff9; color: var(--d-muted); }
.dflag.on { background: rgba(22,163,74,.12); color: var(--green); border: 1px solid rgba(22,163,74,.3); }
.dprod-title { font-size: 17px; font-weight: 600; line-height: 1.35; }
.dprod-sub { font-size: 12.5px; color: var(--d-faint); margin-top: 8px; }
.ai-box { background: #f5f3fe; border: 1px dashed #cdc4f0; border-radius: 11px; padding: 12px 14px; margin-top: 12px; }
.ai-box .t { font-size: 12.5px; font-weight: 600; color: var(--indigo); margin-bottom: 8px; }
.ai-box .inp { display: flex; gap: 8px; }
.ai-box input { flex: 1; border: 1px solid var(--d-border); border-radius: 8px; padding: 9px 12px; font-size: 12.5px; background: #fff; }
.ai-box .save { background: var(--grad); color: #fff; border: 0; border-radius: 8px; padding: 9px 18px; font-size: 12.5px; font-weight: 600; }

.dtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 18px; }
.dtile { background: #faf9fe; border: 1px solid var(--d-line); border-radius: 11px; padding: 13px; text-align: center; }
.dtile .h { font-size: 9.5px; color: var(--d-faint); text-transform: uppercase; letter-spacing: .03em; }
.dtile .h .badge { color: var(--green); }
.dtile .h .badge.r { color: var(--red); }
.dtile .v { font-family: 'Inter'; font-weight: 800; font-size: 18px; margin-top: 4px; }
.dtile .v.g { color: var(--green); } .dtile .v.r { color: var(--red); } .dtile .v.o { color: var(--orange); }
.dtile .s { font-size: 9.5px; color: var(--d-faint); margin-top: 2px; }

.season { display: flex; align-items: center; gap: 10px; margin-top: 16px; background: #faf9fe; border: 1px solid var(--d-line); border-radius: 11px; padding: 13px 16px; font-size: 13px; }
.season b { font-weight: 700; }
.season .sub { color: var(--d-muted); }

/* Card generico per sezioni detail */
.dcard { background: var(--d-card); border: 1px solid var(--d-border); border-radius: var(--d-radius); padding: 22px; box-shadow: var(--d-shadow); margin-bottom: 18px; }
.dcard-h { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dcard-h h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.range-tabs { display: flex; gap: 6px; }
.range-tabs span { font-size: 12px; padding: 6px 12px; border-radius: 8px; color: var(--d-muted); cursor: pointer; }
.range-tabs span.on { background: var(--indigo); color: #fff; }

.chart-big { width: 100%; height: 200px; }
.chart-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.chart-meta .big { font-family: 'Inter'; font-weight: 800; font-size: 28px; }
.chart-meta .u { font-size: 13px; color: var(--d-muted); }
.chart-meta .up { color: var(--green); font-weight: 700; font-size: 13px; }
.chart-axis { display: flex; justify-content: space-between; font-size: 9px; color: var(--d-faint); margin-top: 4px; }

/* Recensioni */
.rev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.rev-cell .h { font-size: 11px; color: var(--d-faint); text-transform: uppercase; letter-spacing: .04em; }
.rev-cell .v { font-family: 'Inter'; font-weight: 800; font-size: 24px; margin-top: 4px; }
.rev-cell .v.star { color: var(--orange); }
.rev-cell .s { font-size: 11px; color: var(--green); }

/* Keyword table */
.kw-table { width: 100%; border-collapse: collapse; }
.kw-table th { text-align: right; font-size: 10px; letter-spacing: .06em; color: var(--d-faint); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--d-line); }
.kw-table th:first-child { text-align: left; }
.kw-table td { padding: 11px 12px; border-bottom: 1px solid var(--d-line); text-align: right; font-size: 13px; }
.kw-table td:first-child { text-align: left; font-weight: 500; }
.kw-sub { background: #f5f3fe; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--indigo); }
.kw-sub td { padding: 8px 12px; }
.org { font-weight: 700; } .org.good { color: var(--green); } .org.mid { color: var(--orange); } .org.bad { color: var(--red); }
.kw-status { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.kw-status.ok { background: rgba(22,163,74,.12); color: var(--green); }
.kw-status.low { background: rgba(224,145,58,.14); color: var(--orange); }
.kw-status.nf { background: rgba(224,64,90,.12); color: var(--red); }
.kw-noads { color: var(--d-faint); font-style: italic; font-size: 12px; }

/* PPC strategy */
.ppc-warn { background: #fdeef0; border: 1px solid #f3c6cd; color: #b33a4d; border-radius: 11px; padding: 12px 16px; font-size: 13px; margin-bottom: 14px; }
.ppc-reco { background: #f3f1fe; border: 1px solid #d4cdf3; border-radius: 11px; padding: 14px 16px; margin-bottom: 16px; position: relative; }
.ppc-reco .t { font-size: 12px; font-weight: 700; color: var(--indigo); margin-bottom: 6px; }
.ppc-reco p { font-size: 12.5px; color: var(--d-muted); }
.ppc-reco .pick { position: absolute; top: 14px; right: 16px; background: var(--teal); color: #fff; font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 7px; }
.strat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 1000px) { .strat-grid { grid-template-columns: repeat(2, 1fr); } }
.strat { background: #faf9fe; border: 1px solid var(--d-line); border-radius: 11px; padding: 15px; position: relative; }
.strat.on { border-color: var(--indigo); box-shadow: 0 0 0 2px rgba(109,92,231,.15); }
.strat .tag { position: absolute; top: -10px; left: 14px; background: var(--indigo); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 6px; }
.strat h4 { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.strat p { font-size: 11.5px; color: var(--d-muted); margin: 6px 0; }
.strat .nums { font-size: 11.5px; font-weight: 600; color: var(--d-text); }
.ppc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 16px; }
.ppc-kpi { background: #faf9fe; border: 1px solid var(--d-line); border-radius: 10px; padding: 12px; }
.ppc-kpi .h { font-size: 10px; color: var(--d-faint); text-transform: uppercase; letter-spacing: .03em; }
.ppc-kpi .v { font-family: 'Inter'; font-weight: 700; font-size: 17px; margin-top: 3px; }
.ppc-kpi .v.g { color: var(--green); } .ppc-kpi .v.r { color: var(--red); } .ppc-kpi .v.i { color: var(--indigo); }

/* Competitor list */
.comp-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--d-line); }
.comp-row:last-child { border-bottom: 0; }
.comp-row .rank { width: 30px; flex: none; font-size: 11px; font-weight: 700; color: #fff; background: var(--green); border-radius: 6px; text-align: center; padding: 3px 0; }
.comp-row .rank.hi { background: var(--indigo); }
.comp-row .ph { width: 42px; height: 42px; flex: none; border-radius: 8px; }
.comp-row .info { flex: 1; min-width: 0; }
.comp-row .asin { font-family: ui-monospace, monospace; font-size: 10.5px; color: var(--d-faint); }
.comp-row .ti { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-row .stars { font-size: 11px; color: var(--orange); }
.comp-row .price { text-align: right; flex: none; }
.comp-row .price .p { font-family: 'Inter'; font-weight: 700; font-size: 15px; }
.comp-row .price .u { font-size: 10.5px; color: var(--d-faint); }
.comp-row .price .d { font-size: 11px; font-weight: 700; }
.comp-row .price .d.up { color: var(--red); } .comp-row .price .d.down { color: var(--green); }

/* Floating actions */
.fabs { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 11px; z-index: 60; }
.fab { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; color: #fff; box-shadow: var(--d-shadow); cursor: pointer; border: 0; }
.fab.up { background: #fff; color: var(--indigo); border: 1px solid var(--d-border); }

/* ---------- Tour guidato ---------- */
.tour-root { position: fixed; inset: 0; z-index: 9000; display: none; }
.tour-dim { position: absolute; inset: 0; background: rgba(8,9,20,.55); }
.tour-highlight {
    position: fixed; border-radius: 12px; border: 2px solid rgba(255,255,255,.85);
    box-shadow: 0 0 0 9999px rgba(8,9,20,.62); transition: top .25s, left .25s, width .25s, height .25s;
    pointer-events: none; z-index: 1;
}
.tour-pop {
    position: fixed; z-index: 2; width: 340px; max-width: calc(100vw - 28px);
    background: #fff; border-radius: 16px; padding: 20px 20px 16px; box-shadow: 0 30px 70px -20px rgba(0,0,0,.6);
}
.tour-pop.center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.tour-pop h4 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--d-text); }
.tour-body { font-size: 14px; color: var(--d-muted); line-height: 1.55; }
.tour-body b { color: var(--d-text); }
.tour-x { position: absolute; top: 12px; right: 14px; background: none; border: 0; font-size: 22px; color: var(--d-faint); cursor: pointer; line-height: 1; }
.tour-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots .dot { width: 7px; height: 7px; border-radius: 50%; background: #d8d6ec; }
.tour-dots .dot.on { background: var(--indigo); width: 18px; border-radius: 4px; }
.tour-btns { display: flex; gap: 8px; }
.tour-btns button { font-family: 'Inter'; font-weight: 600; font-size: 13px; padding: 9px 16px; border-radius: 9px; cursor: pointer; border: 1px solid var(--d-border); background: #fff; color: var(--d-text); }
.tour-btns .tour-next { background: var(--grad); color: #fff; border: 0; }
.tour-skip { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--d-faint); font-size: 12px; cursor: pointer; }
.tour-plans { display: grid; gap: 10px; margin-top: 6px; }
.tour-plans .tp { position: relative; border: 1px solid var(--d-border); border-radius: 11px; padding: 12px 14px; }
.tour-plans .tp.feat { border-color: transparent; box-shadow: 0 0 0 2px var(--indigo); }
.tour-plans .tp .n { font-family: 'Inter'; font-weight: 700; font-size: 14px; }
.tour-plans .tp .p { font-family: 'Inter'; font-weight: 800; font-size: 18px; margin-left: 8px; }
.tour-plans .tp .p small { font-size: 11px; font-weight: 500; color: var(--d-faint); }
.tour-plans .tp .d { display: block; font-size: 12px; color: var(--d-muted); margin-top: 3px; }
.tour-plans .tp .badge { position: absolute; top: -9px; right: 12px; background: var(--grad); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.banner-guide { cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .app { grid-template-columns: 1fr; }
    .side { position: static; height: auto; }
    .side-scroll { max-height: none; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .side .merch, .side-h, .menu .count, .side-foot .side-meta, .side-foot .fontctl { display: none; }
    .menu { flex-direction: row; flex-wrap: wrap; }
    .side-foot { flex-direction: row; flex-wrap: wrap; }
    .kpi-cards { grid-template-columns: repeat(2, 1fr); }
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .mk-sum-grid { grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
    .mk-sum-grid .cell.note { display: none; }
    .mk-table { overflow-x: auto; }
    .mk-table table { min-width: 640px; }
}
@media (max-width: 560px) {
    .main { padding: 18px 14px 50px; }
    .head-row h1 { font-size: 22px; }
    .kpi-cards, .metrics { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Cervello (Brain) · Keyword · Pubblicità Auto (PPC)
   ============================================================ */

/* badge stato extra */
.kw-status.warn { background: rgba(224,145,58,.14); color: var(--orange); }
.kw-status.bad  { background: rgba(224,64,90,.12); color: var(--red); }

/* Bottoni generici */
.bbtn { font-size: 12px; font-weight: 600; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--d-border); background: var(--d-card); color: var(--d-text); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.bbtn.primary { background: var(--grad); color: #fff; border: 0; }

/* ---- Cervello ---- */
.bsearch { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.btiles { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.btile { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 12px; background: var(--d-card); border: 1px solid var(--d-border); border-radius: 14px; padding: 14px 16px; cursor: pointer; box-shadow: var(--d-shadow); }
.btile.active { border-color: var(--tc); }
.btile .bt-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; background: var(--grad-soft); }
.btile.active .bt-ic { background: var(--tc); }
.btile .bt-lb { font-weight: 600; font-size: 14.5px; }
.bcats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.bcat { background: var(--d-card); border: 1px solid var(--d-border); border-radius: 12px; padding: 12px 14px; }
.bcat.on { border-color: var(--indigo); background: var(--grad-soft); }
.bcat .h { font-size: 11px; color: var(--d-muted); text-transform: uppercase; font-weight: 700; letter-spacing: .03em; }
.bcat .n { font-size: 20px; font-weight: 700; margin-top: 2px; }
.bact { display: flex; flex-direction: column; gap: 10px; }
.bcard { display: flex; gap: 14px; background: var(--d-card); border: 1px solid var(--d-border); border-radius: 14px; padding: 14px; box-shadow: var(--d-shadow); }
.bcard .ph { width: 64px; height: 64px; border-radius: 10px; flex: none; }
.bcard .main { flex: 1; min-width: 0; }
.bcard .row1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.bcard .ic { font-size: 20px; }
.bcard .act { font-weight: 700; font-size: 14px; }
.bcard .cat-badge { font-size: 10px; background: #eceaf6; color: var(--d-muted); padding: 2px 7px; border-radius: 5px; font-weight: 700; }
.bcard .score { margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 5px; }
.bcard .ti { font-size: 13px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.bcard .meta { font-size: 11.5px; color: var(--d-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.bcard .meta .asin { font-family: ui-monospace, monospace; color: var(--indigo); }
.bcard .reason { font-size: 13px; margin-bottom: 10px; line-height: 1.45; }
.bcard .btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Keyword table ---- */
.mk-table table.kwtable th, .mk-table table.kwtable td { text-align: left; white-space: nowrap; }
.kwtable .kw-title { max-width: 180px; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.kwtable .kw-cell { font-size: 11.5px; color: var(--d-muted); max-width: 130px; overflow: hidden; text-overflow: ellipsis; }

/* ---- Pubblicità Auto (PPC) ---- */
.ptabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--d-border); margin-bottom: 14px; }
.ptab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; font-size: 12.5px; border: 1px solid var(--d-border); border-bottom: none; border-radius: 8px 8px 0 0; background: var(--d-card); color: var(--d-muted); }
.ptab.active { background: var(--grad-soft); color: var(--indigo); font-weight: 600; }
.pmode { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--d-card); border: 1px solid var(--d-border); border-radius: 12px; padding: 12px 16px; }
.pmode .lbl { font-size: 11px; font-weight: 700; color: var(--d-muted); }
.pmode-btn { font-size: 12.5px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--d-border); background: var(--d-card); color: var(--d-muted); cursor: pointer; }
.pmode-btn.active { background: var(--grad); color: #fff; border: 0; }
.pcard { display: flex; gap: 14px; align-items: flex-start; background: var(--d-card); border: 1px solid var(--d-border); border-radius: 14px; padding: 16px; box-shadow: var(--d-shadow); margin-bottom: 10px; }
.pcard .pph { width: 56px; height: 56px; border-radius: 8px; flex: none; }
.pmain { flex: 1; min-width: 0; }
.prow1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.phase-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 5px; }
.phase-scalata { background: rgba(224,64,90,.12); color: var(--red); }
.phase-crescita { background: rgba(224,145,58,.14); color: var(--orange); }
.phase-difesa { background: rgba(22,163,74,.12); color: var(--green); }
.ptrend { font-size: 12px; font-weight: 700; }
.ptrend.g { color: var(--green); }
.pmeta { font-size: 11.5px; color: var(--d-muted); }
.pstars { font-size: 11.5px; color: var(--orange); font-weight: 600; }
.pti { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preason { font-size: 12px; color: var(--d-muted); font-style: italic; margin-top: 3px; }
.pkw { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pside { flex: none; min-width: 142px; text-align: right; }
.pside .h { font-size: 10px; color: var(--d-faint); text-transform: uppercase; margin-top: 4px; }
.pside .h:first-child { margin-top: 0; }
.pside .v { font-weight: 700; font-size: 14px; }
.pside .v.g { color: var(--green); } .pside .v.i { color: var(--indigo); }
.pside .s { font-size: 10.5px; color: var(--d-faint); margin-top: 2px; }
.pprofit { border-top: 1px dashed var(--d-border); margin-top: 6px; padding-top: 5px; }
.pskip { background: rgba(224,64,90,.04); border: 1px solid rgba(224,64,90,.25); border-radius: 12px; padding: 14px 18px; margin-top: 22px; }
.pskip summary { font-size: 13.5px; font-weight: 600; color: var(--red); cursor: pointer; }
.pskip-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.pskip-row { display: flex; gap: 10px; align-items: center; background: var(--d-card); border: 1px solid var(--d-border); border-radius: 10px; padding: 8px; }

@media (max-width: 700px) {
    .pcard { flex-wrap: wrap; }
    .pside { text-align: left; min-width: 0; width: 100%; border-top: 1px solid var(--d-line); padding-top: 8px; }
}

/* ============================================================
   Interattività reale (ricerca/filtri/toast) — 2026-07-15
   ============================================================ */

/* Input di ricerca reale (prima era uno <span> decorativo) */
.filters input.search { outline: none; font-family: inherit; }
.filters input.search::placeholder { color: var(--d-faint); }
.filters input.search:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(109,92,231,.12); }

/* Select filtri (brand/priorità/ordina) — stesso stile del vecchio .drop finto */
.filter-select {
    background: var(--d-card); border: 1px solid var(--d-border); border-radius: 9px; padding: 9px 14px;
    font-size: 12.5px; color: var(--d-text); font-family: inherit; cursor: pointer; outline: none;
}
.filter-select:focus { border-color: var(--indigo); }

/* Toggle vista (Card/Tabella) ora cliccabile davvero */
.filters .toggle span { cursor: pointer; }

/* Chip come <button>: reset stile nativo, stesso look di prima + stato attivo */
button.chip { font-family: inherit; }
.chip.active { background: var(--grad); border-color: transparent; color: #fff; }
.chip.active .dot { box-shadow: 0 0 0 2px rgba(255,255,255,.5); }

/* Righe/card nascoste da un filtro attivo. [hidden] da solo NON basta: le
   regole .prod-grid{display:grid}/.mk-table{...} hanno la stessa specificità
   e vincono sulla regola di default del browser per [hidden] (bug trovato in
   verifica live: il toggle Card/Tabella non nascondeva la griglia). */
.prod-grid a.prod[hidden], .mk-table tbody tr[hidden] { display: none; }
#lst-grid[hidden], #lst-table[hidden],
#ppc-kpi-standard[hidden], #ppc-kpi-aggressive[hidden] { display: none; }

/* Elementi "non disponibili nella demo pubblica": stessa apparenza, cursore
   che comunica che è cliccabile ma con un tooltip nativo (title) e un piccolo
   avviso (toast) al click, invece di un semplice link morto senza spiegazione. */
.demo-locked { cursor: help; opacity: .82; }
.demo-locked:hover { opacity: 1; }

/* Toast di notifica "non disponibile in demo". Sfondo scuro FISSO, non
   var(--d-side): quella variabile è il bianco della sidebar (tema chiaro,
   vedi sopra) — riusarla qui dava testo bianco su sfondo bianco, invisibile
   (bug trovato dal titolare cliccando "Magazzino", 2026-07-16). */
#demo-toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #1c1d2e; color: #fff; padding: 12px 20px; border-radius: 11px;
    font-size: 13px; font-weight: 600; box-shadow: 0 12px 32px -8px rgba(0,0,0,.4); z-index: 5000;
    max-width: min(420px, calc(100vw - 32px)); text-align: center; display: flex; align-items: center; gap: 8px;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#demo-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#demo-toast .ti { font-size: 16px; color: var(--yellow); flex-shrink: 0; }

/* Feedback "Salvato" sui bottoni azione (AI details, modifica keyword...) */
.btn-saved { background: var(--green) !important; color: #fff !important; }
