/* Studio — layer custom SLIM sopra Tailwind (stesso approccio delle app dell'Hub,
 * che tengono .bdg/.prg in un piccolo <style>). Tutto il resto del markup usa
 * utility Tailwind inline. Palette = Hub: slate + arancio #ea580c, solo light. */

[x-cloak]{display:none!important}
::-webkit-scrollbar{width:10px;height:10px}
::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:20px;border:3px solid #f8fafc}

/* icone SVG inline (dal mockup approvato) */
.ic{width:18px;height:18px;stroke:currentColor;stroke-width:1.7;fill:none;stroke-linecap:round;stroke-linejoin:round;flex:none;display:block}
.ic-sm{width:15px;height:15px}

/* ---- shell: grid brand/topbar/sidebar/main (grid-areas non si esprime bene in
   utility Tailwind — resta qui, come nel mockup) ---- */
.shell{display:grid;grid-template-columns:232px 1fr;grid-template-rows:64px 1fr;height:100vh;grid-template-areas:"brand top" "side main"}
.shell>.brandcell{grid-area:brand}
.shell>.topbar{grid-area:top}
.shell>.sidebar{grid-area:side;display:flex;flex-direction:column}
.shell>.main{grid-area:main;min-width:0}/* min-width:0 = il 1fr non si gonfia al min-content dei contenuti (truncate/nowrap restano nel viewport) */
@media(max-width:860px){
  html,body{height:auto}
  .shell{grid-template-columns:1fr;grid-template-rows:auto auto auto auto;grid-template-areas:"brand" "top" "side" "main";height:auto}
  .shell>.sidebar{flex-direction:row;overflow-x:auto;overflow-y:hidden;border-right:none;border-bottom:1px solid #e2e8f0}
  .shell>.main{overflow:visible}
  .sidebar .navgroup{display:none}
  .sidebar .nav{width:auto;white-space:nowrap;flex:0 0 auto}
}

/* ---- chip / badge (come .bdg dell'Hub) ---- */
.chip{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:600;padding:3px 9px;border-radius:999px;background:#f1f5f9;color:#475569;border:1px solid #e2e8f0;white-space:nowrap}
.chip-accent{background:#fff7ed;color:#c2410c;border-color:#fed7aa}
.chip-ok{background:#f0fdf4;color:#16a34a;border-color:#bbf7d0}
.chip-warn{background:#fffbeb;color:#d97706;border-color:#fde68a}
.chip-plum{background:#f5f3ff;color:#7c3aed;border-color:#ddd6fe}
.layerbadge{display:inline-flex;align-items:center;gap:6px;font-size:10.5px;font-weight:700;padding:2px 8px;border-radius:6px;letter-spacing:.02em}
.lb1{background:#fff7ed;color:#c2410c}.lb2{background:#f0fdfa;color:#0d9488}.lb3{background:#f5f3ff;color:#7c3aed}

/* ---- toggle switch (bespoke) ---- */
.switch{width:38px;height:22px;border-radius:20px;background:#e2e8f0;position:relative;transition:.15s;flex:none;border:none;cursor:pointer}
.switch::after{content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:#fff;transition:.15s;box-shadow:0 1px 3px rgba(0,0,0,.3)}
.switch.on{background:#ea580c}.switch.on::after{left:18px}

/* ---- before/after (cambia sfondo) ---- */
.frame-before{background:repeating-conic-gradient(#f1f5f9 0 25%,#e2e8f0 0 50%) 50%/22px 22px}
.frame-after{background:linear-gradient(160deg,#fbe8d6,#f6d9bd)}

/* select del settore: freccia custom */
.sector-select{appearance:none;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2394a3b8' stroke-width='2'><path d='M2 4l4 4 4-4'/></svg>");background-repeat:no-repeat;background-position:right 10px center}

/* ---- controlli form (Brand/Contenuti) — component class, non Tailwind purgato ---- */
.lbl{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:#94a3b8;margin-bottom:6px}
.inp{width:100%;border:1px solid #e2e8f0;border-radius:8px;padding:9px 13px;font-size:13.5px;background:#f8fafc;color:#0f172a;font-family:inherit}
.inp:focus{outline:none;border-color:#fb923c;box-shadow:0 0 0 1px #fb923c;background:#fff}
textarea.inp{resize:vertical;line-height:1.5}
.btnp{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:600;font-size:13px;padding:9px 16px;border-radius:8px;border:1px solid #ea580c;background:#ea580c;color:#fff;cursor:pointer}
.btnp:hover{background:#c2410c;border-color:#c2410c}
.btnp:disabled{opacity:.6;cursor:default}
.btng{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:600;font-size:13px;padding:9px 16px;border-radius:8px;border:1px solid #cbd5e1;background:#fff;color:#1e293b;cursor:pointer}
.btng:hover{background:#f1f5f9}
.btng:disabled{opacity:.6;cursor:default}
.btnx{border:none;background:none;color:#94a3b8;cursor:pointer;font-size:12px;padding:2px 6px;border-radius:6px}
.btnx:hover{background:#fef2f2;color:#dc2626}
.fmtpick{display:flex;align-items:center;gap:8px;padding:8px 11px;border:1px solid #e2e8f0;border-radius:9px;font-size:12.5px;cursor:pointer;background:#fff;user-select:none}
.fmtpick.on{border-color:#ea580c;background:#fff7ed;color:#c2410c;font-weight:600}
.spin{width:14px;height:14px;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:spin .6s linear infinite;display:inline-block}
.spin-o{border:2px solid #fed7aa;border-top-color:#ea580c}
@keyframes spin{to{transform:rotate(360deg)}}
