/* Privacy Studio · Mondo Hi-Tech — foglio di stile */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/inter-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 500; font-display: swap; src: url('../fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url('../fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('../fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }

:root {
  --blue: #0083a8;
  --blue-600: #006f8f;
  --blue-700: #005a75;
  --cyan: #00b3e5;
  --sky: #e6f6fc;
  --sky-2: #f2fafd;
  --navy: #0d2633;
  --ink: #16242d;
  --gray: #57585a;
  --muted: #6b7a85;
  --line: #e3eaef;
  --line-2: #edf2f5;
  --bg: #f4f8fb;
  --white: #fff;
  --ok: #10a37f;
  --ok-bg: #e7f7f2;
  --warn: #c27a06;
  --warn-bg: #fff5e0;
  --danger: #d9363e;
  --danger-bg: #fdecec;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(13, 38, 51, .06), 0 1px 3px rgba(13, 38, 51, .04);
  --shadow: 0 10px 30px -12px rgba(13, 38, 51, .18), 0 2px 6px rgba(13, 38, 51, .05);
  --shadow-lg: 0 30px 60px -20px rgba(13, 38, 51, .35);
  --grad: linear-gradient(135deg, #00b3e5 0%, #0083a8 55%, #005a75 100%);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Barlow Condensed', 'Inter', system-ui, sans-serif;
  --sidebar: 264px;
  --accent-rgb: 0, 179, 229;
  --primary-rgb: 0, 131, 168;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 .6em; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-700); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--sky-2); color: var(--blue-700); padding: 1px 6px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.only-mobile { display: none !important; }
::selection { background: rgba(var(--accent-rgb), .22); }

/* ---------- Pulsanti ---------- */
.btn { --h: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 16px; border-radius: 12px; border: 1px solid transparent; font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s, border-color .2s; text-decoration: none; user-select: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad); background-size: 140% 140%; color: #fff; box-shadow: 0 8px 20px -8px rgba(var(--primary-rgb), .7), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-primary:hover { color: #fff; background-position: 100% 0; box-shadow: 0 12px 26px -10px rgba(var(--primary-rgb), .85), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: #c8d7e0; color: var(--blue-700); background: var(--sky-2); }
.btn-ghost.on { background: var(--sky); border-color: var(--cyan); color: var(--blue-700); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #bf2a31; color: #fff; }
.btn-sm { --h: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { --h: 48px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn .ic { width: 17px; height: 17px; }
.btn-glow { position: relative; overflow: hidden; }
.btn-glow::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-120%); animation: shine 3.2s ease-in-out infinite; }
.btn-glow[disabled]::after { display: none; }
@keyframes shine { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .5); } 50% { box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); } }

.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--gray); cursor: pointer; transition: all .15s; flex: none; }
.icon-btn:hover { color: var(--blue); border-color: #c8d7e0; background: var(--sky-2); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn.xs { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
.icon-btn.xs .ic { width: 15px; height: 15px; }
.icon-btn.danger:hover { color: var(--danger); border-color: #f3c3c5; background: var(--danger-bg); }

/* ---------- Badge ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge .ic { width: 13px; height: 13px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-blue { background: var(--sky); color: var(--blue-700); }
.badge-gray { background: var(--line-2); color: var(--gray); }
.count-pill { margin-left: auto; min-width: 26px; height: 22px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 99px; background: var(--sky); color: var(--blue-700); font-size: 12px; font-weight: 700; }

/* ---------- Avatar ---------- */
.avatar { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.avatar-sm { width: 34px; height: 34px; border-radius: 10px; font-size: 12.5px; }
.avatar-lg { width: 48px; height: 48px; border-radius: 14px; font-size: 16px; }
.avatar-xl { width: 72px; height: 72px; border-radius: 20px; font-size: 24px; }
.avatar-tenant { background: linear-gradient(135deg, var(--navy), var(--blue-700)); }

/* ---------- Struttura ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 22px 16px 16px; z-index: 30; }
.brand { display: block; padding: 6px 10px 4px; background: #fff; }
.brand-logo { width: 100%; max-width: 210px; height: auto; display: block; }
.brand-product { display: flex; align-items: center; gap: 8px; margin: 10px 10px 22px; font: 600 12px/1 var(--font); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .18); animation: blink 2.4s infinite; flex: none; }
@keyframes blink { 50% { box-shadow: 0 0 0 7px rgba(var(--accent-rgb), .05); } }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--gray); font-weight: 550; transition: background .15s, color .15s; }
.nav-item .ic { width: 19px; height: 19px; }
.nav-item:hover { background: var(--sky-2); color: var(--blue-700); }
.nav-item.active { background: var(--sky); color: var(--blue-700); }
.nav-item.active::before { content: ''; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.side-card { margin-top: auto; padding: 16px; border-radius: 16px; background: linear-gradient(180deg, var(--sky-2), #fff); border: 1px solid var(--line); }
.side-card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.side-card-title { font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.side-card-sub { font-size: 12px; color: var(--muted); }
.side-card-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 7px; }
.meter { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; width: var(--p); background: var(--grad); border-radius: inherit; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.side-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 14px 6px 0; }
.side-foot .ic { width: 15px; height: 15px; color: var(--blue); }

.sidebar-backdrop { display: none; }
.nav + .side-foot { margin-top: auto; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 72px; padding: 0 32px; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-title h1 { font: 700 26px/1 var(--display); letter-spacing: .01em; text-transform: uppercase; color: var(--navy); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; color: inherit; }
.user-chip:hover { border-color: #c8d7e0; }
.user-chip-text { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.user-chip-text strong { font-size: 13px; }
.user-chip-text small { font-size: 11.5px; color: var(--muted); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: all .16s; }
.user-menu.open .menu { opacity: 1; transform: none; pointer-events: auto; }
.menu form { margin: 0; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 0; background: none; font: 500 14px var(--font); color: var(--ink); cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--sky-2); color: var(--blue-700); }
.context-bar { display: flex; align-items: center; gap: 10px; padding: 10px 32px; background: linear-gradient(90deg, var(--navy), var(--blue-700)); color: #d9eef6; font-size: 13.5px; }
.context-bar strong { color: #fff; }
.context-bar form { margin: 0 0 0 auto; }
.content { padding: 28px 32px 48px; max-width: 1480px; width: 100%; }

/* ---------- Schede ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.card + .card, .card + section, section + .card, section + section { margin-top: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13.5px; }
.link .ic { width: 15px; height: 15px; }
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; margin-top: 22px; }
.grid-2 > .card { margin: 0; }
.grid-2.narrow { grid-template-columns: 1.2fr 1fr; margin-top: 0; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-intro h2 { font-size: 22px; margin-bottom: 4px; }
.page-intro p { margin: 0; }

/* ---------- Panoramica ---------- */
.hero-card { position: relative; display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; overflow: hidden; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 250px; }
.hero-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(520px 260px at 0% 110%, rgba(var(--accent-rgb), .13), transparent 60%), radial-gradient(420px 200px at 30% -30%, rgba(var(--primary-rgb), .08), transparent 60%); pointer-events: none; }
.hero-card-text { position: relative; padding: 34px 38px; }
.hero-card-text h2 { font: 700 44px/1 var(--display); text-transform: uppercase; letter-spacing: .005em; color: var(--navy); margin: 10px 0 12px; }
.hero-card-text p { color: var(--muted); max-width: 520px; font-size: 15px; }
.hero-card-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.hero-card-art { position: relative; height: 100%; min-height: 250px; background: #fff; }
.orbit { position: absolute; left: 50%; top: 50%; width: 170px; height: 170px; transform: translate(-50%, -50%); display: grid; place-items: center; }
.orbit::before, .orbit::after { content: ''; position: absolute; inset: -26px; border-radius: 50%; border: 1.5px dashed rgba(var(--primary-rgb), .3); animation: spin 26s linear infinite; }
.orbit::after { inset: -56px; border-style: solid; border-color: rgba(var(--accent-rgb), .14); animation-duration: 40s; animation-direction: reverse; }
.orbit img { width: 150px; height: auto; filter: drop-shadow(0 18px 24px rgba(0, 90, 117, .25)); animation: float 6s ease-in-out infinite; background: #fff; border-radius: 50%; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-8px); } }
.chip { position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 650; color: var(--navy); animation: float 5s ease-in-out infinite; }
.chip .ic { width: 15px; height: 15px; color: var(--blue); }
.chip.c1 { left: 6%; top: 18%; }
.chip.c2 { right: 8%; top: 30%; animation-delay: -1.5s; }
.chip.c3 { left: 22%; bottom: 14%; animation-delay: -3s; }
.chip.c3 .ic { color: var(--ok); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 22px; }
.kpi { display: flex; align-items: center; gap: 16px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; color: #fff; flex: none; }
.kpi-ic .ic { width: 24px; height: 24px; }
.ic-blue { background: linear-gradient(135deg, var(--cyan), var(--blue)); box-shadow: 0 10px 20px -10px var(--blue); }
.ic-cyan { background: linear-gradient(135deg, var(--sky), var(--cyan)); box-shadow: 0 10px 20px -10px var(--cyan); }
.ic-navy { background: linear-gradient(135deg, var(--blue-700), var(--navy)); box-shadow: 0 10px 20px -10px var(--navy); }
.ic-gray { background: linear-gradient(135deg, #8a96a0, #57585a); box-shadow: 0 10px 20px -10px #57585a; }
.kpi-num { display: block; font: 700 36px/1 var(--display); color: var(--navy); }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }

.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 8px; align-items: end; height: 190px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-fill { width: 100%; max-width: 30px; height: var(--h); border-radius: 8px 8px 4px 4px; background: var(--grad); opacity: .9; transform-origin: bottom; animation: grow 1s cubic-bezier(.2, .8, .2, 1) both; }
.bar:nth-child(n) .bar-fill { animation-delay: calc(var(--i, 0) * 40ms); }
.bar:hover .bar-fill { opacity: 1; filter: brightness(1.1); }
.bar small { font-size: 11px; color: var(--muted); }
@keyframes grow { from { transform: scaleY(0); } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps strong { display: block; font-size: 14px; }
.steps span:not(.step-n) { font-size: 13px; color: var(--muted); }
.step-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; flex: none; background: var(--sky); color: var(--blue-700); font: 700 18px/1 var(--display); }

/* ---------- Libreria ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 22px; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; margin: 0; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 42px; padding: 0 14px 0 42px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; box-shadow: var(--shadow-sm); }
.search input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .15); }
.segmented { display: inline-flex; padding: 4px; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.segmented > a, .segmented > button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 9px; border: 0; background: none; font: 600 13px var(--font); color: var(--gray); cursor: pointer; white-space: nowrap; transition: all .15s; }
.segmented > a:hover, .segmented > button:hover { color: var(--blue-700); }
.segmented > .on { background: var(--sky); color: var(--blue-700); box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), .18); }
.segmented .ic { width: 15px; height: 15px; }
.segmented.small > button { height: 28px; padding: 0 10px; font-size: 12.5px; }
.segmented.full { display: flex; }
.segmented.full > button { flex: 1; justify-content: center; }
.toolbar-count { margin-left: auto; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.media-grid.compact { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.media-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, opacity .3s; }
.media-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.media-card.removing { opacity: 0; transform: scale(.95); }
.media-thumb { position: relative; display: block; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #eef5f9, #e1edf3); overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.media-card:hover .media-thumb img { transform: scale(1.05); }
.thumb-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; color: var(--muted); font-size: 12px; background: repeating-linear-gradient(45deg, rgba(var(--primary-rgb), .04) 0 12px, transparent 12px 24px); }
.thumb-placeholder .ic { width: 34px; height: 34px; color: var(--blue); opacity: .6; }
.kind-pill { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 99px; background: rgba(255, 255, 255, .92); font-size: 11.5px; font-weight: 650; color: var(--navy); box-shadow: var(--shadow-sm); }
.kind-pill .ic { width: 13px; height: 13px; color: var(--blue); }
.thumb-cta { position: absolute; inset: auto 10px 10px auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; background: var(--grad); color: #fff; font-size: 12.5px; font-weight: 650; opacity: 0; transform: translateY(6px); transition: all .2s; box-shadow: 0 8px 18px -8px rgba(var(--primary-rgb), .8); }
.thumb-cta .ic { width: 14px; height: 14px; }
.media-card:hover .thumb-cta { opacity: 1; transform: none; }
.media-body { padding: 14px 16px 14px; }
.media-title { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 10px; }
.counts { display: inline-flex; gap: 10px; font-size: 12.5px; font-weight: 650; color: var(--navy); }
.counts span { display: inline-flex; align-items: center; gap: 4px; }
.counts .ic { width: 14px; height: 14px; color: var(--blue); }
.media-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.media-actions { display: flex; gap: 6px; }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 28px; }
.pager a { display: grid; place-items: center; min-width: 36px; height: 36px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 600; color: var(--gray); }
.pager a.on { background: var(--grad); color: #fff; border-color: transparent; }
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 40px 20px; }
.empty p { margin: 0 0 8px; }
.empty-art { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 22px; background: var(--sky); color: var(--blue); margin-bottom: 6px; }
.empty-art .ic { width: 34px; height: 34px; }
.big-empty { padding: 70px 20px; border-style: dashed; border-width: 2px; }

/* ---------- Tabelle ---------- */
.table-card { padding: 0; overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fbfdfe; }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--sky-2); }
.who { display: flex; align-items: center; gap: 12px; }
.who > div { display: flex; flex-direction: column; line-height: 1.3; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }

/* ---------- Clienti ---------- */
.tenant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.tenant-grid > .card { margin: 0; transition: transform .2s, box-shadow .2s; }
.tenant-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tenant-card.is-suspended { opacity: .7; }
.tenant-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.tenant-name { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.tenant-name strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.tenant-stats div { padding: 10px 12px; border-radius: 12px; background: var(--sky-2); }
.tenant-stats strong { display: block; font: 700 24px/1.1 var(--display); color: var(--navy); }
.tenant-stats span { font-size: 12px; color: var(--muted); }
.tenant-actions { display: flex; gap: 8px; margin-top: 18px; }
.tenant-actions form { margin: 0; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.danger-zone form { margin: 0; display: flex; gap: 8px; }
.delete-tenant input { height: 40px; padding: 0 12px; border: 1px solid #f3c3c5; border-radius: 10px; font: inherit; min-width: 200px; }

/* ---------- Moduli ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid h2, .form-grid h3 { margin-top: 8px; }
.form-grid .muted { margin: -8px 0 0; }
.span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink); min-width: 0; }
.field > span { display: flex; align-items: center; gap: 6px; }
.field output { margin-left: auto; font-weight: 700; color: var(--blue-700); font-variant-numeric: tabular-nums; }
.field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .field textarea, .input-wrap input {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: 400 14.5px var(--font); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field textarea { height: auto; padding: 10px 14px; resize: vertical; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7a85' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.field input:focus, .field select:focus, .field textarea:focus, .input-wrap input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .15); }
.field input:disabled { background: var(--bg); color: var(--muted); }
.input-wrap { position: relative; display: flex; align-items: center; }
.field-icon .input-wrap .ic { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.field.field-icon .input-wrap input:not([type=checkbox]):not([type=radio]):not([type=range]) { padding-left: 46px; height: 50px; }
.field .input-wrap.with-btn input:not([type=checkbox]):not([type=radio]):not([type=range]) { padding-right: 112px; }
.input-wrap.with-btn .btn { position: absolute; right: 6px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.sticky-actions { position: sticky; bottom: 16px; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; margin: 6px 0 0; display: flex; gap: 6px; align-items: center; }
.hint.center { justify-content: center; }
.hint .ic { width: 13px; height: 13px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--blue)); opacity: .9; }
input[type=range]::-moz-range-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--blue)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); box-shadow: 0 2px 8px rgba(0, 90, 117, .35); transition: transform .15s; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); box-shadow: 0 2px 8px rgba(0, 90, 117, .35); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15); }
.toggles { display: flex; flex-wrap: wrap; gap: 10px; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 600; font-size: 13.5px; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; width: 40px; height: 23px; border-radius: 99px; background: #cfdbe2; transition: background .2s; flex: none; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + i { background: var(--grad); }
.switch input:checked + i::after { transform: translateX(17px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .25); }
.switch .ic { width: 16px; height: 16px; color: var(--blue); }
.switch.small i { width: 34px; height: 20px; }
.switch.small i::after { width: 14px; height: 14px; }
.switch.small input:checked + i::after { transform: translateX(14px); }
.toggles .switch { padding: 9px 14px 9px 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff; flex: 1; }
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.radio-card { display: flex; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; font-weight: 400; transition: all .15s; }
.radio-card:has(input:checked) { border-color: var(--cyan); background: var(--sky-2); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .1); }
.radio-card input { accent-color: var(--blue); margin-top: 3px; }
.radio-card strong { display: block; font-size: 14px; }
.radio-card span { font-size: 13px; color: var(--muted); }
.inline-num { width: 70px !important; height: 30px !important; padding: 0 8px !important; display: inline-block; border-radius: 8px !important; }
.settings .card + .card { margin-top: 22px; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 16px; }
.alert-error { background: var(--danger-bg); color: #a3242a; border: 1px solid #f5cfd1; }

/* ---------- Finestre modali ---------- */
.modal { border: 0; padding: 0; background: transparent; max-width: min(640px, calc(100vw - 32px)); width: 100%; overflow: visible; }
.modal::backdrop { background: rgba(13, 38, 51, .45); backdrop-filter: blur(4px); }
.modal[open] { animation: pop .22s cubic-bezier(.2, 1.2, .4, 1); }
.modal[open]::backdrop { animation: fade .2s; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes fade { from { opacity: 0; } }
.modal-card { background: #fff; border-radius: 22px; padding: 26px; box-shadow: var(--shadow-lg); max-height: calc(100vh - 48px); overflow: auto; }
.modal:has(.modal-wide) { max-width: min(760px, calc(100vw - 32px)); }
.modal:has(.modal-sm) { max-width: 420px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-head p { margin: 4px 0 0; font-size: 13.5px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-sm { text-align: center; }
.modal-sm .modal-foot { justify-content: center; }
.confirm-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--sky); color: var(--blue); margin-bottom: 12px; }
.confirm-ic.danger { background: var(--danger-bg); color: var(--danger); }
.confirm-ic .ic { width: 26px; height: 26px; }
.confirm-text { font-size: 15px; }

/* Caricamento */
.dropzone { position: relative; display: grid; justify-items: center; gap: 4px; padding: 38px 20px 30px; border: 2px dashed #b9d7e4; border-radius: 18px; background: radial-gradient(400px 160px at 50% 0%, var(--sky), #fff); cursor: pointer; text-align: center; transition: all .2s; }
.dropzone:hover, .dropzone.over { border-color: var(--cyan); background: radial-gradient(400px 200px at 50% 0%, #d4f0fa, #fff); }
.dropzone.over { transform: scale(1.01); }
.dropzone strong { font-size: 17px; margin-top: 10px; }
.dropzone-art { position: relative; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 22px; background: var(--grad); color: #fff; box-shadow: 0 16px 30px -12px rgba(var(--primary-rgb), .8); }
.dropzone-art .ic { width: 34px; height: 34px; animation: float 3s ease-in-out infinite; }
.dz-ring { position: absolute; inset: -10px; border-radius: 28px; border: 2px solid rgba(var(--accent-rgb), .35); animation: ring 2.4s ease-out infinite; }
.dz-ring.r2 { animation-delay: 1.2s; }
@keyframes ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.dz-formats { margin-top: 10px; font-size: 11.5px; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.upload-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.up-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; animation: pop .25s; }
.up-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--sky); color: var(--blue); flex: none; }
.up-main { flex: 1; min-width: 0; }
.up-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-bar { height: 8px; border-radius: 99px; background: var(--line); margin-top: 7px; overflow: hidden; }
.up-bar span { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width .2s; }
.up-status { font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.up-item.done .up-ic { background: var(--ok-bg); color: var(--ok); }
.up-item.error { border-color: #f5cfd1; background: var(--danger-bg); }
.up-item.error .up-status { color: var(--danger); white-space: normal; max-width: 260px; }
body.dragging::after { content: 'Rilascia per caricare'; position: fixed; inset: 14px; z-index: 100; display: grid; place-items: center; border: 3px dashed var(--cyan); border-radius: 26px; background: rgba(230, 246, 252, .88); backdrop-filter: blur(3px); font: 700 34px var(--display); text-transform: uppercase; color: var(--blue-700); pointer-events: none; animation: fade .15s; }

/* ---------- Notifiche ---------- */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 13px 16px; border-radius: 14px; background: var(--navy); color: #fff; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toastIn .35s cubic-bezier(.2, 1.2, .4, 1); transition: all .35s; }
.toast .ic { color: var(--cyan); }
.toast-success .ic { color: #4be0b5; }
.toast-error { background: #7c1d22; }
.toast-error .ic { color: #ffb4b8; }
.toast.out { opacity: 0; transform: translateX(30px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }

/* ---------- Accesso ---------- */
.login-body { background: #fff; }
.login { display: grid; grid-template-columns: minmax(420px, 1fr) 1.15fr; min-height: 100vh; }
.login > section { margin: 0; }
.login-panel { display: grid; place-items: center; padding: 48px; background: #fff; }
.login-inner { width: 100%; max-width: 420px; }
.login-logo { width: 280px; max-width: 100%; height: auto; display: block; margin-bottom: 44px; }
.login-title { font: 700 52px/0.98 var(--display); text-transform: uppercase; color: var(--navy); margin: 14px 0 14px; }
.login-sub { font-size: 15px; margin-bottom: 28px; }
.login-form { display: grid; gap: 16px; }
.login-form .btn { margin-top: 6px; }
.login-foot { display: flex; align-items: center; gap: 8px; margin-top: 26px; font-size: 12.5px; }
.login-foot .ic { color: var(--ok); width: 16px; height: 16px; }
.login-hero { position: relative; overflow: hidden; background: radial-gradient(900px 600px at 80% 0%, var(--cyan) 0%, transparent 60%), linear-gradient(160deg, var(--blue) 0%, var(--blue-700) 45%, var(--navy) 100%); display: grid; place-items: center; padding: 48px; }
.hero-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%); }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 9s ease-in-out infinite; }
.hero-orb.o1 { width: 360px; height: 360px; background: var(--cyan); left: -80px; bottom: -60px; }
.hero-orb.o2 { width: 280px; height: 280px; background: #3fd0f7; right: 10%; top: 8%; animation-delay: -4s; opacity: .35; }
.hero-stage { position: relative; width: 100%; max-width: 560px; }
.scan-card { position: relative; border-radius: 22px; background: #fff; padding: 12px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .55); transform: perspective(1200px) rotateY(-8deg) rotateX(4deg); animation: tilt 10s ease-in-out infinite; }
@keyframes tilt { 50% { transform: perspective(1200px) rotateY(-3deg) rotateX(2deg) translateY(-6px); } }
.scene { display: block; width: 100%; height: auto; border-radius: 14px; }
.scene .box { fill: none; stroke: #00b3e5; stroke-width: 2.5; stroke-dasharray: 6 5; opacity: 0; animation: boxIn 6s infinite; }
.scene .b-plate { stroke: #0083a8; animation-delay: .5s; }
.scene .redact { opacity: 0; animation: redact 6s infinite; }
.scene .r-plate { animation-delay: .5s; }
.scene .scanline { filter: drop-shadow(0 0 6px #00b3e5); animation: scan 6s infinite; }
@keyframes scan { 0% { transform: translateY(0); opacity: 1; } 35% { transform: translateY(257px); opacity: 1; } 36%, 100% { opacity: 0; transform: translateY(257px); } }
@keyframes boxIn { 0%, 20% { opacity: 0; } 28%, 85% { opacity: 1; } 95%, 100% { opacity: 0; } }
@keyframes redact { 0%, 40% { opacity: 0; } 50%, 88% { opacity: 1; } 96%, 100% { opacity: 0; } }
.scan-tags { position: absolute; inset: 0; pointer-events: none; }
.tag { position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: #fff; box-shadow: var(--shadow); font-size: 12.5px; font-weight: 700; color: var(--navy); opacity: 0; animation: boxIn 6s infinite; }
.tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.tag.t1 { left: -26px; top: 26%; }
.tag.t2 { right: -22px; bottom: 22%; animation-delay: .5s; }
.hero-points { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 14px; color: #fff; }
.hero-points li { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(6px); }
.hero-points .ic { width: 22px; height: 22px; color: #8be3fb; }
.hero-points strong { display: block; font-size: 14.5px; }
.hero-points span { font-size: 13px; color: rgba(255, 255, 255, .75); }

/* ---------- Installazione ---------- */
.install-body { background: var(--bg); }
.install { max-width: 820px; margin: 0 auto; padding: 40px 20px 60px; }
.install-head { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; padding: 22px 26px; background: #fff; border-radius: 20px; border: 1px solid var(--line); }
.install-logo { width: 240px; height: auto; }
.install-head h1 { font: 700 30px/1 var(--display); text-transform: uppercase; color: var(--navy); }
.install-head p { margin: 6px 0 0; }
.install .card + .card, .install .alert + .card { margin-top: 20px; }
.install .alert { margin-top: 20px; }
.checks { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--bg); font-size: 13.5px; }
.checks small { color: var(--muted); }
.check-dot { width: 12px; height: 12px; border-radius: 50%; }
.checks .ok .check-dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.checks .ko .check-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg); }
.checks .ko { background: var(--danger-bg); }
.install-done { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 40px; }

/* ---------- Profilo ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.profile-head p { margin: 4px 0 0; }
.info-card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.info-card h3 .ic { color: var(--blue); }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 28px; font-size: 13.5px; color: var(--gray); }
.ticks li::before { content: ''; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 6px; background: var(--sky) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230083a8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat; }

/* ================= STUDIO ================= */
.studio-body .content { max-width: none; padding: 0; flex: 1; display: flex; min-height: 0; }
.studio-body .main { height: 100vh; }
.studio { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.studio-head { display: flex; align-items: center; gap: 14px; padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.studio-title { flex: 1; min-width: 0; }
.title-input { width: 100%; max-width: 560px; border: 1px solid transparent; border-radius: 9px; padding: 3px 8px; margin-left: -8px; font: 700 18px var(--font); color: var(--navy); background: transparent; }
.title-input:hover { border-color: var(--line); }
.title-input:focus { outline: none; border-color: var(--cyan); background: #fff; box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .12); }
.studio-title .muted { display: flex; align-items: center; gap: 4px; }
.studio-title .muted .ic { width: 14px; height: 14px; }
.studio-head-actions { display: flex; align-items: center; gap: 10px; }
.studio-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: minmax(0, 1fr); }
.stage-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 16px 18px 16px 24px; gap: 12px; }
.stage-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stage-tools-right { display: flex; align-items: center; gap: 12px; }
.stage { position: relative; flex: 1; min-height: 300px; border-radius: 20px; overflow: hidden; display: grid; place-items: center; background: var(--navy); background-image: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .08) 0%, transparent 70%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), var(--shadow); }
.stage::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 28px 28px; }
.stage-inner { position: relative; width: 0; height: 0; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); touch-action: none; }
.stage.drawing .stage-inner { cursor: crosshair; }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 4px; }
.compare-handle { display: none; position: absolute; top: 0; bottom: 0; width: 0; z-index: 5; cursor: ew-resize; }
.compare-handle::before { content: ''; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 12px rgba(var(--accent-rgb), .9); }
.compare-handle span { position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--blue); box-shadow: var(--shadow); }
.studio[data-view=compare] .compare-handle { display: block; }
.studio[data-view=compare] .stage-inner::after { content: 'Originale        ·        Protetto'; white-space: pre; position: absolute; top: -32px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .8); letter-spacing: .08em; text-transform: uppercase; }
.boxes { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.box { position: absolute; border: 2px solid var(--cyan); border-radius: 6px; pointer-events: auto; cursor: pointer; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 0 18px rgba(var(--accent-rgb), .35); transition: border-color .15s, background .15s; }
.box.round { border-radius: 50%; }
.box.plate { border-color: #6fe0ff; }
.box.manual { border-color: #ffb020; border-style: dashed; cursor: move; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.box:hover, .box.hl { background: rgba(var(--accent-rgb), .14); border-width: 3px; }
.box.sel { outline: 2px solid #fff; outline-offset: 2px; }
.box.off { border-color: rgba(255, 255, 255, .7); border-style: dotted; box-shadow: none; background: rgba(217, 54, 62, .12); }
.box.off .box-tag { background: #6b7a85; text-decoration: line-through; }
.box-tag { position: absolute; left: 50%; bottom: calc(100% + 5px); transform: translateX(-50%); padding: 2px 7px; border-radius: 6px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; }
.box:hover .box-tag, .box.hl .box-tag, .box.sel .box-tag { opacity: 1; }
.box.manual .box-tag { background: #c27a06; }
.box-x { position: absolute; right: -10px; top: -10px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; display: none; }
.box-resize { position: absolute; right: -6px; bottom: -6px; width: 14px; height: 14px; border-radius: 4px; background: #fff; border: 2px solid #ffb020; cursor: nwse-resize; display: none; }
.box.manual:hover .box-x, .box.manual.sel .box-x, .box.manual:hover .box-resize, .box.manual.sel .box-resize { display: block; }
.just-detected .box { animation: boxPop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes boxPop { from { opacity: 0; transform: scale(1.6); } }
.draw-rect { position: absolute; z-index: 6; border: 2px dashed #ffb020; background: rgba(255, 176, 32, .15); border-radius: 4px; pointer-events: none; }
.stage-overlay { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(13, 38, 51, .55); backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: opacity .3s; }
.stage-overlay.show { opacity: 1; pointer-events: auto; }
.stage-overlay.solid { background: rgba(255, 255, 255, .96); }
.ai-loader { display: grid; justify-items: center; gap: 8px; text-align: center; max-width: 380px; padding: 30px; border-radius: 24px; background: #fff; box-shadow: var(--shadow-lg); }
.ai-loader .progress { width: 260px; margin-top: 10px; }
.ai-orb { position: relative; width: 92px; height: 92px; display: grid; place-items: center; margin-bottom: 8px; }
.ai-orb img { width: 74px; height: auto; animation: spin 8s linear infinite; background: #fff; border-radius: 50%; }
.ai-orb .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(var(--accent-rgb), .5); animation: ring 2s ease-out infinite; }
.ai-orb .ring.r2 { animation-delay: 1s; }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; position: relative; }
.progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width .25s; }
.progress.indeterminate span { width: 40% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.scan-fx { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.scan-fx::before { content: ''; position: absolute; left: 0; right: 0; height: 120px; background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), .28) 85%, rgba(160, 238, 255, .9)); border-bottom: 2px solid #8be8ff; box-shadow: 0 0 24px #00b3e5; animation: sweep 1.3s cubic-bezier(.5, 0, .5, 1) infinite; }
@keyframes sweep { from { top: -120px; } to { top: 100%; } }
.analyzing .scan-fx::before { animation-duration: 2.2s; opacity: .5; }

.transport { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.transport .play { width: 42px; height: 42px; border-radius: 50%; background: var(--grad); color: #fff; border: 0; box-shadow: 0 8px 18px -8px rgba(var(--primary-rgb), .8); }
.transport .play:hover { color: #fff; }
.transport .i-pause, .playing .transport .i-play { display: none; }
.playing .transport .i-pause { display: block; }
.time { font: 600 13px var(--font); font-variant-numeric: tabular-nums; color: var(--navy); white-space: nowrap; min-width: 92px; }
.timeline { position: relative; flex: 1; height: 44px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); cursor: pointer; overflow: hidden; touch-action: none; }
.timeline::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed #cfdde5; }
.timeline canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.timeline-progress { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, rgba(var(--accent-rgb), .08), rgba(var(--accent-rgb), .2)); border-right: 2px solid var(--cyan); }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--navy); }
.playhead::before { content: ''; position: absolute; top: -1px; left: -5px; border: 6px solid transparent; border-top-color: var(--navy); }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.legend span { width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.lg-face { background: var(--blue); }
.lg-plate { background: var(--cyan); }

.panel { background: #fff; border-left: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; }
.panel-section { padding: 18px 20px; border-bottom: 1px solid var(--line-2); display: grid; gap: 14px; }
.panel-section.grow { flex: 1; align-content: start; }
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); }
.panel-title .ic { width: 16px; height: 16px; color: var(--blue); }
.advanced { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.advanced summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--gray); list-style: none; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary .ic { width: 15px; height: 15px; }
.advanced[open] { padding-bottom: 12px; }
.advanced[open] > .field + .field, .advanced[open] > .field { margin-top: 10px; }
.engine { display: flex; align-items: center; gap: 7px; }
.engine .ic { width: 14px; height: 14px; }
.engine.ready { color: var(--ok); }
.effect-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.effect-picker button { display: grid; justify-items: center; gap: 7px; padding: 10px 6px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font: 600 12.5px var(--font); color: var(--gray); cursor: pointer; transition: all .15s; }
.effect-picker button:hover { border-color: #b9d7e4; }
.effect-picker button.on { border-color: var(--cyan); background: var(--sky-2); color: var(--blue-700); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .12); }
.fx { width: 46px; height: 46px; border-radius: 50%; display: block; }
.fx-blur { background: radial-gradient(circle at 40% 35%, #f6d2b4, #d79e7a 45%, #5b7d8c 80%); filter: blur(3px); }
.fx-pixel { background-image: linear-gradient(45deg, #d7a07e 25%, transparent 25%), linear-gradient(-45deg, #b8826a 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e8bf9f 75%), linear-gradient(-45deg, transparent 75%, #6d8d9b 75%); background-size: 16px 16px; background-color: #c99476; border-radius: 10px; }
.fx-solid { background: #0d2633; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .15); }
.region-summary { display: flex; gap: 6px; flex-wrap: wrap; }
.region-summary span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; background: var(--bg); font-size: 12px; color: var(--muted); }
.region-summary .ic { width: 14px; height: 14px; color: var(--blue); }
.region-summary b { color: var(--navy); }
.regions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.regions-empty { padding: 14px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }
.region { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: all .15s; animation: pop .25s both; }
.region:hover { border-color: #b9d7e4; background: var(--sky-2); }
.region.sel { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12); }
.region.off { opacity: .55; }
.region.off strong { text-decoration: line-through; }
.r-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--sky); color: var(--blue); flex: none; }
.r-ic .ic { width: 16px; height: 16px; }
.region.manual .r-ic { background: var(--warn-bg); color: var(--warn); }
.r-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.r-text strong { font-size: 13px; }
.r-text small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-actions { display: flex; gap: 4px; }
.export { position: sticky; bottom: 0; background: #fff; box-shadow: 0 -10px 20px -14px rgba(13, 38, 51, .2); }
.export-progress { display: grid; gap: 8px; justify-items: stretch; }
.export-progress .btn { justify-self: center; }
.is-busy .stage-tools { opacity: .6; pointer-events: none; }

.celebrate { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(13, 38, 51, .5); backdrop-filter: blur(6px); animation: fade .25s; }
.celebrate-card { text-align: center; background: #fff; border-radius: 26px; padding: 34px 34px 28px; box-shadow: var(--shadow-lg); max-width: 460px; animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); }
.celebrate-card h3 { font: 700 30px/1 var(--display); text-transform: uppercase; color: var(--navy); margin: 18px 0 8px; }
.celebrate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.success-burst { position: relative; display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--grad); color: #fff; box-shadow: 0 18px 36px -12px rgba(var(--primary-rgb), .8); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.success-burst svg { width: 40px; height: 40px; }
.success-burst .ic { width: 40px; height: 40px; }
.spark { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 2px; background: var(--cyan); transform: rotate(var(--a)) translateX(0); animation: spark .9s cubic-bezier(.1, .8, .3, 1) forwards; opacity: 0; }
.spark:nth-child(3n) { background: var(--blue); }
.spark:nth-child(3n+1) { background: #ffd36b; border-radius: 50%; }
@keyframes spark { 0% { opacity: 1; transform: rotate(var(--a)) translateX(10px); } 100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--d)) rotate(180deg); } }

/* ---------- Responsive ---------- */
/* ======== Versione 1.1 ======== */
.announce { display: flex; align-items: center; gap: 10px; padding: 10px 32px; font-size: 13.5px; font-weight: 550; background: var(--sky); color: var(--blue-700); border-bottom: 1px solid var(--line); }
.announce-warn { background: var(--warn-bg); color: #8a5703; }
.announce-ok { background: var(--ok-bg); color: #0b7a5e; }
.toast-warn .ic { color: #ffc65c; }
.retention-note { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; margin-bottom: 16px; border-radius: 14px; background: var(--warn-bg); border: 1px solid #f6dca6; color: #6b4a07; }
.retention-note strong { display: block; font-size: 14px; color: #5a3d03; }
.retention-note span:not(.rn-ic) { font-size: 13px; }
.rn-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--warn); flex: none; box-shadow: var(--shadow-sm); }
.rn-ic .ic { width: 20px; height: 20px; animation: tick 2s ease-in-out infinite; }
@keyframes tick { 50% { transform: rotate(-12deg); } }
.retention-strip { display: flex; align-items: center; gap: 10px; padding: 11px 16px; margin-bottom: 18px; border-radius: 12px; background: #fff; border: 1px dashed #e8c47a; color: #6b4a07; font-size: 13px; }
.retention-strip .ic { color: var(--warn); }
.expiry-pill { position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 99px; background: rgba(255, 255, 255, .92); font-size: 11.5px; font-weight: 650; color: #8a5703; box-shadow: var(--shadow-sm); }
.expiry-pill .ic { width: 13px; height: 13px; }
.expiry-pill.soon { background: var(--danger); color: #fff; animation: pulse 1.6s infinite; }
.widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.widgets > * { margin: 0 !important; }
.w-full { grid-column: 1 / -1; }
.notice-card { display: flex; gap: 16px; align-items: flex-start; background: linear-gradient(120deg, var(--sky-2), #fff); }
.notice-card p { margin: 6px 0 0; color: var(--gray); }
.notice-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--grad); color: #fff; flex: none; }
.ret-body { display: flex; gap: 22px; align-items: center; }
.ret-body p { margin: 0 0 6px; }
.ret-ring { --p: 0%; position: relative; display: grid; place-content: center; text-align: center; width: 118px; height: 118px; border-radius: 50%; flex: none; background: conic-gradient(var(--blue) var(--p), var(--line) 0); }
.ret-ring::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: #fff; }
.ret-ring span, .ret-ring small { position: relative; }
.ret-ring span { font: 700 34px/1 var(--display); color: var(--navy); }
.ret-ring small { font-size: 11px; color: var(--muted); }
.quick-links { display: flex; flex-wrap: wrap; gap: 12px; }
.quick-link { display: inline-flex; align-items: center; gap: 8px; padding: 14px 18px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-weight: 650; color: var(--navy); transition: all .15s; }
.quick-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--blue); }
.quick-link .ic { color: var(--blue); }
.tenant-ret { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #8a5703; background: var(--warn-bg); padding: 7px 10px; border-radius: 10px; margin-bottom: 14px; }
.tenant-ret .ic { width: 15px; height: 15px; }
.tenant-actions { flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.login.no-hero { grid-template-columns: 1fr; }
.panel-section.locked .effect-picker, .panel-section.locked .field, .panel-section.locked .segmented { opacity: .5; pointer-events: none; }
.lock-note { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; letter-spacing: 0; text-transform: none; color: var(--muted); font-weight: 600; }
.lock-note .ic { width: 12px; height: 12px; color: var(--muted); }
.no-exclude .region:not(.manual) [data-r-toggle] { display: none; }
/* Permessi */
.tenant-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tenant-tabs a { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-weight: 600; color: var(--gray); box-shadow: var(--shadow-sm); }
.tenant-tabs a.on { border-color: var(--cyan); color: var(--blue-700); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .12); }
.perm-list { display: grid; gap: 20px; }
.perm-list > .card { margin: 0; }
.perm-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); margin-bottom: 16px; }
.perm-who { display: flex; flex-direction: column; flex: 1; min-width: 180px; line-height: 1.3; }
.perm-who strong { font-size: 15px; }
.perm-role { flex-direction: row; align-items: center; gap: 10px; }
.perm-role select { width: 190px !important; height: 38px !important; }
.perm-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.perm-group-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); margin-bottom: 8px; }
.perm-group-title .ic { width: 16px; height: 16px; color: var(--blue); }
.perm-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; transition: background .15s; }
.perm-row:hover { background: var(--sky-2); }
.perm-row.diff { background: var(--warn-bg); border-color: #f6dca6; }
.perm-text { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.perm-text strong { font-size: 13px; }
.perm-text small { font-size: 11.5px; color: var(--muted); }
.perm-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
/* Personalizzazione */
.cz-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.cz-tile { display: grid; gap: 2px; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--ink); transition: all .2s; }
.cz-tile:hover, .cz-tile.on { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--cyan); color: var(--ink); }
.cz-tile small { font-size: 12px; color: var(--muted); }
.cz-tile-ic, .cz-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff; margin-bottom: 8px; flex: none; box-shadow: 0 10px 18px -10px var(--blue); }
.cz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.cz-grid > .card { margin: 0; scroll-margin-top: 90px; }
.cz-widget.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 6px rgba(var(--accent-rgb), .5); } 100% { box-shadow: var(--shadow-sm); } }
.cz-head { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.cz-head .cz-ic { margin: 0; }
.cz-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.cz-logos { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 18px; }
.cz-logo-box { display: grid; justify-items: center; gap: 10px; padding: 18px; border-radius: 14px; background: #fff; border: 1px dashed var(--line); }
.cz-logo-box img { max-width: 100%; height: 64px; object-fit: contain; background: #fff; }
.cz-reset { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.cz-colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cz-color { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.cz-color input, .color-input { width: 44px !important; height: 44px !important; padding: 0 !important; border: 0 !important; border-radius: 12px !important; background: none; cursor: pointer; }
.cz-color span { display: flex; flex-direction: column; font-size: 13px; }
.cz-presets { display: flex; align-items: center; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.cz-presets button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); background: linear-gradient(135deg, var(--b) 0 50%, var(--a) 50%); cursor: pointer; transition: transform .15s; }
.cz-presets button:hover { transform: scale(1.15); }
.cz-preview { border-radius: 14px; border: 1px solid var(--line); overflow: hidden; background: var(--bg); }
.cz-prev-bar { display: flex; gap: 5px; padding: 8px 10px; background: #fff; border-bottom: 1px solid var(--line); }
.cz-prev-bar span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.cz-prev-body { display: flex; height: 120px; }
.cz-prev-side { width: 70px; background: #fff; border-right: 1px solid var(--line); padding: 10px 8px; display: grid; gap: 6px; align-content: start; }
.cz-prev-side i { height: 10px; border-radius: 4px; background: var(--line-2); }
.cz-prev-side i.on { background: var(--sky); box-shadow: inset 3px 0 0 var(--blue); }
.cz-prev-main { flex: 1; padding: 12px; display: grid; gap: 10px; align-content: start; justify-items: start; }
.cz-prev-main b { width: 50%; height: 12px; border-radius: 4px; background: var(--navy); }
.cz-prev-kpis { display: flex; gap: 8px; }
.cz-prev-kpis i { width: 46px; height: 28px; border-radius: 8px; background: var(--grad); }
.cz-prev-kpis i:nth-child(2) { background: var(--cyan); }
.cz-prev-kpis i:nth-child(3) { background: var(--navy); }
.widget-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.widget-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: grab; transition: box-shadow .15s, opacity .15s; }
.widget-item:hover { box-shadow: var(--shadow); }
.widget-item.dragging { opacity: .4; }
.widget-item.off { background: var(--bg); }
.widget-item.off .wi-text { opacity: .55; }
.drag-handle { color: var(--muted); }
.wi-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--sky); color: var(--blue); flex: none; }
.wi-ic .ic { width: 16px; height: 16px; }
.wi-text { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.wi-text strong { font-size: 13.5px; }
.wi-text small { font-size: 12px; color: var(--muted); }
.links-editor { display: grid; gap: 8px; justify-items: start; }
.link-row { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; width: 100%; }
.link-row input { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.chips-check { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-check input { position: absolute; opacity: 0; pointer-events: none; }
.chips-check span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--line); font-size: 12.5px; font-weight: 650; cursor: pointer; color: var(--muted); transition: all .15s; }
.chips-check .ic { width: 14px; height: 14px; }
.chips-check input:checked + span { border-color: var(--cyan); background: var(--sky-2); color: var(--blue-700); }

@media (max-width: 1200px) {
  .cz-grid { grid-template-columns: 1fr; }
  .perm-groups { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .studio-main { grid-template-columns: 1fr 320px; }
}
@media (max-width: 960px) {
  .only-mobile { display: inline-grid !important; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar); transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .sidebar-backdrop { display: none; }
  .nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(13, 38, 51, .4); }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 40px; }
  .context-bar { padding: 10px 16px; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-card-art { display: none; }
  .login { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .user-chip-text { display: none; }
  .studio-body .main { height: auto; }
  .studio-main { grid-template-columns: 1fr; }
  .stage { min-height: 56vh; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .stage-wrap { padding: 12px; }
}
@media (max-width: 640px) {
  .widgets, .perm-groups, .cz-colors, .cz-logos { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-grid, .radio-cards { grid-template-columns: 1fr; }
  .topbar .btn-primary span { display: none; }
  .hero-card-text { padding: 26px 22px; }
  .hero-card-text h2 { font-size: 34px; }
  .legend { display: none; }
  .page-intro { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* v1.2 — conversione formati telecamere */
.up-item.converting .up-bar span { background: linear-gradient(90deg, var(--cyan), #7fb8ff); }
.up-item.converting .up-ic { background: #fff4e0; color: #b26b00; }
.dz-formats.dz-convert { display: block; margin-top: 4px; font-size: 11.5px; color: var(--cyan); text-transform: none; letter-spacing: 0; }

/* v1.3 — responsive: nessun elemento più largo dello schermo */
.main, .content, .studio, .studio-main > *, .perm-list > *, .grid-2 > *, .widgets > * { min-width: 0; }
.perm-foot { flex-wrap: wrap; }
.studio-head-actions { flex-wrap: wrap; justify-content: flex-end; }
.stage-tools-right { flex-wrap: wrap; }
@media (max-width: 960px) {
  .studio-head { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .studio-title { flex-basis: calc(100% - 60px); }
  .studio-head-actions { width: 100%; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .perm-foot > .btn { flex: 1 1 100%; justify-content: center; }
  .perm-role { flex-wrap: wrap; }
  .perm-role select { width: 100% !important; }
  .stage-tools { gap: 8px; }
  .stage-tools-right { gap: 8px; width: 100%; justify-content: space-between; }
  .studio-head-actions .btn { flex: 1 1 100%; justify-content: center; }
  .modal-card, dialog { max-width: calc(100vw - 20px); }
}
@media (max-width: 640px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; flex-wrap: wrap; }
  .table-stack td[data-label]::before { content: attr(data-label); font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; }
  .table-stack td:first-child { justify-content: flex-start; text-align: left; }
  .table-stack td:first-child::before { display: none; }
  .table-stack td.row-actions { justify-content: flex-end; }
  .table-card { overflow: visible; }
  .table-stack td.is-empty { display: none; }
}

/* v1.4 — conversione sul server */
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.ic.spin { animation: spin 1s linear infinite; }
.convert-wait { max-width: 560px; margin: 8vh auto; text-align: center; padding: 36px 28px; }
.convert-wait .ring { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--accent-rgb), .1); color: var(--cyan); }
.convert-wait .ring .ic { width: 34px; height: 34px; }
.convert-wait .bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin: 18px 0 8px; }
.convert-wait .bar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .4s; }
.convert-wait.failed .ring { background: var(--danger-bg); color: var(--danger); }
.server-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; }
.server-status.on { background: var(--ok-bg); color: var(--ok); }
.server-status.off { background: var(--warn-bg); color: var(--warn); }
.server-status .ic { width: 14px; height: 14px; }
.upload-list { grid-template-columns: minmax(0, 1fr); }
.up-item { min-width: 0; }
.up-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 1px 0 6px; }
.up-item.error .up-status { max-width: 45%; }
.modal-card > *, .page-intro > *, .card > * { min-width: 0; }
.who > div { min-width: 0; }
.who strong, .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-input { text-overflow: ellipsis; }

/* ---------- 2.0: riepilogo per soggetti nello studio ---------- */
.region-summary span i { font-style: normal; }
.region-summary b { font-size: 13px; }
.sum-note { margin: 2px 0 0; font-size: 11.5px; line-height: 1.4; }
.region.note { cursor: pointer; border-style: dashed; background: var(--bg); }
.region.note .r-ic { background: #fff; color: var(--muted); }
.region.note strong { color: var(--muted); }
.r-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 2.0: scadenza contrattuale ---------- */
.tenant-ret + .tenant-ret { margin-top: -6px; }
.tenant-contract { background: var(--sky-2); color: var(--blue-700); align-items: flex-start; }
.tenant-contract .ic { margin-top: 1px; }
.tenant-contract .tc-text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.tenant-contract em { font-style: normal; font-size: 12px; font-weight: 600; line-height: 1.5; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .75); white-space: nowrap; }
.tenant-contract.is-near { background: var(--warn-bg); color: #8a5703; }
.tenant-contract.is-expired { background: var(--danger-bg); color: var(--danger); }
.field > small.muted { display: block; margin-top: 6px; font-size: 12px; line-height: 1.4; }
.contract-strip { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm, 0 1px 2px rgba(13, 38, 51, .05)); }
.contract-strip .contract-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--sky); color: var(--blue); }
.contract-strip .contract-ic .ic { width: 20px; height: 20px; }
.contract-strip .contract-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.contract-strip .contract-text strong { color: var(--navy); font-size: 15px; }
.contract-strip .contract-text span { color: var(--muted); font-size: 13px; }
.contract-strip .badge { flex: none; }
.contract-strip.is-near { border-color: #f3d9a4; background: #fffaf0; }
.contract-strip.is-near .contract-ic { background: var(--warn-bg); color: var(--warn); }
.contract-strip.is-expired { border-color: #f1c0c0; background: #fff6f6; }
.contract-strip.is-expired .contract-ic { background: var(--danger-bg); color: var(--danger); }
@media (max-width: 640px) {
  .contract-strip { flex-wrap: wrap; padding: 12px 14px; }
  .contract-strip .contract-text { flex-basis: calc(100% - 60px); }
  .contract-strip .badge { margin-left: 56px; }
}

/* 2.0: stato della conversione sul server (Personalizzazione, Caricamento) */
.cz-status { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 11px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.cz-status .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.cz-status.ok { background: var(--ok-bg, #e8f8f0); color: #116a45; }
.cz-status.warn { background: var(--warn-bg); color: #8a5703; }
.cz-status code { font-size: 12px; background: rgba(255, 255, 255, .7); padding: 1px 6px; border-radius: 6px; }
.cz-status span { min-width: 0; overflow-wrap: anywhere; }

/* 2.0: nomi lunghi senza spazi (file delle telecamere) */
.table td { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .table-stack td { min-width: 0; }
  .table-stack td > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .table-stack td .log-details, .table-stack td small, .table-stack td span { overflow-wrap: anywhere; }
}
@media (max-width: 560px) {
  /* Finestra di caricamento sul telefono: il nome occupa tutta la riga, lo stato va sotto */
  .up-item { flex-wrap: wrap; row-gap: 10px; }
  .up-main { flex: 1 1 0; }
  .up-status { flex: 1 1 100%; text-align: right; white-space: normal; }
  .up-status .btn { width: 100%; justify-content: center; }
  .up-item.error .up-status { max-width: none; text-align: left; }
}
.checks .opt .check-dot { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-bg); }
@media (min-width: 641px) {
  .checks li { grid-template-columns: 16px max-content minmax(0, 1fr); }
  .checks small { text-align: right; }
}

/* ---------- Studio in sola consultazione: l'originale è stato eliminato, resta il file protetto ---------- */
.studio-readonly .stage-tools, .studio-readonly .transport, .studio-readonly .stage-inner,
.studio-readonly .stage-overlay[data-overlay], .studio-readonly .scan-fx,
.studio-readonly .panel-section:not(.ro-summary) { display: none !important; }
.stage-viewer { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 18px; }
.stage-viewer img, .stage-viewer video { display: block; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; border-radius: 6px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); background: #000; }
.stage-viewer video { width: 100%; height: 100%; object-fit: contain; background: transparent; box-shadow: none; }
.ro-summary { border-bottom: 0; flex: 1; align-content: start; gap: 16px; }
.ro-summary .hint { align-items: flex-start; line-height: 1.5; }
.ro-summary .hint .ic { flex: 0 0 auto; margin-top: 2px; }
.ro-facts { margin: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ro-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 14px; font-size: 13px; }
.ro-facts > div + div { border-top: 1px solid var(--line-2); }
.ro-facts dt { color: var(--muted); }
.ro-facts dd { margin: 0; font-weight: 650; color: var(--navy); text-align: right; }
@media (max-width: 960px) {
  /* su una colonna il palco prende l'altezza del file, così la foto in verticale resta grande */
  .studio-readonly .stage { min-height: 0; display: block; flex: 0 0 auto; }
  .studio-readonly .stage-viewer { position: relative; inset: auto; padding: 12px; }
  .studio-readonly .stage-viewer img, .studio-readonly .stage-viewer video { width: auto; height: auto; max-width: 100%; max-height: 72vh; margin: 0 auto; }
  .studio-readonly .stage-viewer video { width: 100%; }
}

/* ---------- Rifiniture responsive della verifica finale ---------- */
/* Intestazioni di pagina: il testo si restringe, i pulsanti d'azione no */
.page-intro > div:first-child { flex: 1 1 0; min-width: 0; }
.page-intro > form, .page-intro > .btn, .page-intro > a.btn { flex: 0 0 auto; }
/* Profilo: una colonna su tablet e telefono, testi lunghi a capo */
.profile-head > div { min-width: 0; }
.profile-head h3, .profile-head p { overflow-wrap: anywhere; }
@media (max-width: 960px) {
  .grid-2.narrow { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .profile-head { gap: 12px; }
  .profile-head .avatar-xl { width: 56px; height: 56px; font-size: 20px; border-radius: 16px; }
}
/* Barra superiore: il titolo si accorcia con i puntini invece di spingere fuori i pulsanti */
.topbar-title { flex: 1 1 0; min-width: 0; }
.topbar-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { flex: 0 0 auto; }
/* Schede dei clienti: mai più larghe dello schermo */
.tenant-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
/* Telefoni molto stretti (320 px e meno) */
@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr; }
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar-title h1 { font-size: 21px; }
  .topbar-actions { gap: 8px; }
  .content { padding-left: 12px; padding-right: 12px; }
}
/* Griglie a una colonna: la colonna non si allarga oltre lo schermo per colpa del contenuto */
@media (max-width: 1200px) {
  .cz-grid { grid-template-columns: minmax(0, 1fr); }
}
.cz-grid > .card, .cz-logos > *, .cz-colors > *, .form-grid > * { min-width: 0; }
.bars { grid-template-columns: repeat(14, minmax(0, 1fr)); }
@media (max-width: 380px) {
  .bars { gap: 4px; }
  .bar small { font-size: 10px; }
}
/* Selettori a segmenti (filtri, viste dello studio): su schermi stretti vanno a capo */
.segmented { max-width: 100%; flex-wrap: wrap; }
/* File di pulsanti allineate a destra: su schermi stretti vanno a capo invece di uscire a sinistra */
.form-actions { flex-wrap: wrap; }
.hero-card { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.hero-card-text { min-width: 0; }
.hero-card-text h2, .hero-card-text p { overflow-wrap: anywhere; }
@media (max-width: 960px) {
  .hero-card { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .hero-card-text { padding: 22px 16px; }
  .hero-card-text h2 { font-size: 32px; }
  .hero-card-actions .btn { width: 100%; justify-content: center; }
}
.cz-foot { flex-wrap: wrap; }
.ret-body > div { min-width: 0; }
@media (max-width: 380px) {
  .ret-body { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ---------- Avanzamento in evidenza (2.0.1): percentuale grande, fase in corso e tempo rimanente ---------- */
.up-pct { flex: none; min-width: 3.3ch; text-align: right; font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--blue); font-variant-numeric: tabular-nums; }
.up-pct:empty, .up-status:empty { display: none; }
.up-stage { margin-top: 6px; font-size: 12.5px; line-height: 1.35; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.up-stage:empty { display: none; }
.up-item.active .up-stage { color: var(--ink); font-weight: 600; }
/* la barra si muove sempre mentre il lavoro è in corso, anche quando la percentuale è ferma */
.up-item.active .up-bar span { background-image: linear-gradient(45deg, rgba(255, 255, 255, .28) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .28) 50%, rgba(255, 255, 255, .28) 75%, transparent 75%), var(--grad); background-size: 18px 18px, 100% 100%; animation: stripes .7s linear infinite; }
.up-item.converting.active .up-bar span { background-image: linear-gradient(45deg, rgba(255, 255, 255, .28) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .28) 50%, rgba(255, 255, 255, .28) 75%, transparent 75%), linear-gradient(90deg, var(--cyan), #7fb8ff); }
.up-item.indet .up-bar span { width: 38% !important; transition: none; animation: indet 1.2s ease-in-out infinite; }
/* attività senza misura: al posto della percentuale gira un anello */
.up-item.indet .up-pct:empty { display: block; min-width: 0; width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes stripes { from { background-position: 0 0, 0 0; } to { background-position: 18px 0, 0 0; } }
.convert-num { display: block; margin-top: 14px; font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -.03em; color: var(--blue); font-variant-numeric: tabular-nums; }
.convert-num:empty { display: none; }
.convert-wait .convert-num + .bar { margin-top: 12px; }
/* la barra parte da sinistra (la regola generica .bar dei grafici la centrava) */
.convert-wait .bar { display: block; }
.big-pct { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--blue); font-variant-numeric: tabular-nums; }
.big-pct:empty { display: none; }
.export-progress .big-pct { justify-self: center; }
.export-progress [data-export-text] { text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  /* telefono: icona, nome e percentuale sulla prima riga; barra, fase in corso e pulsante a tutta larghezza */
  .up-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 7px 10px; align-items: center; }
  .up-main { display: contents; }
  .up-ic { grid-area: 1 / 1; }
  .up-name { grid-area: 1 / 2; }
  .up-pct { grid-area: 1 / 3; font-size: 22px; }
  .up-sub, .up-bar, .up-stage, .up-status { grid-column: 1 / -1; margin: 0; }
  .up-item .up-status { text-align: left; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .up-item.active .up-bar span { animation: none; }
}
