/* ════════════════════════════════════════════════════════════
   Mosaico (MMGGest) — design system
   Dark-first, glass surfaces, gradient accent viola→rosa→arancio
   ════════════════════════════════════════════════════════════ */

:root, [data-theme="dark"] {
    --bg: #0b0b12;
    --bg-2: #11111b;
    --surface: rgba(255, 255, 255, .04);
    --surface-2: rgba(255, 255, 255, .07);
    --surface-solid: #16161f;
    --surface-hover: rgba(255, 255, 255, .09);
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .16);
    --text: #f4f4f8;
    --text-2: #c4c4d4;
    --muted: #8a8aa0;
    --accent: #8b5cf6;
    --accent-2: #ec4899;
    --accent-3: #f97316;
    --grad: linear-gradient(135deg, #8b5cf6 0%, #ec4899 55%, #f97316 100%);
    --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, .18), rgba(236, 72, 153, .14) 55%, rgba(249, 115, 22, .12));
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #f43f5e;
    --info: #06b6d4;
    --shadow: 0 10px 40px -12px rgba(0, 0, 0, .6);
    --shadow-glow: 0 0 0 1px rgba(139, 92, 246, .35), 0 10px 40px -10px rgba(139, 92, 246, .45);
    --glow-1: rgba(139, 92, 246, .22);
    --glow-2: rgba(236, 72, 153, .14);
    --glow-3: rgba(6, 182, 212, .10);
    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #f6f5fb;
    --bg-2: #ffffff;
    --surface: rgba(255, 255, 255, .75);
    --surface-2: rgba(20, 16, 50, .04);
    --surface-solid: #ffffff;
    --surface-hover: rgba(20, 16, 50, .06);
    --border: rgba(20, 16, 50, .09);
    --border-strong: rgba(20, 16, 50, .18);
    --text: #16142a;
    --text-2: #3e3b57;
    --muted: #77738f;
    --shadow: 0 10px 40px -18px rgba(40, 30, 90, .25);
    --glow-1: rgba(139, 92, 246, .16);
    --glow-2: rgba(236, 72, 153, .10);
    --glow-3: rgba(6, 182, 212, .08);
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
    min-height: 100dvh;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(900px 600px at 10% -10%, var(--glow-1), transparent 60%),
        radial-gradient(800px 500px at 100% 0%, var(--glow-2), transparent 60%),
        radial-gradient(700px 700px at 60% 120%, var(--glow-3), transparent 60%),
        var(--bg);
}
h1, h2, h3, h4 { font-family: 'Space Grotesk', 'Inter', sans-serif; letter-spacing: -.02em; margin: 0; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
::selection { background: rgba(139, 92, 246, .4); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.ic { width: 18px; height: 18px; flex-shrink: 0; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 22px; height: 22px; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.success { color: var(--success); }
.danger { color: var(--danger); }
.warning { color: var(--warning); }
.row { display: flex; align-items: center; gap: 10px; }
.row-top { display: flex; align-items: flex-start; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 6px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.gap-lg { gap: 18px; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }
.mb-sm { margin-bottom: 8px; }
.mb { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ── Shell ─────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.shell.collapsed { grid-template-columns: 76px 1fr; }
.sidebar {
    position: sticky; top: 0; height: 100vh; height: 100dvh;
    display: flex; flex-direction: column;
    padding: 18px 14px;
    border-right: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 40%);
    backdrop-filter: blur(20px);
    overflow-y: auto;
    z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; }
.brand-logo { width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0; }
.brand-name { font-family: 'Space Grotesk'; font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.brand-sub { font-size: 11px; color: var(--muted); }
/* Tessy, la mascotte: sbatte le palpebre, saltella al passaggio del mouse, la tessera sopra le gira attorno */
.brand-mark { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 6px 14px rgba(236, 72, 153, .45)); }
.tessy-eyes { transform-box: fill-box; transform-origin: center; animation: tessy-blink 5s infinite; }
.tessy-tile { transform-box: fill-box; transform-origin: center; }
.brand:hover .tessy, .login-art .brand-logo:hover .tessy { animation: tessy-hop .7s cubic-bezier(.34, 1.56, .64, 1); }
.brand:hover .tessy-tile, .login-art .brand-logo:hover .tessy-tile { animation: tessy-spin .7s ease-out; }
@keyframes tessy-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes tessy-hop { 0%, 100% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-5px) rotate(-6deg); } 65% { transform: translateY(0) rotate(4deg); } }
@keyframes tessy-spin { from { transform: rotate(22deg); } to { transform: rotate(382deg); } }
@media (prefers-reduced-motion: reduce) { .tessy, .tessy-eyes, .tessy-tile { animation: none !important; } }
.nav-group { margin-top: 14px; }
.nav-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 0 12px 6px; }
.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
    color: var(--text-2); font-weight: 500; position: relative; transition: all .15s ease;
}
.nav-link:hover { background: var(--surface-hover); color: var(--text); }
.nav-link.active { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .25); }
.nav-link.active::before {
    content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--grad);
}
.nav-link.active .ic { color: var(--accent-2); }
.nav-badge {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
    background: var(--accent-2); color: white; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.shell.collapsed .nav-text, .shell.collapsed .nav-label, .shell.collapsed .brand-text, .shell.collapsed .me-text, .shell.collapsed .nav-badge { display: none; }
.shell.collapsed .nav-link { justify-content: center; }
.sidebar-footer { margin-top: auto; padding-top: 16px; }
.me-card {
    display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px;
    background: var(--surface); border: 1px solid var(--border);
}
.me-level { font-size: 11px; color: var(--muted); }
.xp-mini { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 5px; }
.xp-mini > i { display: block; height: 100%; background: var(--grad); border-radius: 4px; }
.version-tag { display: block; text-align: center; margin-top: 10px; font-size: 10.5px; color: var(--muted); }
.version-tag:hover { color: var(--text-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 15;
    display: flex; align-items: center; gap: 12px; padding: 14px 28px;
    background: color-mix(in srgb, var(--bg) 70%, transparent);
    backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--border);
}
.search {
    display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border); width: min(420px, 40vw); color: var(--muted);
}
.search input { background: none; border: 0; outline: 0; color: var(--text); font: inherit; width: 100%; }
.kbd { font-size: 10.5px; border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 6px; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 28px; max-width: 1600px; width: 100%; margin: 0 auto; }

/* ── Page ─────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header .subtitle { color: var(--muted); margin-top: 4px; }
.page-header .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 1200px) { .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-2-1, .g-1-2, .g-3-2, .g3 { grid-template-columns: minmax(0, 1fr); } .composer { position: static; max-height: none; } }
@media (max-width: 760px) {
    .shell { grid-template-columns: 1fr; }
    .g2, .g4, .g5 { grid-template-columns: minmax(0, 1fr); }
}

/* ── Card ─────────────────────────────────────────── */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px;
    backdrop-filter: blur(12px); box-shadow: var(--shadow); position: relative; min-width: 0;
}
.card.flush { padding: 0; overflow: hidden; }
.card.hover { transition: transform .18s ease, border-color .18s ease, box-shadow .18s; cursor: pointer; }
.card.hover:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-glow); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-header h3 { display: flex; align-items: center; gap: 8px; }
.card.flush .card-header { padding: 18px 20px 0; }
.card.gradient { background: var(--grad-soft); border-color: rgba(139, 92, 246, .3); }
.card.glow::after {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
    background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .6;
}
.divider { height: 1px; background: var(--border); margin: 16px 0; border: 0; }

/* ── KPI ──────────────────────────────────────────── */
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-family: 'Space Grotesk'; font-size: 28px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-value.sm { font-size: 22px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.delta { font-weight: 600; font-size: 12px; padding: 2px 8px; border-radius: 20px; }
.delta.up { color: var(--success); background: rgba(16, 185, 129, .12); }
.delta.down { color: var(--danger); background: rgba(244, 63, 94, .12); }
.kpi-icon {
    width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); color: var(--c, var(--accent));
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 11px;
    border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
    font: 600 13px 'Inter', sans-serif; cursor: pointer; transition: all .15s ease; white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--grad); border-color: transparent; color: white; box-shadow: 0 8px 22px -8px rgba(236, 72, 153, .7); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.1); box-shadow: 0 10px 28px -8px rgba(236, 72, 153, .85); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-success { background: rgba(16, 185, 129, .15); border-color: rgba(16, 185, 129, .4); color: var(--success); }
.btn-danger { background: rgba(244, 63, 94, .12); border-color: rgba(244, 63, 94, .35); color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 14px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: 6px; }
.btn-group { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.btn-group button { background: none; border: 0; color: var(--muted); padding: 6px 12px; border-radius: 8px; font: 600 12px Inter; cursor: pointer; }
.btn-group button.on { background: var(--surface-hover); color: var(--text); box-shadow: 0 1px 0 var(--border-strong) inset; }

/* ── Forms ────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
    width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-strong);
    background: var(--surface-solid); color: var(--text); font: 14px 'Inter', sans-serif; outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, .22); }
.input.sm, .select.sm { padding: 6px 9px; font-size: 13px; border-radius: 8px; }
.input.bare { background: transparent; border-color: transparent; padding: 6px 8px; }
.input.bare:hover { border-color: var(--border); }
.input.bare:focus { border-color: var(--accent); background: var(--surface-solid); }
.textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
input[type=range] { accent-color: var(--accent-2); width: 100%; }
.validation-message { color: var(--danger); font-size: 12px; }

/* ── Table ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
    text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
    padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface-solid);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-hover); }
.table tbody tr.click { cursor: pointer; }
.table tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--border-strong); border-bottom: 0; }
.table.compact td, .table.compact th { padding: 8px 10px; }

/* ── Pills, tags, avatar ──────────────────────────── */
.pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap;
    color: var(--c, var(--text-2)); background: color-mix(in srgb, var(--c, #8a8aa0) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--c, #8a8aa0) 28%, transparent);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.nodot::before { display: none; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.avatar {
    width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    background: linear-gradient(135deg, var(--c, #8b5cf6), color-mix(in srgb, var(--c, #8b5cf6) 55%, #000));
    color: white; font-weight: 700; font-size: 12px; letter-spacing: .02em; border: 2px solid var(--bg);
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.logo-tile {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
    background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 50%, #000)); color: white;
    font-family: 'Space Grotesk'; font-weight: 700; font-size: 16px; box-shadow: 0 6px 18px -6px var(--c);
}
.logo-tile.sm { width: 30px; height: 30px; font-size: 12px; border-radius: 9px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); display: inline-block; flex-shrink: 0; }

/* ── Progress ─────────────────────────────────────── */
.progress { height: 8px; background: var(--surface-2); border-radius: 8px; overflow: hidden; position: relative; }
.progress > i { display: block; height: 100%; border-radius: 8px; background: var(--c, var(--grad)); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.progress.thin { height: 5px; }
.progress .marker { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); border-radius: 2px; opacity: .6; }

/* ── Tabs ─────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
    padding: 10px 14px; background: none; border: 0; color: var(--muted); font: 600 13px Inter; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-image: var(--grad) 1; border-bottom: 2px solid; }
.tab .count { font-size: 11px; background: var(--surface-2); padding: 1px 7px; border-radius: 10px; }

/* ── Kanban ───────────────────────────────────────── */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px; min-height: 300px; display: flex; flex-direction: column; gap: 10px; transition: background .15s, border-color .15s; }
.kanban-col.drop { border-color: var(--accent); background: var(--grad-soft); }
.kanban-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; }
.kanban-head h4 { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kanban-sum { font-size: 11.5px; color: var(--muted); }
.kanban-card {
    background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: grab;
    transition: transform .15s, box-shadow .15s, border-color .15s; border-left: 3px solid var(--c, var(--accent));
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.kanban-card.dragging { opacity: .4; }

/* ── Modal / drawer ───────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 5, 10, .6); backdrop-filter: blur(6px); z-index: 50; display: grid; place-items: center; animation: fade .15s ease; padding: 16px; }
.modal {
    background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 20px; width: min(560px, 100%);
    max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); animation: pop .2s cubic-bezier(.2, .9, .3, 1.2);
}
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.modal-body { padding: 18px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); } }
@keyframes slidein { from { opacity: 0; transform: translateX(30px); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.animate-in > * { animation: rise .4s cubic-bezier(.2, .8, .2, 1) both; }
.animate-in > *:nth-child(2) { animation-delay: .04s; }
.animate-in > *:nth-child(3) { animation-delay: .08s; }
.animate-in > *:nth-child(4) { animation-delay: .12s; }
.animate-in > *:nth-child(5) { animation-delay: .16s; }

/* ── Toasts & notifications ───────────────────────── */
.toast-stack { position: fixed; right: 20px; bottom: 92px; z-index: 60; display: flex; flex-direction: column; gap: 10px; width: 360px; max-width: calc(100vw - 40px); }
.toast {
    display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
    background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); animation: slidein .25s ease;
}
.toast .t-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); font-size: 15px; flex-shrink: 0; }
.toast.success .t-icon { background: rgba(16, 185, 129, .16); color: var(--success); }
.toast.error .t-icon { background: rgba(244, 63, 94, .16); color: var(--danger); }
.toast.achievement { background: linear-gradient(135deg, #2a1650, #3b1230); border-color: rgba(236, 72, 153, .5); color: white; }
[data-theme="light"] .toast.achievement { background: linear-gradient(135deg, #f3e8ff, #fce7f3); color: var(--text); }
.toast.achievement .t-icon { background: var(--grad); font-size: 16px; }
.toast .t-title { font-weight: 700; font-size: 13px; }
.toast .t-body { font-size: 12.5px; color: var(--text-2); }
.toast.achievement .t-body { color: inherit; opacity: .85; }
.bell { position: relative; }
.bell .ping { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 3px var(--bg); }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-height: 480px; overflow: auto;
    background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow); z-index: 40; animation: pop .15s ease;
}
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif:hover { background: var(--surface-hover); }
.notif-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex-shrink: 0; }

/* ── Timer pill (topbar) ──────────────────────────── */
.timer-pill {
    display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 30px;
    background: var(--grad-soft); border: 1px solid rgba(236, 72, 153, .35); font-weight: 600;
}
.timer-pill .live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(236, 72, 153, .7); } 70% { box-shadow: 0 0 0 8px rgba(236, 72, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0); } }

/* ── Empty ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-state.big { padding: 100px 20px; }
.empty-icon { font-size: 40px; }

/* ── Charts ───────────────────────────────────────── */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: Inter; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }
.donut-center { font-family: 'Space Grotesk'; font-weight: 700; fill: var(--text) !important; }
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-item .spread { font-size: 13px; margin-bottom: 5px; }

/* ── Gantt ────────────────────────────────────────── */
.gantt { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); user-select: none; }
.gantt-inner { position: relative; min-width: max-content; }
.gantt-head { display: flex; position: sticky; top: 0; z-index: 8; background: var(--surface-solid); border-bottom: 1px solid var(--border); }
.gantt-label-col { position: sticky; left: 0; z-index: 2; width: 280px; min-width: 280px; background: var(--surface-solid); border-right: 1px solid var(--border); }
.gantt-days { display: flex; }
.gantt-day { flex-shrink: 0; text-align: center; font-size: 10.5px; color: var(--muted); padding: 6px 0; border-left: 1px solid transparent; }
.gantt-day.weekend { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--surface-2) 4px 6px); }
.gantt-day.today { color: var(--accent-2); font-weight: 700; }
.gantt-day.month-start { border-left-color: var(--border-strong); }
.gantt-month { font-size: 11px; font-weight: 700; color: var(--text-2); padding: 6px 10px 0; white-space: nowrap; }
.gantt-row { display: flex; border-bottom: 1px solid var(--border); height: 44px; }
.gantt-row:hover { background: var(--surface-hover); }
.gantt-row.phase { height: 34px; background: var(--surface-2); }
.gantt-row .gantt-label-col { z-index: 7; display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 13px; }
.gantt-row.phase .gantt-label-col { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); background: var(--surface-solid); }
.gantt-track { position: relative; flex-shrink: 0; }
.gantt-bg-weekend { position: absolute; top: 0; bottom: 0; background: var(--surface-2); opacity: .6; pointer-events: none; }
.gantt-bar {
    position: absolute; top: 9px; height: 26px; border-radius: 8px; cursor: grab;
    background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 65%, #000));
    box-shadow: 0 4px 14px -4px var(--c); display: flex; align-items: center; overflow: hidden; transition: box-shadow .15s;
}
.gantt-bar:hover { box-shadow: 0 0 0 2px var(--text), 0 6px 18px -4px var(--c); }
.gantt-bar.dragging { cursor: grabbing; opacity: .85; box-shadow: 0 0 0 2px white, 0 12px 30px -6px var(--c); z-index: 5; }
.gantt-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .22); pointer-events: none; }
.gantt-bar .lbl { position: relative; font-size: 11.5px; color: white; font-weight: 600; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.gantt-bar .handle { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.gantt-bar .handle:hover { background: rgba(255, 255, 255, .3); }
.gantt-bar.phase-bar { top: 13px; height: 8px; border-radius: 4px; cursor: default; opacity: .6; }
.gantt-milestone { position: absolute; top: 12px; width: 20px; height: 20px; transform: rotate(45deg); background: var(--grad); border-radius: 4px; box-shadow: 0 0 16px rgba(236, 72, 153, .6); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent-2); z-index: 2; pointer-events: none; box-shadow: 0 0 10px var(--accent-2); }
.gantt-today::before { content: "OGGI"; position: absolute; top: 2px; left: 4px; font-size: 9px; font-weight: 700; color: var(--accent-2); }
.gantt-dep { position: absolute; pointer-events: none; }

/* ── Workload heatmap ─────────────────────────────── */
.heat { display: grid; gap: 3px; }
.heat-cell { height: 30px; border-radius: 6px; display: grid; place-items: center; font-size: 10.5px; font-weight: 600; color: rgba(255, 255, 255, .9); }
.heat-cell.off { background: transparent; border: 1px dashed var(--border); color: var(--muted); }
.heat-0 { background: var(--surface-2); color: var(--muted); }
.heat-1 { background: rgba(16, 185, 129, .35); }
.heat-2 { background: rgba(16, 185, 129, .65); }
.heat-3 { background: rgba(245, 158, 11, .7); }
.heat-4 { background: rgba(244, 63, 94, .8); }

/* ── Timesheet ────────────────────────────────────── */
.ts-hero {
    position: relative; overflow: hidden; border-radius: 24px; padding: 28px; border: 1px solid rgba(236, 72, 153, .3);
    background: radial-gradient(600px 300px at 0% 0%, rgba(139, 92, 246, .35), transparent 60%), radial-gradient(500px 300px at 100% 100%, rgba(249, 115, 22, .25), transparent 60%), var(--surface-solid);
}
.ts-clock { font-family: 'Space Grotesk'; font-size: 64px; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.ts-clock.running { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.play-btn {
    width: 76px; height: 76px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: white;
    background: var(--grad); box-shadow: 0 12px 34px -8px rgba(236, 72, 153, .8); transition: transform .15s;
}
.play-btn:hover { transform: scale(1.06); }
.play-btn.stop { background: linear-gradient(135deg, #f43f5e, #be123c); animation: pulse 1.6s infinite; }
.play-btn .ic { width: 30px; height: 30px; }
.quick-chip {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border); transition: all .15s; text-align: left; color: var(--text); font: inherit;
}
.quick-chip:hover { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), 0 8px 20px -10px var(--c); transform: translateY(-1px); }
.quick-chip .h { font-family: 'Space Grotesk'; font-weight: 700; font-size: 16px; margin-left: auto; color: var(--c); }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.day-card {
    border-radius: 16px; padding: 14px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: all .15s;
    display: flex; flex-direction: column; gap: 8px; min-height: 120px;
}
.day-card:hover { border-color: var(--border-strong); }
.day-card.selected { border-color: var(--accent); box-shadow: var(--shadow-glow); }
.day-card.today .day-name { color: var(--accent-2); }
.day-card.weekend { opacity: .55; }
.day-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.day-hours { font-family: 'Space Grotesk'; font-size: 26px; font-weight: 700; }
.day-stack { display: flex; height: 6px; border-radius: 6px; overflow: hidden; background: var(--surface-2); margin-top: auto; }
.day-stack i { display: block; height: 100%; }
.day-card.complete .day-hours::after { content: " ✓"; font-size: 16px; color: var(--success); }
.entry { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--c); }
.entry:hover { border-color: var(--border-strong); border-left-color: var(--c); }
.entry-hours { font-family: 'Space Grotesk'; font-weight: 700; font-size: 18px; min-width: 56px; text-align: right; }
.hour-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.hour-picker button {
    padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: 600 13px Inter; cursor: pointer;
}
.hour-picker button.on { background: var(--grad); color: white; border-color: transparent; }

/* ── Gamification ─────────────────────────────────── */
.level-ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.level-ring .inner { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.level-num { font-family: 'Space Grotesk'; font-size: 36px; font-weight: 700; line-height: 1; }
.streak { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; background: rgba(249, 115, 22, .15); color: #fb923c; font-weight: 700; border: 1px solid rgba(249, 115, 22, .35); }
.coins { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px; background: rgba(245, 158, 11, .15); color: #fbbf24; font-weight: 700; border: 1px solid rgba(245, 158, 11, .35); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.badge-card {
    text-align: center; padding: 18px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
    display: flex; flex-direction: column; align-items: center; gap: 6px; transition: transform .2s;
}
.badge-card:hover { transform: translateY(-3px) rotate(-1deg); }
.badge-card .b-icon {
    width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 28px;
    background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 60%, white), var(--c)); box-shadow: 0 8px 24px -6px var(--c);
}
.badge-card.locked { opacity: .35; filter: grayscale(1); }
.badge-card.locked .b-icon { box-shadow: none; }
.badge-card.rare { border-color: rgba(129, 140, 248, .4); }
.badge-card.epic { border-color: rgba(236, 72, 153, .5); box-shadow: 0 0 24px -8px rgba(236, 72, 153, .6); }
.badge-card.legendary { border-color: rgba(245, 158, 11, .6); box-shadow: 0 0 30px -6px rgba(245, 158, 11, .6); }
.rarity { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--muted); }
.leader { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; }
.leader:hover { background: var(--surface-hover); }
.leader.me { background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .3); }
.rank { width: 26px; font-family: 'Space Grotesk'; font-weight: 700; color: var(--muted); text-align: center; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 12px; margin-bottom: 16px; }
.podium-step { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.podium-block { width: 100%; border-radius: 14px 14px 4px 4px; display: grid; place-items: center; font-family: 'Space Grotesk'; font-weight: 700; font-size: 26px; color: white; }
.podium-1 .podium-block { height: 110px; background: linear-gradient(180deg, #f59e0b, #b45309); box-shadow: 0 10px 40px -10px #f59e0b; }
.podium-2 .podium-block { height: 80px; background: linear-gradient(180deg, #94a3b8, #475569); }
.podium-3 .podium-block { height: 60px; background: linear-gradient(180deg, #fb923c, #9a3412); }
.reward-card { display: flex; flex-direction: column; gap: 10px; }
.reward-icon { font-size: 34px; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--grad-soft); }
.xp-feed { display: flex; flex-direction: column; gap: 4px; }
.xp-feed .row { padding: 8px 10px; border-radius: 10px; }
.xp-feed .row:hover { background: var(--surface-hover); }
.xp-amt { margin-left: auto; font-weight: 700; color: var(--accent-2); font-variant-numeric: tabular-nums; }

/* ── Composer ─────────────────────────────────────── */
.composer { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }
.sugg {
    padding: 12px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px;
    transition: all .15s; border-left: 3px solid var(--c);
}
.sugg:hover { border-color: var(--border-strong); border-left-color: var(--c); box-shadow: var(--shadow); }
.sugg.required { border-color: rgba(244, 63, 94, .5); background: color-mix(in srgb, var(--danger) 6%, var(--surface-solid)); }
.score { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.score .progress { flex: 1; height: 5px; }
.reason { font-size: 12px; color: var(--text-2); display: flex; gap: 6px; }
.reason::before { content: "→"; color: var(--accent-2); }
.objective-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.obj-chip { padding: 5px 11px; border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer; font: 600 12px Inter; transition: all .12s; }
.obj-chip.on { background: var(--grad); color: white; border-color: transparent; }
.warn { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; align-items: flex-start; }
.warn.error { background: rgba(244, 63, 94, .1); color: #fda4af; border: 1px solid rgba(244, 63, 94, .3); }
.warn.warning { background: rgba(245, 158, 11, .1); color: #fcd34d; border: 1px solid rgba(245, 158, 11, .3); }
.warn.info { background: rgba(6, 182, 212, .1); color: #67e8f9; border: 1px solid rgba(6, 182, 212, .3); }
[data-theme="light"] .warn.error { color: #be123c; }
[data-theme="light"] .warn.warning { color: #b45309; }
[data-theme="light"] .warn.info { color: #0e7490; }
.line-table td { padding: 6px 8px; }
.line-table .phase-row td { background: var(--surface-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.line-table tr.optional td { opacity: .55; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; font-size: 13px; }
.totals .grand { font-family: 'Space Grotesk'; font-size: 24px; font-weight: 700; }
.margin-meter { height: 10px; border-radius: 10px; background: linear-gradient(90deg, #f43f5e 0%, #f59e0b 30%, #10b981 55%, #10b981 100%); position: relative; }
.margin-meter .needle { position: absolute; top: -4px; width: 4px; height: 18px; border-radius: 3px; background: var(--text); box-shadow: 0 0 0 2px var(--bg); transition: left .4s; }

/* ── Approval timeline ───────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.tl-item:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border); }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); border: 2px solid var(--border-strong); font-size: 13px; }
.tl-item.approved .tl-dot { background: rgba(16, 185, 129, .18); border-color: var(--success); color: var(--success); }
.tl-item.rejected .tl-dot { background: rgba(244, 63, 94, .18); border-color: var(--danger); color: var(--danger); }
.tl-item.pending .tl-dot { border-color: var(--warning); color: var(--warning); animation: pulse 2s infinite; }
.steps-bar { display: flex; gap: 4px; }
.steps-bar i { flex: 1; height: 5px; border-radius: 4px; background: var(--surface-2); }
.steps-bar i.ok { background: var(--success); }
.steps-bar i.ko { background: var(--danger); }
.steps-bar i.now { background: var(--warning); }

/* ── Files ────────────────────────────────────────── */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.file-card { border-radius: 14px; border: 1px solid var(--border); background: var(--surface); overflow: hidden; transition: all .15s; display: flex; flex-direction: column; }
.file-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.file-thumb { height: 110px; display: grid; place-items: center; font-size: 34px; background: var(--grad-soft); overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-meta { padding: 10px 12px; }
.drop-zone { border: 2px dashed var(--border-strong); border-radius: 16px; padding: 22px; text-align: center; color: var(--muted); transition: all .15s; position: relative; }
.drop-zone:hover { border-color: var(--accent); background: var(--grad-soft); color: var(--text); }
.drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.folder-tree { display: flex; flex-direction: column; gap: 2px; }
.folder-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.folder-item:hover { background: var(--surface-hover); }
.folder-item.active { background: var(--grad-soft); color: var(--text); }

/* ── Manuale ──────────────────────────────────────── */
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1000px) { .doc-layout { grid-template-columns: 1fr; } .doc-toc { position: static !important; } }
.doc-toc { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 2px; }
.doc-toc a { padding: 7px 12px; border-radius: 9px; color: var(--text-2); font-size: 13px; }
.doc-toc a:hover { background: var(--surface-hover); color: var(--text); }
.doc-toc .sub { padding-left: 24px; font-size: 12.5px; color: var(--muted); }
.doc { display: flex; flex-direction: column; gap: 22px; }
.doc section { scroll-margin-top: 90px; }
.doc h2 { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.doc h3 { margin: 18px 0 8px; }
.doc p, .doc li { color: var(--text-2); line-height: 1.7; }
.doc ul, .doc ol { margin: 8px 0; padding-left: 22px; }
.doc code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; color: var(--text); }
.doc pre { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.6; }
.doc pre code { background: none; padding: 0; }
.callout { padding: 14px 16px; border-radius: 12px; background: var(--grad-soft); border: 1px solid rgba(139, 92, 246, .3); color: var(--text-2); }
.shot { margin: 14px 0 18px; }
.shot img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: transform .2s; }
.shot a:hover img { transform: translateY(-2px); }
.shot figcaption { margin-top: 8px; font-size: 12.5px; color: var(--muted); text-align: center; }
.shot .shot-light { display: none; }
[data-theme="light"] .shot .shot-dark { display: none; }
[data-theme="light"] .shot .shot-light { display: block; }
.shot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 18px; }
.release { position: relative; padding-left: 26px; }
.release::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: -22px; width: 2px; background: var(--border); }
.release:last-child::before { display: none; }
.release-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 14px rgba(236, 72, 153, .6); }
.release-version { font-family: 'Space Grotesk'; font-size: 22px; font-weight: 700; }
.codename { font-family: 'Space Grotesk'; font-style: italic; }
.arch svg { width: 100%; height: auto; }
.arch .box { fill: var(--surface-solid); stroke: var(--border-strong); }
.arch .box-accent { fill: color-mix(in srgb, var(--accent) 14%, var(--surface-solid)); stroke: var(--accent); }
.arch .box-ext { fill: color-mix(in srgb, var(--info) 10%, var(--surface-solid)); stroke: var(--info); stroke-dasharray: 5 4; }
.arch text { fill: var(--text); font-family: Inter; font-size: 12px; }
.arch .t-title { font-family: 'Space Grotesk'; font-weight: 700; font-size: 13.5px; }
.arch .t-sub { fill: var(--muted); font-size: 11px; }
.arch .edge { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.arch .edge-live { stroke: var(--accent-2); stroke-width: 1.8; fill: none; stroke-dasharray: 6 5; animation: dash 1.2s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -22; } }

/* ── Login ────────────────────────────────────────── */
.login-page { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
@media (max-width: 900px) { .login-page { grid-template-columns: 1fr; } .login-art { display: none !important; } }
.login-art {
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 56px;
    background: radial-gradient(700px 500px at 20% 20%, rgba(139, 92, 246, .55), transparent 60%), radial-gradient(600px 500px at 80% 60%, rgba(236, 72, 153, .45), transparent 60%), radial-gradient(500px 400px at 40% 100%, rgba(249, 115, 22, .45), transparent 60%), #0b0b12;
}
.login-art h1 { font-size: 56px; line-height: 1.02; color: white; max-width: 560px; }
.login-art p { color: rgba(255, 255, 255, .75); font-size: 16px; margin-top: 14px; max-width: 480px; }
.blob { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .7; animation: float 12s ease-in-out infinite; }
@keyframes float { 50% { transform: translate(30px, -40px) scale(1.1); } }
.login-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; }
.demo-users { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-users button { font: 500 11.5px Inter; padding: 5px 10px; border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer; }
.demo-users button:hover { border-color: var(--accent); color: var(--text); }

.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.boot-logo { width: 72px; height: 72px; display: grid; place-items: center; }
.boot-logo .tessy { animation: tessy-hop 1.1s cubic-bezier(.34, 1.56, .64, 1) infinite; }
.boot-logo .tessy-tile { animation: tessy-spin 1.1s ease-in-out infinite; }

#blazor-error-ui { background: var(--danger); color: white; bottom: 0; display: none; left: 0; padding: .6rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
/* Riconnessione del circuito Blazor (elemento #components-reconnect-modal in App.razor, classi impostate da Blazor) */
.reconnect { display: none; position: fixed; inset: 0; z-index: 200; place-items: center; padding: 20px; background: rgba(5, 5, 10, .55); backdrop-filter: blur(6px); }
.reconnect.components-reconnect-show, .reconnect.components-reconnect-failed, .reconnect.components-reconnect-rejected { display: grid; }
.reconnect-card {
    display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 28px; max-width: 320px; text-align: center;
    background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 20px; box-shadow: var(--shadow); animation: pop .2s ease;
}
.reconnect-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border-strong); border-top-color: var(--accent-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.reconnect-text { display: flex; flex-direction: column; gap: 4px; }
.reconnect .rc-show, .reconnect .rc-failed, .reconnect .rc-rejected { display: none; }
.reconnect.components-reconnect-show .rc-show, .reconnect.components-reconnect-failed .rc-failed, .reconnect.components-reconnect-rejected .rc-rejected { display: block; }
.reconnect.components-reconnect-failed .reconnect-spin, .reconnect.components-reconnect-rejected .reconnect-spin { border-top-color: var(--danger); animation: none; }
/* Cambio pagina lento (#nav-loading in App.razor, classe .show messa da app.js): sotto la finestra di riconnessione, che ha la precedenza */
.nav-loading { z-index: 199; }
.nav-loading.show { display: grid; }

/* confetti */
.confetti { position: fixed; top: -10px; width: 9px; height: 14px; z-index: 100; pointer-events: none; border-radius: 2px; animation: confetti-fall linear forwards; }
@keyframes confetti-fall { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); opacity: .9; } }

/* ── Chat ─────────────────────────────────────────── */
.chat-shell {
    display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 130px); min-height: 480px;
    border: 1px solid var(--border); border-radius: 20px; overflow: hidden; background: var(--surface); backdrop-filter: blur(12px);
}
.chat-shell.with-info { grid-template-columns: 320px minmax(0, 1fr) 290px; }
.chat-info-close { display: none; }
/* Sotto i 900px si vede un pannello alla volta: elenco oppure conversazione; i dettagli si aprono sopra a tutto schermo */
@media (max-width: 900px) {
    .chat-shell, .chat-shell.with-info { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
    .chat-shell .chat-list.hide-mobile, .chat-shell .chat-thread.hide-mobile { display: none; }
    .chat-shell .chat-info {
        position: fixed; inset: 0; z-index: 125; border-left: 0; background: var(--surface-solid);
        padding: calc(14px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom)); animation: sheet .25s cubic-bezier(.2, .8, .2, 1);
    }
    .chat-info-close { display: flex; }
}
.chat-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { padding: 16px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--border); }
.chat-list-items { overflow-y: auto; flex: 1; padding: 8px; }
.conv { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; cursor: pointer; transition: background .12s; position: relative; }
.conv:hover { background: var(--surface-hover); }
.conv.active { background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .3); }
.conv-avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); color: white; font-weight: 700; }
.conv-avatar.round { border-radius: 50%; font-size: 14px; }
.conv-title { font-weight: 600; font-size: 13.5px; }
.conv-preview { font-size: 12.5px; color: var(--muted); }
.conv.unread .conv-title, .conv.unread .conv-preview { color: var(--text); font-weight: 700; }
.unread-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--grad); color: white; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.online-dot { position: absolute; left: 44px; top: 42px; width: 11px; height: 11px; border-radius: 50%; background: var(--success); border: 2px solid var(--surface-solid); }

.chat-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.chat-messages { flex: 1; overflow-y: auto; padding: 18px 22px 8px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
.day-sep { align-self: center; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 3px 12px; border-radius: 20px; margin: 14px 0 8px; }
.sys-msg { align-self: center; font-size: 12px; color: var(--muted); padding: 4px 12px; margin: 6px 0; }
.msg-row { display: flex; gap: 10px; align-items: flex-end; position: relative; padding: 1px 0; }
.msg-row.first { margin-top: 10px; }
.msg-row.mine { flex-direction: row-reverse; }
.msg-row .avatar-slot { width: 32px; flex-shrink: 0; }
.msg-col { display: flex; flex-direction: column; max-width: min(620px, 72%); min-width: 0; }
.msg-row.mine .msg-col { align-items: flex-end; }
.msg-author { font-size: 11.5px; font-weight: 700; margin: 0 12px 3px; }
.bubble {
    padding: 9px 14px; border-radius: 18px; background: var(--surface-solid); border: 1px solid var(--border);
    font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; position: relative;
}
.msg-row:not(.mine) .bubble { border-bottom-left-radius: 6px; }
.msg-row.mine .bubble { background: var(--grad); color: white; border-color: transparent; border-bottom-right-radius: 6px; box-shadow: 0 6px 18px -8px rgba(236, 72, 153, .6); }
.msg-row.mine:not(.last) .bubble, .msg-row:not(.mine):not(.last) .bubble { border-radius: 18px; }
.bubble.jumbo { background: transparent !important; border: 0 !important; box-shadow: none !important; font-size: 40px; padding: 0 4px; line-height: 1.2; }
.bubble.deleted { font-style: italic; opacity: .6; background: transparent !important; color: var(--muted) !important; border: 1px dashed var(--border-strong) !important; box-shadow: none !important; }
.bubble a { text-decoration: underline; }
.bubble .mention { font-weight: 700; background: rgba(139, 92, 246, .2); border-radius: 5px; padding: 0 3px; }
.msg-row.mine .bubble .mention { background: rgba(255, 255, 255, .25); }
.msg-meta { font-size: 10.5px; color: var(--muted); margin: 3px 10px 0; display: flex; gap: 6px; align-items: center; }
.reply-quote { font-size: 12px; padding: 6px 10px; border-left: 3px solid var(--accent-2); background: var(--surface-2); border-radius: 8px; margin-bottom: 4px; color: var(--text-2); max-width: 100%; }
.msg-row.mine .reply-quote { background: rgba(255, 255, 255, .06); }
.reply-quote { cursor: pointer; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.reply-quote:hover { color: var(--text); }
.bubble { cursor: pointer; }
.bubble .mention.me { background: rgba(236, 72, 153, .28); }
.msg-row.mentions-me .bubble { box-shadow: inset 3px 0 0 var(--accent-2); }
.msg-row.flash .bubble { animation: msg-flash 1.8s ease; }
@keyframes msg-flash { 0%, 55% { box-shadow: 0 0 0 3px var(--accent-2), 0 0 22px rgba(236, 72, 153, .5); } 100% { box-shadow: 0 0 0 0 transparent; } }
.msg-meta.email-note { color: var(--text-2); }
.mention-badge { min-width: 20px; height: 20px; border-radius: 10px; background: color-mix(in srgb, var(--accent-2) 22%, var(--surface-solid)); color: var(--accent-2); font-size: 12px; font-weight: 800; display: grid; place-items: center; margin-right: 4px; }
.conv .spread > .mention-badge { margin-left: auto; }
.mention-pop {
    position: fixed; z-index: 400; width: 280px; max-width: calc(100vw - 16px); padding: 4px; border-radius: 14px;
    background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .6);
}
.mention-item { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--text); }
.mention-item span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention-item.on, .mention-item:hover { background: var(--grad-soft); }
.color-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.color-choice button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; }
.color-choice button.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface-solid) inset; }
.member-actions { display: flex; gap: 2px; flex-shrink: 0; }
.reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.reaction {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 13px; cursor: pointer;
    background: var(--surface-solid); border: 1px solid var(--border-strong); transition: transform .12s; font-family: inherit; color: var(--text);
}
.reaction:hover { transform: scale(1.08); }
.reaction.mine { border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 16%, var(--surface-solid)); }
.reaction b { font-size: 11px; font-weight: 700; }
.reaction.pop { animation: pop .25s cubic-bezier(.2, .9, .3, 1.6); }
.msg-tools {
    position: absolute; top: -18px; display: none; gap: 2px; padding: 3px; border-radius: 12px; z-index: 4;
    background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
}
.msg-row:not(.mine) .msg-tools { left: 52px; }
.msg-row.mine .msg-tools { right: 10px; }
.msg-row:hover .msg-tools, .msg-tools.open { display: flex; }
.msg-tools button { background: none; border: 0; cursor: pointer; font-size: 17px; width: 30px; height: 30px; border-radius: 8px; color: var(--text-2); display: grid; place-items: center; }
.msg-tools button:hover { background: var(--surface-hover); transform: scale(1.15); }
.msg-tools .sep { width: 1px; background: var(--border); margin: 4px 2px; }
.typing { font-size: 12px; color: var(--muted); padding: 0 22px 6px; height: 22px; display: flex; align-items: center; gap: 6px; }
.typing .dots span { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); margin-right: 2px; animation: blink 1.2s infinite; }
.typing .dots span:nth-child(2) { animation-delay: .2s; }
.typing .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-composer { padding: 10px 16px 16px; border-top: 1px solid var(--border); position: relative; }
.composer-box { display: flex; align-items: flex-end; gap: 8px; background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 18px; padding: 6px 6px 6px 10px; transition: border .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 92, 246, .2); }
.composer-box textarea { flex: 1; background: none; border: 0; outline: 0; resize: none; color: var(--text); font: 14px/1.45 Inter, sans-serif; max-height: 160px; min-height: 22px; padding: 7px 4px; }
.composer-box .send { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--grad); color: white; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; transition: transform .12s; }
.composer-box .send:hover { transform: scale(1.08); }
.composer-box .send:disabled { opacity: .35; transform: none; cursor: default; }
.composer-context { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 6px 10px; margin-bottom: 8px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--accent-2); }
.emoji-btn { background: none; border: 0; font-size: 20px; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; filter: grayscale(.3); }
.emoji-btn:hover { background: var(--surface-hover); filter: none; }
.emoji-picker {
    position: absolute; bottom: calc(100% + 6px); width: 330px; max-width: calc(100vw - 40px); z-index: 30;
    background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .6); animation: pop .15s ease;
}
.emoji-picker.left { left: 16px; }
.emoji-picker.inline { position: absolute; bottom: auto; top: 30px; }
.emoji-tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); }
.emoji-tabs button { flex: 1; background: none; border: 0; font-size: 17px; padding: 5px 0; border-radius: 8px; cursor: pointer; opacity: .55; }
.emoji-tabs button.on, .emoji-tabs button:hover { opacity: 1; background: var(--surface-hover); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; max-height: 240px; overflow-y: auto; }
.emoji-grid button { background: none; border: 0; font-size: 22px; aspect-ratio: 1; border-radius: 8px; cursor: pointer; transition: transform .1s; }
.emoji-grid button:hover { background: var(--surface-hover); transform: scale(1.2); }
.chat-info { border-left: 1px solid var(--border); padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.people-pick { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.person:hover { background: var(--surface-hover); }
.person.on { background: var(--grad-soft); }
.emoji-choice { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-choice button { font-size: 20px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.emoji-choice button.on { border-color: var(--accent-2); background: var(--grad-soft); }

/* ── Monitoraggio ─────────────────────────────────── */
.journey { display: flex; overflow-x: auto; padding: 4px 0 2px; }
.j-step { flex: 1; min-width: 96px; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; gap: 2px; }
.j-line { position: absolute; top: 19px; left: 0; right: 0; height: 3px; background: var(--surface-2); z-index: 0; }
.j-line.first { left: 50%; }
.j-line.last { right: 50%; }
.j-line.on { background: var(--grad); }
.j-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; z-index: 1; font-size: 16px; background: var(--surface-solid); border: 2px solid var(--border-strong); color: var(--muted); }
.j-step.done .j-dot { background: linear-gradient(135deg, #10b981, #059669); border-color: transparent; color: white; font-weight: 700; }
.j-step.current .j-dot { background: var(--grad); border-color: transparent; box-shadow: 0 0 0 5px rgba(236, 72, 153, .2); animation: pulse 2s infinite; }
.j-label { font-weight: 700; font-size: 12.5px; margin-top: 6px; }
.j-step.todo .j-label { color: var(--muted); font-weight: 600; }
.j-date { font-size: 11px; color: var(--muted); min-height: 15px; }
.j-detail { font-size: 11px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 1px 8px; }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 50px; gap: 12px; align-items: center; }
.funnel-label { display: flex; flex-direction: column; font-size: 13px; }
.funnel-track { display: flex; justify-content: center; }
.funnel-bar { height: 38px; border-radius: 10px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 60%, #000)); display: grid; place-items: center; color: white; font-weight: 700; box-shadow: 0 8px 20px -10px var(--c); transition: width .6s cubic-bezier(.2, .8, .2, 1); min-width: 36px; }
.funnel-conv { font-size: 12px; font-weight: 700; color: var(--text-2); text-align: right; }
.gauge-row { display: grid; grid-template-columns: 130px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; }
.stack-bar { display: flex; height: 30px; border-radius: 10px; overflow: hidden; }
.stack-bar > div { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; min-width: 2px; }
.phase-bars { display: flex; flex-direction: column; gap: 12px; }
.phase-bar-track { position: relative; height: 12px; background: var(--surface-2); border-radius: 8px; overflow: visible; }
.phase-bar-track .est { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 8px; background: color-mix(in srgb, var(--c) 30%, transparent); border: 1px dashed var(--c); }
.phase-bar-track .act { position: absolute; top: 2px; bottom: 2px; left: 0; border-radius: 6px; background: var(--c); }
.phase-bar-track .act.over { background: repeating-linear-gradient(45deg, #f43f5e 0 6px, #be123c 6px 12px); }
.mini-cockpit { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; }

/* ── Assistente AI ────────────────────────────────── */
.insight { border-left: 4px solid var(--c); }
.insight-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; background: color-mix(in srgb, var(--c) 16%, transparent); }
.slider input[type=range] { margin-top: 6px; }
.advisor-chat { display: flex; flex-direction: column; min-height: calc(100vh - 260px); }
.advisor-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 4px; max-height: calc(100vh - 340px); }
.advisor-turn { display: flex; gap: 12px; align-items: flex-start; }
.advisor-turn.user { flex-direction: row-reverse; }
.advisor-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 13px; font-weight: 700; background: var(--surface-2); }
.advisor-turn.ai .advisor-avatar { background: var(--grad); color: white; }
.advisor-bubble { max-width: min(760px, 85%); padding: 12px 16px; border-radius: 16px; background: var(--surface-solid); border: 1px solid var(--border); line-height: 1.6; font-size: 14px; }
.advisor-turn.user .advisor-bubble { background: var(--grad-soft); border-color: rgba(139, 92, 246, .3); white-space: pre-wrap; }
.advisor-bubble h3, .advisor-bubble h4 { margin: 12px 0 6px; font-size: 15px; }
.advisor-bubble h3:first-child, .advisor-bubble h4:first-child { margin-top: 0; }
.advisor-bubble p { margin: 6px 0; }
.advisor-bubble ul, .advisor-bubble ol { margin: 6px 0; padding-left: 20px; }
.advisor-bubble li { margin: 3px 0; }
.advisor-bubble code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.advisor-bubble .md-table { margin: 8px 0; font-size: 13px; }
.advisor-bubble .md-table th { position: static; }

/* barra superiore: la ricerca si restringe per prima sugli schermi medi */
.topbar .search { flex: 1 1 auto; width: auto; max-width: 420px; min-width: 140px; }
.topbar-actions { flex-shrink: 0; }

/* ── Chi è online (topbar) ───────────────────────── */
.online-trigger { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 6px; border-radius: 999px; }
.online-trigger .avatar { border-color: var(--surface-solid); }
.online-count { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.online-dropdown { width: 320px; }
.online-dropdown a.notif:not([href]) { cursor: default; }
@media (max-width: 760px) { .online-trigger .avatar-stack { display: none; } }

/* ── Database explorer (Platform admin) ───────────── */
.db-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.db-side { padding: 12px; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow-y: auto; }
.db-side .search { width: 100%; }
.db-main { min-width: 0; }
.db-sql { width: 100%; font-size: 13px; line-height: 1.5; resize: vertical; tab-size: 4; }
.db-grid { max-height: 62vh; overflow: auto; }
.db-grid thead th { position: sticky; top: 0; background: var(--surface-solid); z-index: 1; }
.db-grid td { white-space: nowrap; font-size: 12.5px; }
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--text); }
.th-sort .sort-arrow { display: inline-block; width: 1em; margin-left: 4px; font-size: 9px; }
.db-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.db-sort:hover { color: var(--text); }
.db-null { font-size: 11px; font-style: italic; color: var(--muted); opacity: .7; }
.db-cell { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; }
.db-ddl { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin: 0; max-height: 300px; overflow: auto; }
@media (max-width: 900px) { .db-shell { grid-template-columns: minmax(0, 1fr); } .db-side { position: static; max-height: 260px; } }

/* ── Report e composer ─────────────────────────────────────── */
.report-cat { display: flex; align-items: center; gap: 8px; font: 600 12px Inter; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin: 22px 0 10px; }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.report-card { display: flex; gap: 14px; align-items: flex-start; text-align: left; cursor: pointer; font: inherit; color: inherit; width: 100%; }
.report-card .kpi-icon { flex-shrink: 0; }
.report-card-title { font: 600 15px 'Space Grotesk', Inter, sans-serif; margin-bottom: 3px; }
.report-grid { max-height: 70vh; overflow: auto; }
.report-grid thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-solid); }
.report-grid tfoot td { position: sticky; bottom: 0; background: var(--surface-solid); }
.report-grid td.strong { font-weight: 600; }
.report-grid th, .report-grid td { white-space: nowrap; }
.report-grid td { max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.period-picker .btn-group { flex-wrap: wrap; }

.composer-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 18px; align-items: start; }
.composer-panel { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; padding: 0; }
.cp-section { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.cp-section:last-child { border-bottom: 0; }
.cp-label { display: flex; align-items: baseline; gap: 8px; font: 600 13px Inter; margin-bottom: 10px; }
.cp-label > span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--grad); color: white; font-size: 11px; flex-shrink: 0; }
.cp-label em { font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.dataset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dataset-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 600 12px Inter; cursor: pointer; transition: all .12s; }
.dataset-tile:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.dataset-tile.on { border-color: var(--accent); box-shadow: var(--shadow-glow); color: var(--text); }
.dataset-tile.on .ic { color: var(--accent); }
.cp-chip { display: inline-flex; align-items: center; gap: 4px; cursor: default; }
.cp-chip button { background: rgba(255, 255, 255, .22); border: 0; color: white; border-radius: 10px; width: 18px; height: 18px; line-height: 1; cursor: pointer; font: 700 12px Inter; padding: 0; }
.cp-chip button:hover { background: rgba(255, 255, 255, .4); }
.cp-add { width: auto; border-radius: 20px; }
.obj-chip.sm { padding: 3px 9px; font-size: 11.5px; }
.filter-box { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
.filter-values { max-height: 150px; overflow-y: auto; }
.cp-chart { border-top: 1px solid var(--border); padding-top: 14px; }
@media (max-width: 1100px) { .composer-layout { grid-template-columns: minmax(0, 1fr); } .composer-panel { position: static; max-height: none; } }

/* ── Calendario scadenze ─────────────────────────── */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.cal-month { font-family: 'Space Grotesk'; font-weight: 700; font-size: 20px; min-width: 170px; text-align: right; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 10px 8px; text-align: center; border-bottom: 1px solid var(--border); }
.cal-day {
    min-height: 118px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background .15s; min-width: 0;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:nth-last-child(-n+7) { border-bottom: 0; }
.cal-day:hover { background: var(--surface-hover); }
.cal-day.other { opacity: .45; }
.cal-day.weekend { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--surface-2) 4px 6px); }
.cal-day.selected { box-shadow: inset 0 0 0 2px var(--accent); background: var(--grad-soft); opacity: 1; }
.cal-num { font-size: 12px; font-weight: 600; color: var(--text-2); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--grad); color: white; }
.cal-item {
    display: flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 7px; font-size: 11.5px; font-weight: 500; color: var(--text); min-width: 0;
    background: color-mix(in srgb, var(--c) 18%, transparent); border-left: 3px solid var(--c); transition: background .15s;
}
.cal-item:hover { background: color-mix(in srgb, var(--c) 34%, transparent); }
.cal-item .ic { width: 12px; height: 12px; color: var(--c); }
.cal-item.done { opacity: .5; text-decoration: line-through; }
.cal-item.late { border-left-color: var(--danger); box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .4); }
.cal-more { font-size: 11px; color: var(--muted); font-weight: 600; padding-left: 7px; }
.cal-side { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }
.cal-daylabel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; display: flex; justify-content: space-between; }
.cal-daylabel.danger { color: var(--danger); }
.cal-entry {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; margin-bottom: 6px; color: var(--text);
    border: 1px solid var(--border); border-left: 3px solid var(--c); background: var(--surface); transition: all .15s;
}
.cal-entry:hover { border-color: var(--border-strong); border-left-color: var(--c); background: var(--surface-hover); }
.cal-entry.done { opacity: .55; }
.cal-entry .ic { width: 15px; height: 15px; color: var(--c); }
.cal-filter {
    display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: all .15s;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: 600 12px Inter;
}
.cal-filter:hover { background: var(--surface-hover); color: var(--text); }
.cal-filter.off { opacity: .45; text-decoration: line-through; }
.cal-filter .n { font-size: 11px; background: var(--surface-2); padding: 1px 7px; border-radius: 10px; }
@media (max-width: 1100px) { .cal-layout { grid-template-columns: minmax(0, 1fr); } .cal-side { position: static; max-height: none; } .cal-day { min-height: 84px; } }

/* ── Connettori ───────────────────────────────────── */
.conn-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.conn-hero-logos { display: flex; flex-wrap: wrap; gap: 8px; max-width: 440px; justify-content: flex-end; }
.conn-hero-logos .logo-tile { width: 38px; height: 38px; font-size: 11px; border-radius: 11px; cursor: pointer; transition: transform .15s, opacity .15s, filter .15s; }
.conn-hero-logos .logo-tile.off { filter: grayscale(.5); opacity: .6; box-shadow: none; }
.conn-hero-logos .logo-tile:hover { transform: translateY(-2px) scale(1.06); opacity: 1; filter: none; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.conn-card { display: flex; flex-direction: column; gap: 12px; }
.conn-card.is-active { border-color: rgba(16, 185, 129, .35); box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .12); }
.conn-card .conn-head { display: flex; align-items: flex-start; gap: 12px; }
.conn-card .conn-head .pill { flex-shrink: 0; }
.conn-card h3 { font-size: 15px; }
.conn-card .conn-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.conn-flows { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.conn-flow { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.conn-flow h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-bottom: 8px; font-family: 'Inter'; }
.conn-flow ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.conn-flow li { margin: 3px 0; }
.conn-status { border-radius: 14px; padding: 12px 16px; font-size: 13px; display: flex; gap: 12px; align-items: flex-start; border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); background: color-mix(in srgb, var(--c) 9%, transparent); }
.conn-status .ic { color: var(--c); flex-shrink: 0; margin-top: 2px; }
.conn-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.conn-step { display: flex; gap: 12px; align-items: flex-start; }
.conn-step .n { width: 32px; height: 32px; border-radius: 10px; background: var(--grad); color: white; display: grid; place-items: center; font-weight: 700; font-family: 'Space Grotesk'; flex-shrink: 0; }
@media (max-width: 1100px) {
    .conn-hero { grid-template-columns: 1fr; }
    .conn-hero-logos { justify-content: flex-start; max-width: none; }
    .conn-flows, .conn-steps { grid-template-columns: 1fr; }
}

/* ── Chat: avviso in barra e chat rapida ──────────── */
.chat-alert { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 999px; max-width: 320px; }
.chat-alert-icon { position: relative; display: grid; place-items: center; width: 28px; height: 28px; }
.chat-alert-icon .ping { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 3px var(--bg); }
.chat-alert.on { background: var(--grad-soft); border-color: rgba(236, 72, 153, .35); padding-right: 6px; animation: chat-alert-in .3s ease; }
.chat-alert-text { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.chat-alert-verb { color: var(--text-2); font-weight: 500; }
@keyframes chat-alert-in { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 900px) { .chat-alert-text { display: none; } }

.qc-fab {
    position: fixed; right: 20px; bottom: 20px; z-index: 45; width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--grad); color: white; display: grid; place-items: center; box-shadow: 0 12px 34px -8px rgba(236, 72, 153, .8);
    transition: transform .15s, filter .15s;
}
.qc-fab:hover { transform: scale(1.07); filter: brightness(1.08); }
.qc-fab.open { background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.qc-fab.has-unread { animation: qc-bounce 2.4s ease-in-out infinite; }
@keyframes qc-bounce { 0%, 100% { transform: none; } 6% { transform: translateY(-6px) scale(1.04); } 12% { transform: none; } }
.qc-badge {
    position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
    background: var(--danger); color: white; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg);
}
.qc-panel {
    position: fixed; right: 20px; bottom: 86px; z-index: 45; width: 390px; max-width: calc(100vw - 40px); height: 580px; max-height: calc(100vh - 110px);
    display: flex; flex-direction: column; background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 20px;
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .6); overflow: hidden; animation: pop .18s ease;
}
.qc-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--border); }
.qc-head h3 { font-size: 15px; }
.qc-head-icon { width: 34px; height: 34px; border-radius: 11px; background: var(--grad); color: white; display: grid; place-items: center; }
.qc-search { padding: 10px 12px 4px; }
.qc-list { flex: 1; overflow-y: auto; padding: 6px 8px 10px; }
.qc-list .conv { padding: 8px; gap: 10px; }
.qc-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 10px 4px; }
.qc-messages { flex: 1; overflow-y: auto; padding: 12px 14px 6px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
.qc-messages .bubble { font-size: 13.5px; }
.qc-messages .chat-empty { padding: 20px; }
.qc-messages .msg-row:not(.mine) .msg-tools { left: 36px; }
.qc-messages .msg-row.mine .msg-tools { right: 6px; }
.qc-messages .msg-tools button { width: 27px; height: 27px; font-size: 15px; }
.qc-composer .composer-context { margin-bottom: 6px; }
.qc-composer { padding: 6px 12px 12px; }
.qc-composer .composer-box textarea { font-size: 13.5px; }
.qc-composer .send { width: 34px; height: 34px; }
@media (max-width: 760px) {
    .qc-panel { right: 10px; left: 10px; bottom: 82px; width: auto; max-width: none; height: auto; top: 70px; max-height: none; }
    .qc-fab { right: 14px; bottom: 14px; }
    .toast-stack { bottom: 84px; }
}

/* ── La situazione in sintesi (dashboard di direzione) ───── */
.situation { border-top: 3px solid var(--c); }
.sit-top { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 18px; }
.sit-score {
    width: 88px; height: 88px; border-radius: 50%; flex-shrink: 0; position: relative; display: grid; place-items: center; align-content: center;
    background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0);
}
.sit-score::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface-solid); }
.sit-score > * { position: relative; }
.sit-score-n { font-family: 'Space Grotesk'; font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.sit-verdict { font-family: 'Space Grotesk'; font-size: 20px; font-weight: 700; margin-bottom: 4px; color: var(--c); }
.sit-summary { margin: 0 0 10px; line-height: 1.55; max-width: 960px; font-size: 13.5px; }
.sit-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); align-items: center; }
.sit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.sit-col { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sit-col.good { border-color: rgba(16, 185, 129, .35); background: rgba(16, 185, 129, .05); }
.sit-col-head { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.sit-col-icon { font-size: 18px; line-height: 1; }
.sit-col-title { font-weight: 700; font-size: 13px; }
.sit-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.sit-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px 9px; border-radius: 10px; background: color-mix(in srgb, var(--c) 9%, transparent); border-left: 3px solid var(--c); }
.sit-item-icon { font-size: 15px; line-height: 1.35; flex-shrink: 0; }
.sit-item-title { font-weight: 600; font-size: 12.5px; line-height: 1.35; }
.sit-item-detail { font-size: 11.5px; color: var(--text-2); line-height: 1.45; margin-top: 2px; }
.sit-item-link { display: inline-block; font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.sit-empty { font-size: 12px; color: var(--muted); padding: 10px 4px; }
@media (max-width: 1200px) { .sit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .sit-grid { grid-template-columns: minmax(0, 1fr); } .sit-top { flex-direction: column; } }

/* ── Piano d'azione (overlay della sintesi) ───────── */
.modal.xl { width: min(1180px, 100%); }
.plan { display: flex; flex-direction: column; gap: 16px; }
.plan-top { display: flex; gap: 20px; align-items: flex-start; }
.plan-intro { margin: 0 0 8px; line-height: 1.55; font-size: 13.5px; color: var(--text-2); }
.plan-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); align-items: center; }
.plan-owner { padding: 2px 9px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-weight: 600; }
.plan-section { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: var(--surface); }
.plan-section.good { border-color: rgba(16, 185, 129, .35); background: rgba(16, 185, 129, .05); }
.plan-section-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.plan-section-title { font-family: 'Space Grotesk'; font-weight: 700; font-size: 15px; }
.plan-actions { display: grid; gap: 10px; }
.plan-action { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid #f59e0b; }
.plan-action.urgent { border-left-color: #f43f5e; background: rgba(244, 63, 94, .06); }
.plan-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: 'Space Grotesk'; font-weight: 700; font-size: 13px; background: var(--surface-solid); border: 1px solid var(--border-strong); flex-shrink: 0; }
.plan-action-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-action-icon { font-size: 16px; line-height: 1; }
.plan-action-title { font-weight: 700; font-size: 14px; }
.plan-impact { margin-left: auto; font-weight: 700; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.plan-why { font-size: 12.5px; color: var(--text-2); line-height: 1.5; margin-top: 4px; }
.plan-steps { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.5; display: grid; gap: 2px; }
.plan-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.plan-facts a { font-weight: 600; }
.plan-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-pill { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(16, 185, 129, .1); border: 1px solid rgba(16, 185, 129, .35); color: inherit; }
.plan-pill:hover { background: rgba(16, 185, 129, .2); }
.plan-empty { font-size: 12.5px; color: var(--muted); padding: 6px 2px; }
@media (max-width: 700px) { .plan-top { flex-direction: column; } .plan-action { padding: 10px; gap: 8px; } .plan-impact { margin-left: 0; } }

/* ── Performance del team ─────────────────────────── */
.perf-ring { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.perf-ring-text { position: absolute; top: 48px; transform: translateY(-50%); display: flex; flex-direction: column; line-height: 1.1; pointer-events: none; }
.perf-ring-text b { font-family: 'Space Grotesk'; font-size: 18px; }
.perf-ring-text span { font-size: 10.5px; color: var(--muted); }
.hbar-row:hover rect[fill="transparent"] { fill: var(--surface-hover); }
.perf-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.perf-bar { width: 90px; flex-shrink: 0; }
.perf-table td, .perf-table th { white-space: nowrap; }
@media (max-width: 1200px) { .perf-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .perf-bar { display: none; } }

/* ══════════════════════════════════════════════════════════
   Mobile e PWA (iPhone/Android, anche installato dalla schermata Home)
   Sotto i 760px: menu laterale a scorrimento, barra di navigazione in basso, barra superiore compatta,
   finestre che salgono dal basso, aree sicure (notch e barra Home) via env(safe-area-inset-*).
   ══════════════════════════════════════════════════════════ */
html.nav-locked, html.nav-locked body { overflow: hidden; }
button, .btn, .nav-link, .tab, .bnav-link, .conv, .card.hover { touch-action: manipulation; }
@media (min-width: 761px) { .only-mobile, .nav-backdrop, .bottom-nav { display: none !important; } }
.login-brand-mobile { display: none; align-items: center; gap: 10px; }
@media (max-width: 900px) { .login-brand-mobile { display: flex; } }
@keyframes sheet { from { opacity: 0; transform: translateY(40px); } }

/* Barra in basso (solo mobile) */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; display: flex; align-items: stretch; gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(18px) saturate(1.4); border-top: 1px solid var(--border);
}
.bnav-link {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 4px; border-radius: 12px;
    border: 0; background: none; color: var(--muted); font: 600 10.5px 'Inter', sans-serif; position: relative; cursor: pointer;
}
.bnav-link .ic { width: 22px; height: 22px; }
.bnav-link > span:not(.nav-badge) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bnav-link.active { color: var(--text); }
.bnav-link.active .ic { color: var(--accent-2); }
.bnav-link:active { background: var(--surface-hover); }
.bnav-link .nav-badge { position: absolute; top: 0; left: calc(50% + 4px); margin: 0; min-width: 18px; height: 18px; font-size: 10px; }

@media (max-width: 760px) {
    .only-desktop { display: none !important; }

    /* Menu laterale: pannello a scorrimento da sinistra */
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; height: 100dvh; width: min(320px, 86vw); z-index: 130;
        transform: translateX(-104%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
        background: var(--surface-solid); border-right: 1px solid var(--border-strong);
        padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
    }
    .shell.nav-open .sidebar { transform: none; box-shadow: 0 0 80px rgba(0, 0, 0, .55); }
    .nav-backdrop { position: fixed; inset: 0; z-index: 120; background: rgba(5, 5, 10, .55); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .25s; }
    .shell.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
    .brand-row { display: flex; align-items: center; justify-content: space-between; }
    .brand-row .brand { padding-bottom: 12px; }
    .drawer-search { margin-bottom: 8px; }
    .drawer-search .search { width: 100%; }
    .drawer-search .kbd { display: none; }
    .drawer-tools { display: flex; gap: 8px; margin-top: 10px; }
    .drawer-tools .btn, .drawer-tools form { flex: 1; }
    .drawer-tools form .btn { width: 100%; }
    .shell.collapsed .nav-text, .shell.collapsed .nav-label, .shell.collapsed .brand-text, .shell.collapsed .me-text { display: block; }
    .shell.collapsed .nav-badge { display: grid; }
    .shell.collapsed .nav-link { justify-content: flex-start; }
    .nav-link { padding: 11px 12px; font-size: 15px; }

    /* Barra superiore compatta con il marchio */
    .topbar { padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); gap: 6px; }
    .topbar-search { display: none; }
    .brand-mini { display: flex; align-items: center; gap: 8px; font-family: 'Space Grotesk'; font-weight: 700; font-size: 17px; letter-spacing: -.02em; flex: 1 1 auto; min-width: 30px; overflow: hidden; }
    .brand-mini > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .brand-mini .brand-logo { width: 32px; height: 32px; }
    .topbar-actions { gap: 2px; margin-left: 0; flex-shrink: 0; }
    .online-users, .tt-idle, .timer-pill .tt-sub { display: none; }
    .timer-pill { padding: 3px 3px 3px 9px; gap: 5px; }
    .timer-pill .num { font-size: 13px !important; }
    .timer-pill .btn-icon.btn-sm { width: 26px; height: 26px; padding: 4px; }
    .chat-alert .unread-badge { display: none; } /* su mobile basta il pallino: il numero è nella barra in basso */
    .chat-alert.on { padding-right: 4px; }
    .chat-alert { padding: 4px; }

    /* Contenuto */
    .content { padding: 16px 14px calc(88px + env(safe-area-inset-bottom)); }
    h1 { font-size: 23px; }
    h2 { font-size: 18px; }
    .page-header { margin-bottom: 18px; gap: 12px; }
    .grid { gap: 14px; }
    .card { padding: 16px; border-radius: 16px; }
    .card.flush .card-header { padding: 14px 16px 0; }
    .kpi-value { font-size: 24px; }
    .input, .select, .textarea, .search input, .composer-box textarea { font-size: 16px; } /* sotto i 16px iOS ingrandisce la pagina sul campo */
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .search[style*="width"] { width: 100% !important; }
    .table th, .table td { padding: 10px; }
    .tabs { margin: 0 -14px 16px; padding: 0 14px; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .kanban { grid-auto-columns: minmax(84vw, 1fr); scroll-snap-type: x mandatory; margin: 0 -14px; padding: 0 14px 8px; scrollbar-width: none; }
    .kanban-col { scroll-snap-align: center; }
    .gantt-label-col { width: 150px; min-width: 150px; }
    .empty-state.big { padding: 60px 16px; }

    /* Tendine e finestre: a tutta larghezza; le finestre salgono dal basso come un foglio */
    .topbar .dropdown { position: fixed; left: 10px; right: 10px; top: calc(58px + env(safe-area-inset-top)); width: auto; max-height: 70dvh; }
    .modal-backdrop { padding: 0; place-items: end center; }
    .modal { width: 100%; max-width: none; max-height: 92dvh; border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet .25s cubic-bezier(.2, .8, .2, 1); }
    .modal.wide { width: 100%; }
    .modal-head { padding: 18px 18px 0; }
    .modal-body { padding: 16px 18px; }
    .modal-foot { padding: 0 18px 18px; flex-wrap: wrap; }
    .modal-foot .btn { flex: 1 1 auto; }
    .toast-stack { left: 12px; right: 12px; width: auto; bottom: calc(80px + env(safe-area-inset-bottom)); }
    .qc-fab { right: 14px; bottom: calc(80px + env(safe-area-inset-bottom)); }
    .qc-panel { left: 10px; right: 10px; top: calc(60px + env(safe-area-inset-top)); bottom: calc(76px + env(safe-area-inset-bottom)); }

    /* Chat */
    .chat-shell { margin: -16px -14px 0; height: calc(100dvh - 124px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 360px; border-radius: 0; border-left: 0; border-right: 0; border-top: 0; backdrop-filter: none; }
    .chat-list-head { padding: 12px 14px; }
    .chat-list-items { padding: 6px 8px; }
    .chat-head { padding: 10px 12px; }
    .chat-messages { padding: 12px 12px 6px; }
    .msg-col { max-width: 86%; }
    .chat-composer { padding: 8px 10px 10px; }
    .typing { padding: 0 12px 4px; }

    /* Timesheet */
    .ts-hero { padding: 18px; border-radius: 18px; }
    .ts-clock { font-size: 44px; }
    .play-btn { width: 64px; height: 64px; }
    .week-strip { gap: 5px; }
    .day-card { padding: 8px 4px; min-height: 84px; border-radius: 12px; align-items: center; text-align: center; gap: 4px; }
    .day-name { font-size: 9.5px; letter-spacing: .04em; }
    .day-hours { font-size: 17px; }
    .day-stack { width: 100%; }

    /* Calendario: nelle celle restano le icone colorate, il testo è nel pannello delle scadenze */
    .cal-month { font-size: 16px; min-width: 0; }
    .cal-wd { padding: 8px 2px 6px; font-size: 9.5px; letter-spacing: .04em; }
    .cal-day { min-height: 56px; padding: 4px 3px; gap: 3px; }
    .cal-num { width: 22px; height: 22px; font-size: 11px; }
    .cal-item { padding: 3px; border-left: 0; justify-content: center; border-radius: 5px; }
    .cal-item .ellipsis { display: none; }
    .cal-more { font-size: 9.5px; padding: 0; text-align: center; }

    /* Monitoraggio, rewards, About */
    .funnel-row { grid-template-columns: 84px 1fr 42px; gap: 8px; }
    .gauge-row { grid-template-columns: 84px 1fr 64px; }
    .podium { gap: 6px; }
    .podium-block { font-size: 20px; }
    .doc-layout { gap: 14px; }
    .doc-toc { flex-direction: row; overflow-x: auto; gap: 6px; margin: 0 -14px; padding: 0 14px 8px; scrollbar-width: none; }
    .doc-toc::-webkit-scrollbar { display: none; }
    .doc-toc a { white-space: nowrap; border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; background: var(--surface); }
    .doc-toc .sub { padding-left: 12px; }
    .shot-grid { grid-template-columns: minmax(0, 1fr); }

    /* Login */
    .login-form-wrap { padding: calc(28px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); }
}

/* Pannello laterale + contenuto (Archivio, file di commessa): su schermi stretti il pannello va sopra, compatto */
.side-layout { grid-template-columns: 260px minmax(0, 1fr); }
.side-layout.narrow { grid-template-columns: 220px minmax(0, 1fr); }
@media (max-width: 900px) {
    .side-layout, .side-layout.narrow { grid-template-columns: minmax(0, 1fr); }
    .side-layout > .card:first-child { max-height: 240px; overflow-y: auto; }
}

/* Mobile: adattamenti delle singole pagine */
@media (max-width: 760px) {
    /* KPI a due colonne invece che impilati */
    .g4:has(> .card > .kpi), .g5:has(> .card > .kpi) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .g4:has(> .card > .kpi) > .card, .g5:has(> .card > .kpi) > .card { padding: 14px; border-radius: 14px; }
    .g4:has(> .card > .kpi) .kpi-value, .g5:has(> .card > .kpi) .kpi-value { font-size: 22px; }
    .g4:has(> .card > .kpi) .kpi-value.sm, .g5:has(> .card > .kpi) .kpi-value.sm { font-size: 19px; }
    .g4:has(> .card > .kpi) .kpi-label, .g5:has(> .card > .kpi) .kpi-label { font-size: 11.5px; }
    .g4:has(> .card > .kpi) .kpi-icon, .g5:has(> .card > .kpi) .kpi-icon { width: 30px; height: 30px; border-radius: 9px; }
    .g4:has(> .card > .kpi) .kpi-foot, .g5:has(> .card > .kpi) .kpi-foot { font-size: 11px; flex-wrap: wrap; }

    /* Intestazione pagina: i pulsanti occupano la larghezza, i gruppi di filtri vanno a capo */
    .page-header { align-items: flex-start; }
    .page-header > div:first-child { width: 100%; }
    .page-header .actions { width: 100%; }
    .page-header .actions > .btn { flex: 1 1 auto; }
    .page-header .actions > .btn-group { flex: 1 1 100%; }
    .btn-group { flex-wrap: wrap; max-width: 100%; }
    .btn-group button { flex: 1 1 auto; }
    .content > .spread, .card > .spread, .card-header { flex-wrap: wrap; }
    .content > .spread > .btn, .card-header > .btn { flex: 1 1 auto; }
    .row:has(> .search) { flex-wrap: wrap; }
    .row:has(> .search) > .search { flex: 1 1 100%; }
    .check { min-height: 32px; }

    /* Tabelle: scorrono in orizzontale senza allargare la pagina */
    .table-wrap { margin: 0 -16px; padding: 0 16px; -webkit-overflow-scrolling: touch; }
    .card.flush .table-wrap { margin: 0; padding: 0; }

    /* Dettagli commessa/cliente e preventivo */
    .totals { grid-template-columns: 1fr auto; }
    .totals .grand { font-size: 20px; }
    .level-ring { width: 96px; height: 96px; }
    .level-num { font-size: 30px; }
    .quick-chip .h { font-size: 14px; }
    .heat-cell { height: 26px; font-size: 9.5px; }
}

/* ── Chat: pallino online ben evidente ── */
.online-dot.strong { left: 38px; top: 36px; width: 18px; height: 18px; background: #22c55e; border: 2px solid var(--surface-solid); box-shadow: 0 0 8px 1px rgba(34, 197, 94, .75); z-index: 1; }
.online-dot.strong::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid #22c55e; animation: online-ping 1.8s ease-out infinite; }
.online-dot.strong.sm { left: 13px; top: 13px; width: 13px; height: 13px; border-width: 1.5px; }
.online-dot.strong.inline { position: relative; left: auto; top: auto; display: inline-block; width: 10px; height: 10px; border: 0; margin-right: 6px; vertical-align: -1px; }
.online-dot.strong.inline::after { inset: 0; }
.online-label { color: #22c55e; font-weight: 600; }
@keyframes online-ping { 0% { transform: scale(1); opacity: .9; } 80%, 100% { transform: scale(2.1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .online-dot.strong::after { animation: none; display: none; } }

/* ── Monitor piattaforma (Platform admin) ─────────── */
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 14px; margin: 0; font-size: 12.5px; align-items: baseline; }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.bar-list { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 70px; gap: 12px; align-items: center; }
.bar-row .bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .num { text-align: right; }
@media (max-width: 700px) { .bar-row { grid-template-columns: 120px minmax(0, 1fr) 60px; } }

/* ════════════════════════════════════════════════════════════
   Intro dopo il login (/benvenuto): Tessy nello spazio, ~6 s
   ════════════════════════════════════════════════════════════ */
.welcome {
    position: fixed; inset: 0; overflow: hidden; color: #f4f4f8;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px 16px;
    background: radial-gradient(ellipse at 30% 20%, rgba(139, 92, 246, .28), transparent 55%),
                radial-gradient(ellipse at 75% 80%, rgba(236, 72, 153, .20), transparent 55%),
                radial-gradient(ellipse at 90% 10%, rgba(6, 182, 212, .12), transparent 45%), #07061a;
    animation: welcome-out .8s ease-in 5.3s forwards;
}
.welcome-stars, .welcome-stars.far { position: absolute; inset: -50%; pointer-events: none;
    background-image: radial-gradient(1.4px 1.4px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 90px 120px, #fff, transparent),
                      radial-gradient(1.2px 1.2px at 160px 60px, #fde68a, transparent), radial-gradient(1px 1px at 230px 170px, #fff, transparent),
                      radial-gradient(1.6px 1.6px at 300px 20px, #c4b5fd, transparent);
    background-size: 320px 200px; opacity: .8; animation: welcome-drift 40s linear infinite, welcome-twinkle 3s ease-in-out infinite alternate; }
.welcome-stars.far { background-size: 180px 140px; opacity: .45; animation-duration: 70s, 4.5s; transform: scale(.7); }
.welcome-shooting { position: absolute; top: 18%; left: -10%; width: 140px; height: 2px; border-radius: 2px; transform: rotate(-18deg);
    background: linear-gradient(90deg, transparent, #fff); opacity: 0; animation: welcome-shoot 1.1s ease-out 1.6s 1; }
.welcome-scene { width: min(720px, 100%); max-height: 60vh; overflow: visible; position: relative; animation: welcome-in .9s cubic-bezier(.34, 1.56, .64, 1) both; }
.welcome-orbit { fill: none; stroke: rgba(255, 255, 255, .13); stroke-width: .8; stroke-dasharray: 2 4; }
.welcome-orbit.front { stroke: rgba(255, 255, 255, .22); }
.welcome-rock { animation: welcome-float 4s ease-in-out infinite; }
.welcome-tessy { transform-box: fill-box; transform-origin: 50% 100%; animation: welcome-hop .9s cubic-bezier(.3, 0, .4, 1) infinite; }
.welcome-tile { transform-box: fill-box; transform-origin: center; animation: tessy-spin 1.8s linear infinite; }
.welcome-beacon { animation: welcome-blink 1s steps(1) infinite; }
.welcome-text { position: relative; text-align: center; animation: welcome-in .9s ease .3s both; }
.welcome-text h1 { font-family: 'Space Grotesk'; font-size: clamp(26px, 5vw, 40px); letter-spacing: -.02em; margin: 0; }
.welcome-status { position: relative; height: 22px; margin-top: 8px; font-size: 14px; color: #c4c4d4; }
.welcome-status span { position: absolute; left: 0; right: 0; opacity: 0; animation: welcome-line 1.4s ease both; }
.welcome-status span:nth-child(2) { animation-delay: 1.4s; }
.welcome-status span:nth-child(3) { animation-delay: 2.8s; }
.welcome-status span:nth-child(4) { animation-delay: 4.2s; animation-fill-mode: forwards; animation-name: welcome-line-last; }
.welcome-progress { width: min(280px, 70vw); height: 4px; margin: 16px auto 0; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.welcome-progress div { height: 100%; width: 100%; background: var(--grad); transform-origin: left; animation: welcome-bar 5.4s cubic-bezier(.4, 0, .2, 1) both; }
.welcome-skip { position: absolute; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); color: #8a8aa0; font-size: 13px; text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .12); }
.welcome-skip:hover { color: #fff; border-color: rgba(255, 255, 255, .3); }
@keyframes welcome-hop {
    0%, 100% { transform: translateY(0) scale(1.06, .94); }
    15% { transform: translateY(-4px) scale(.96, 1.05); }
    50% { transform: translateY(-26px) scale(1, 1) rotate(-4deg); }
    85% { transform: translateY(-2px) scale(.98, 1.02) rotate(2deg); }
}
@keyframes welcome-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes welcome-blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes welcome-in { from { opacity: 0; transform: scale(.85); } }
@keyframes welcome-line { 0% { opacity: 0; transform: translateY(8px); } 20%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes welcome-line-last { 0% { opacity: 0; transform: translateY(8px); } 20%, 100% { opacity: 1; transform: none; } }
@keyframes welcome-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes welcome-drift { to { transform: translate(160px, 100px); } }
@keyframes welcome-twinkle { to { opacity: .45; } }
@keyframes welcome-shoot { 0% { opacity: 0; transform: translateX(0) rotate(-18deg); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateX(120vw) rotate(-18deg); } }
/* partenza: la scena si allontana a velocità luce prima del cambio pagina */
@keyframes welcome-out { to { opacity: 0; transform: scale(1.35); filter: blur(6px); } }
@media (prefers-reduced-motion: reduce) {
    .welcome, .welcome *, .welcome-stars { animation-duration: .01s !important; animation-iteration-count: 1 !important; }
    .welcome-progress div { animation: welcome-bar 5.4s linear both !important; }
}

/* ── Tour guidato ─────────────────────────────────── */
.tour-backdrop { position: fixed; inset: 0; z-index: 1500; }
.tour-spot {
    position: fixed; z-index: 1501; border-radius: 14px; pointer-events: none;
    box-shadow: 0 0 0 2px var(--accent), 0 0 0 100vmax rgba(5, 5, 10, .62);
    transition: left .28s cubic-bezier(.2, .8, .2, 1), top .28s cubic-bezier(.2, .8, .2, 1), width .28s cubic-bezier(.2, .8, .2, 1), height .28s cubic-bezier(.2, .8, .2, 1);
}
.tour-spot.none { left: 50vw; top: 50vh; width: 0; height: 0; box-shadow: 0 0 0 100vmax rgba(5, 5, 10, .62); }
.tour-card {
    position: fixed; z-index: 1502; width: 380px; max-width: calc(100vw - 24px);
    background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow);
    padding: 16px 18px; animation: pop .18s ease;
}
.tour-card.centered { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.tour-card.sheet { left: 12px; right: 12px; width: auto; max-width: none; top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); }
.tour-card.sheet.top { bottom: auto; top: calc(12px + env(safe-area-inset-top)); }
.tour-head { display: flex; align-items: flex-start; gap: 12px; }
.tour-emoji { width: 40px; height: 40px; border-radius: 12px; background: var(--grad-soft); border: 1px solid rgba(139, 92, 246, .3); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.tour-body { margin-top: 10px; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.tour-body b { color: var(--text); }
.tour-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-weight: 600; font-size: 13px; color: var(--accent-2); }
.tour-go:hover { text-decoration: underline; }
.tour-progress { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 14px; }
.tour-progress > i { display: block; height: 100%; background: var(--grad); transition: width .3s ease; }
.tour-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.tour-foot .hint { margin: 0 auto; white-space: nowrap; }
@media (max-width: 760px) { .tour-foot .hint { display: none; } .tour-foot .btn-primary { margin-left: auto; } }
@media (prefers-reduced-motion: reduce) { .tour-spot { transition: none; } }

/* ── Persone: assenze, note spese, approvazione timesheet, timer rapido ── */
.abs-type { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); white-space: nowrap; }
.abs-types, .exp-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.abs-type-btn { padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: 600 13px Inter; cursor: pointer; }
.abs-type-btn.on { background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-color: var(--c); color: var(--text); }
.abs-holiday { font-size: 10.5px; font-weight: 600; color: var(--text-2); padding: 1px 4px; border-radius: 4px; background: var(--surface-2); }
.abs-item { cursor: default; }
.abs-item.pending { opacity: .55; border-style: dashed; }
.cal-day.abs-day .cal-item { pointer-events: none; }
.tsa-week { padding: 14px 18px; }
.tsa-head { display: flex; align-items: center; gap: 14px; cursor: pointer; flex-wrap: wrap; }
.tsa-projects { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tsa-proj { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2); padding: 2px 8px; border-radius: 8px; background: var(--surface-2); }
.tsa-proj i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }
.tsa-nums { min-width: 150px; text-align: right; display: flex; flex-direction: column; gap: 3px; }
.tsa-big { font-family: 'Space Grotesk'; font-size: 22px; font-weight: 700; margin-right: 4px; }
.tsa-actions { flex-wrap: nowrap; }
.tsa-late { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; }
.dot-c { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 2px; }
.exp-thumb { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); font-size: 20px; text-decoration: none; }
.exp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.exp-thumb.none { opacity: .4; }
.exp-drop { display: grid; place-items: center; min-height: 220px; border-radius: 16px; border: 2px dashed var(--border-strong); background: var(--surface-2); cursor: pointer; overflow: hidden; position: relative; }
.exp-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.exp-drop img { width: 100%; max-height: 360px; object-fit: contain; }
.exp-drop-hint { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-2); text-align: center; padding: 16px; }
.heat-cell.off.wl-holiday, .heat-cell.off.wl-closure { border-style: solid; border-color: transparent; background: repeating-linear-gradient(135deg, transparent 0 3px, var(--surface-2) 3px 5px); color: var(--text-2); }
.heat-cell.off.wl-absence { border-style: solid; background: rgba(16, 185, 129, .18); border-color: rgba(16, 185, 129, .4); color: #10b981; }
.heat-cell.off.wl-sick { border-style: solid; background: rgba(244, 63, 94, .16); border-color: rgba(244, 63, 94, .4); color: #f43f5e; }
.heat-cell.wl-partial { box-shadow: inset 0 0 0 2px rgba(6, 182, 212, .6); }
.day-card.ts-off { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--surface-2) 4px 6px); opacity: .8; }
.day-card .ts-off-label { font-size: 10.5px; font-weight: 600; color: var(--text-2); }
.ts-week-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); font-size: 13px; font-weight: 600; }
.qt-wrap { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.qt-hero { border-radius: 24px; padding: 26px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; border: 1px solid rgba(139, 92, 246, .3); background: radial-gradient(500px 260px at 50% 0%, rgba(139, 92, 246, .35), transparent 65%), var(--surface-solid); }
.qt-hero.running { border-color: rgba(236, 72, 153, .5); background: radial-gradient(500px 260px at 50% 0%, rgba(236, 72, 153, .35), transparent 65%), var(--surface-solid); }
.qt-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.qt-project { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; max-width: 100%; }
.qt-task { font-size: 13px; color: var(--text-2); }
.qt-clock { font-family: 'Space Grotesk'; font-size: 60px; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; margin: 8px 0; }
.qt-hero.running .qt-clock { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.qt-btn { width: 100%; max-width: 320px; min-height: 84px; border-radius: 22px; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 12px; color: white; font: 700 20px 'Space Grotesk'; background: var(--grad); box-shadow: 0 14px 34px -10px rgba(139, 92, 246, .8); transition: transform .12s; }
.qt-btn:active { transform: scale(.97); }
.qt-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.qt-btn.stop { background: linear-gradient(135deg, #f43f5e, #be123c); box-shadow: 0 14px 34px -10px rgba(244, 63, 94, .8); animation: pulse 1.6s infinite; }
.qt-btn .ic { width: 30px; height: 30px; }
.qt-desc { max-width: 380px; text-align: center; }
.qt-section { display: flex; flex-direction: column; gap: 10px; }
.qt-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.qt-recent { display: flex; flex-direction: column; gap: 8px; }
.qt-chip { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; min-height: 64px; }
.qt-chip:active, .qt-chip.on { border-color: var(--c); box-shadow: 0 0 0 1px var(--c); }
.qt-chip .ic { color: var(--c); flex: 0 0 auto; }
.qt-chip-name { display: block; font-weight: 600; font-size: 15px; }
.qt-chip .grow > span { display: block; }
.qt-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; flex: 0 0 auto; }
.qt-select { width: 100%; min-height: 48px; font-size: 15px; }
.qt-tasks { display: flex; flex-wrap: wrap; gap: 6px; }
.qt-task-chip { padding: 9px 14px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: 600 13px Inter; cursor: pointer; }
.qt-task-chip.on { background: var(--grad); color: white; border-color: transparent; }
@media (max-width: 760px) {
    .tsa-nums { min-width: 0; text-align: left; width: 100%; }
    .tsa-actions { width: 100%; }
    .qt-clock { font-size: 52px; }
}

/* ── Fatture passive (Controllo di gestione → tab Fatture passive) ── */
.si-toolbar { flex-wrap: wrap; }
.si-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.si-chip { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 11px; white-space: nowrap; color: var(--c, #8b5cf6); background: color-mix(in srgb, var(--c, #8b5cf6) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c, #8b5cf6) 35%, transparent); }
.si-summary { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.si-alloc-row { display: grid; grid-template-columns: minmax(200px, 1.4fr) 130px minmax(140px, 1fr) auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
@media (max-width: 760px) { .si-alloc-row { grid-template-columns: 1fr 1fr; } .si-alloc-row select { grid-column: 1 / -1; } }

/* ── notifiche e integrazioni (email, push, iCal, webhook) ── */
.ntf-kind-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--grad-soft); font-size: 17px; flex: 0 0 auto; }
.ntf-check { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.ntf-device { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.ntf-device:first-of-type { border-top: 0; }
.ntf-feed { display: flex; gap: 8px; align-items: center; }
.ntf-feed .input { flex: 1; min-width: 0; font-size: 12px; }
.ntf-howto { display: flex; flex-direction: column; gap: 14px; }
.ntf-webhook { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.ntf-channel { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); }
.ntf-events { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ntf-me-link { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 10px; border-radius: 10px; font-size: 12.5px; color: var(--text-2); text-decoration: none; }
.ntf-me-link:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 760px) {
    .ntf-feed { flex-direction: column; align-items: stretch; }
}

/* ── Amministrazione e finanza (incassi, cash flow, chiusura mese, piano di fatturazione) ── */
.fin-warn { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .45); color: var(--text); }
.fin-closed, .fin-closed-banner { background: rgba(139, 92, 246, .12); border-color: rgba(139, 92, 246, .45); color: var(--text); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fin-closed { display: block; }
.fin-row-amber td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.fin-row-red td:first-child { box-shadow: inset 3px 0 0 #f43f5e; }
.fin-late td { background: rgba(244, 63, 94, .05); }
.fin-template { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.fin-template:last-child { border-bottom: 0; }
.fin-template textarea, .fin-history .fin-pre { font-family: inherit; }
.fin-history { padding: 10px 0; border-bottom: 1px solid var(--border); }
.fin-history:last-child { border-bottom: 0; }
.fin-pre { white-space: pre-wrap; font-size: 12px; color: var(--text-2); background: var(--surface-2); padding: 8px 10px; border-radius: 8px; margin: 6px 0 0; max-height: 200px; overflow: auto; }
.fin-chart text { font-size: 11px; fill: var(--muted); }
.fin-chart text.fin-below { fill: #f43f5e; font-weight: 700; }
.fin-weeks tfoot td { border-top: 2px solid var(--border-strong); }
.fin-detail td { background: var(--surface-2); padding: 10px 16px 12px 28px !important; }
.fin-cat { margin-top: 8px; font-size: 12.5px; }
.fin-cat:first-child { margin-top: 0; }
.fin-item { padding: 3px 0 3px 10px; border-left: 2px solid var(--border); }
.fin-check { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); }
.fin-check-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; background: var(--surface-2); color: var(--muted); }
.fin-check.ok .fin-check-dot { background: rgba(16, 185, 129, .18); color: #10b981; }
.fin-check.ko .fin-check-dot { background: rgba(244, 63, 94, .18); color: #f43f5e; }
.fin-check.warn .fin-check-dot { background: rgba(245, 158, 11, .18); color: #f59e0b; }
.fin-hist { padding: 8px 0; border-bottom: 1px solid var(--border); }
.fin-hist:last-child { border-bottom: 0; }
.fin-hist.click { cursor: pointer; }
.fin-plan-progress { margin: 4px 0 8px; display: flex; flex-direction: column; gap: 6px; }
.fin-plan-table input.input.sm, .fin-plan-table select.select.sm { min-width: 0; }
.tag.danger { color: var(--danger); border-color: rgba(244, 63, 94, .4); }
@media (max-width: 760px) {
    .fin-check { padding: 10px 14px; flex-wrap: wrap; }
    .fin-check .btn { margin-left: 38px; }
    .fin-detail td { padding-left: 14px !important; }
}

/* ── Direzione e AI: obiettivi/OKR, invii programmati, anomalie timesheet, proposta dal brief ── */
.tgt-rings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tgt-ring { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 10px 6px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.tgt-ring-svg { position: relative; width: 84px; height: 84px; }
.tgt-ring-center { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Space Grotesk'; font-size: 15px; font-variant-numeric: tabular-nums; }
.tgt-ring-label { font-weight: 700; font-size: 12.5px; margin-top: 4px; }
.tgt-q { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center; width: 100%; margin-top: 6px; font-size: 11px; color: var(--muted); }
.tgt-q .progress { min-width: 40px; }
.tgt-table th.tgt-now, .tgt-table td.tgt-now { background: var(--grad-soft); }
.tgt-cell { min-width: 140px; vertical-align: top; }
.tgt-cell.click:hover { background: var(--surface-hover); cursor: pointer; }
.tgt-none { color: var(--muted); font-size: 12px; font-weight: 600; }
.tgt-light { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex-shrink: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.okr { border-left: 3px solid var(--c); }
.okr-kr { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.okr-history { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.okr-history .row { gap: 10px; }
.sch-off { opacity: .65; }
.ano { border-left: 3px solid var(--c); padding: 12px 16px; }
.ano:hover { border-color: var(--border-strong); border-left-color: var(--c); box-shadow: var(--shadow); cursor: pointer; }
.ano-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.ano-expl { line-height: 1.45; }
.ano-who { flex-shrink: 0; text-align: right; }
.tso-over { box-shadow: inset 0 0 0 2px var(--danger); }
.bp-table td { vertical-align: top; }
.bp-reason { line-height: 1.4; margin-top: 2px; max-width: 420px; }
@media (max-width: 1100px) { .tgt-rings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .tgt-rings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .ano-who { display: none; }
    .tgt-cell { min-width: 120px; }
}

/* ── commerciale: portale cliente, sondaggi NPS, follow-up, rinnovi ── */
.prt { --bg: #f6f5fb; --bg-2: #fff; --surface: #fff; --surface-2: rgba(20, 16, 50, .04); --surface-solid: #fff; --surface-hover: rgba(20, 16, 50, .06); --border: rgba(20, 16, 50, .09); --border-strong: rgba(20, 16, 50, .18); --text: #16142a; --text-2: #3e3b57; --muted: #77738f; --shadow: 0 10px 40px -18px rgba(40, 30, 90, .25); color-scheme: light; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); display: flex; flex-direction: column; position: relative; z-index: 1; }
.prt-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.prt-logo { height: 22px; display: block; }
.prt-tag { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.prt-main { width: 100%; max-width: 860px; margin: 0 auto; padding: 18px 16px 40px; flex: 1; }
.prt-foot { padding: 20px 16px; text-align: center; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); background: #fff; }
.prt-foot a, .prt-pm a, .prt a.small { color: var(--accent); }
.prt-hero { padding: 6px 0 18px; }
.prt-hero h1, .prt-survey h1 { font-family: 'Space Grotesk'; font-size: 30px; letter-spacing: -.03em; margin: 4px 0 8px; }
.prt-hero p { color: var(--text-2); margin: 0 0 14px; font-size: 15px; }
.prt-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.prt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.prt-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; }
.prt-chips a b { background: var(--grad); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; }
.prt-todo { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(139, 92, 246, .12), rgba(236, 72, 153, .10)); border: 1px solid rgba(139, 92, 246, .25); font-size: 14px; }
.prt-section { margin-top: 26px; }
.prt-section h2 { font-family: 'Space Grotesk'; font-size: 20px; letter-spacing: -.02em; margin: 0 0 12px; }
.prt-card { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 12px; }
.prt-card h3 { margin: 2px 0 0; font-size: 17px; letter-spacing: -.01em; }
.prt-empty { text-align: center; color: var(--muted); padding: 34px 18px; }
.prt-empty.small { padding: 18px; }
.prt-empty h2 { color: var(--text); margin: 8px 0 4px; }
.prt-big { font-size: 40px; line-height: 1; }
.prt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.prt-code { font-size: 12px; color: var(--muted); font-weight: 600; }
.prt-project { border-left: 5px solid var(--c, var(--accent)); }
.prt-progress { margin-top: 12px; }
.prt-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 6px; }
.prt-bar span { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .4s; }
.prt-label { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.prt-ms { margin-top: 12px; }
.prt-ms-item { display: flex; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--border); font-size: 14px; }
.prt-ms-item.late { color: #be123c; }
.prt-ms-date { font-weight: 700; min-width: 64px; color: var(--text-2); }
.prt-pm { margin-top: 12px; font-size: 13px; color: var(--text-2); }
.prt-details { margin-top: 6px; }
.prt-details summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; padding: 6px 0; }
.prt-mini { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; flex-wrap: wrap; }
.prt-quote.open { border-color: rgba(245, 158, 11, .5); }
.prt-brief { color: var(--text-2); font-size: 14px; margin: 10px 0 0; }
.prt-lines { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.prt-lines td { padding: 8px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prt-lines tr.ph td { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); padding-top: 14px; border-bottom: 0; }
.prt-lines tr.opt td { color: var(--muted); font-style: italic; }
.prt-totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin-top: 12px; font-size: 14px; color: var(--text-2); }
.prt-totals .grand { font-weight: 700; font-size: 18px; color: var(--text); }
.prt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.prt-signed { margin-top: 12px; font-size: 13px; color: var(--text-2); background: var(--surface-2); padding: 8px 12px; border-radius: 10px; }
.prt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prt-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); }
.prt-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.prt-files { display: grid; gap: 12px; }
.prt-file { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 0; }
.prt-thumb { width: 96px; height: 96px; flex-shrink: 0; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.prt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prt-filename { font-weight: 600; word-break: break-word; }
.prt-ok, .prt-alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; margin: 10px 0; }
.prt-ok { background: rgba(16, 185, 129, .12); border: 1px solid rgba(16, 185, 129, .35); color: #047857; }
.prt-alert { background: rgba(244, 63, 94, .10); border: 1px solid rgba(244, 63, 94, .35); color: #be123c; }
.prt-nps { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; margin: 16px 0 6px; }
.prt-nps button { aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--border); background: #fff; font: 700 16px 'Space Grotesk'; color: var(--text); cursor: pointer; transition: transform .1s, background .15s; }
.prt-nps button:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.prt-nps button.on.d { background: #f43f5e; border-color: #f43f5e; color: #fff; }
.prt-nps button.on.p { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.prt-nps button.on.pr { background: #10b981; border-color: #10b981; color: #fff; }
.prt-stars { display: flex; gap: 4px; }
.prt-stars button { background: none; border: 0; font-size: 32px; line-height: 1; color: #d6d3e6; cursor: pointer; padding: 2px; }
.prt-stars button.on { color: #f59e0b; }
.prt-thanks { text-align: center; padding: 40px 20px; }
.prt-thanks h2 { margin: 10px 0 6px; }
.prt .btn { border-radius: 12px; }
@media (max-width: 760px) {
    .prt-nps { grid-template-columns: repeat(6, 1fr); }
    .prt-nps button { aspect-ratio: auto; padding: 12px 0; }
    .prt-hero h1, .prt-survey h1 { font-size: 24px; }
    .prt-file { flex-direction: column; }
    .prt-thumb { width: 100%; height: 160px; }
}
/* follow-up */
.fup-list { display: flex; flex-direction: column; }
.fup-row { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.fup-row:last-child { border-bottom: 0; }
.fup-when { min-width: 84px; }
.fup-date { font-weight: 700; font-family: 'Space Grotesk'; }
.fup-row.overdue .fup-date { color: var(--danger); }
.fup-row.today .fup-date { color: var(--warning); }
.fup-row.done { opacity: .75; }
.fup-actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
@media (max-width: 760px) { .fup-actions { width: 100%; } }
/* soddisfazione */
.sat-score { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font: 700 16px 'Space Grotesk'; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.sat-score.big { width: 64px; height: 64px; font-size: 24px; }
/* scheda cliente · commerciale */
.ccm-link { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ccm-link.off { opacity: .55; }
.btn.danger { color: var(--danger); }
/* approvazione cliente sui file */
.crv { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; cursor: pointer; border: 1px solid color-mix(in srgb, var(--c, #8a8aa0) 30%, transparent); color: var(--c, var(--text-2)); background: color-mix(in srgb, var(--c, #8a8aa0) 12%, transparent); }
.crv.ask { border-style: dashed; color: var(--muted); background: transparent; }
.crv.ask:hover { color: var(--accent); border-color: var(--accent); }

/* ── Commessa e produzione (modelli, variazioni, contratti, fornitori, retrospettive, checklist) ── */
.prd-tpl { border-top: 3px solid var(--c, var(--accent)); }
.prd-tpl-rows .input.sm, .prd-tpl-rows .select.sm { min-width: 0; }
.prd-preview { display: flex; flex-direction: column; gap: 10px; }
.prd-preview-phase { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.prd-preview-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px dashed var(--border); font-size: 13px; }
.prd-preview-row:first-of-type { border-top: 0; }
.prd-ms { color: var(--accent); font-weight: 600; }
.prd-cmp { display: flex; flex-direction: column; gap: 10px; }
.prd-cmp-track { position: relative; height: 8px; border-radius: 6px; background: var(--border); overflow: hidden; margin-top: 4px; }
.prd-cmp-track > div { height: 100%; border-radius: 6px; transition: width .3s; }
.prd-cmp-track > i { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .6; }
.prd-ck-list { display: flex; flex-direction: column; gap: 4px; }
.prd-ck-item { display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.prd-ck-item:hover { background: var(--grad-soft); }
.prd-ck-item input[type=checkbox] { margin-top: 3px; accent-color: var(--accent); }
.prd-ck-item.done > .grow > span:first-child { text-decoration: line-through; color: var(--muted); }
.prd-ck-item .btn { opacity: 0; }
.prd-ck-item:hover .btn { opacity: 1; }
.prd-ckt.off, .prd-sup.off { opacity: .55; }
.prd-ckt-items { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.prd-ckt-items li { padding: 2px 0; }
.prd-ckt-items li.req { color: var(--text); }
.prd-ckt-items li.req::marker { content: "◆ "; color: var(--accent); }
.prd-stars { display: flex; gap: 2px; }
.prd-stars button { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--border-strong); cursor: pointer; padding: 0 2px; }
.prd-stars button.on { color: #f59e0b; }
.prd-lesson { padding: 8px 10px; border-left: 3px solid var(--accent); background: var(--grad-soft); border-radius: 0 8px 8px 0; }
.prd-retro-detail td { background: var(--surface); }
.prd-sup .card-header h3 { display: flex; align-items: center; gap: 8px; }
.tag.warning { color: #f59e0b; border-color: #f59e0b55; }
.tag.success { color: #10b981; border-color: #10b98155; }
@media (max-width: 760px) {
  .prd-ck-item .btn { opacity: 1; }
  .prd-preview-row { flex-direction: column; gap: 2px; }
  .prd-tpl-rows { min-width: 900px; }
}

/* ── Platform · Job e worker ── */
.pj-wrap { overflow: hidden; }
.pj-table { table-layout: fixed; width: 100%; }
.pj-table td, .pj-table th { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.pj-c-status { width: 120px; } .pj-c-next { width: 17%; } .pj-c-actions { width: 132px; } .pj-c-last { width: 30%; }
.pj-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pj-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.pj-actions .btn { justify-content: center; white-space: nowrap; }
.pj-area td { background: var(--grad-soft); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); padding: 8px 14px; }
.pj-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--c); white-space: nowrap; }
.pj-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.pj-running { color: #06b6d4; font-weight: 600; }
.pj-err { color: #f43f5e; }
.pj-open td { border-bottom: 0; }
.pj-detail td { background: color-mix(in srgb, var(--surface) 60%, transparent); padding: 14px 18px 18px; }
.pj-run { gap: 10px; padding: 4px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.pj-pre { font-size: 11px; line-height: 1.4; max-height: 220px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word; color: var(--text-2); }
@media (max-width: 900px) { .pj-wrap { overflow-x: auto; } .pj-table { table-layout: auto; min-width: 720px; } .pj-desc { display: none; } .pj-detail .grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Osservatorio (competitor) ── */
.obs-card { display: block; color: inherit; text-decoration: none; border-left: 4px solid var(--c); }
.obs-card h3 { font-size: 16px; }
.obs-gaps { display: flex; flex-direction: column; gap: 6px; }
.obs-gap { display: grid; grid-template-columns: 170px 1fr 36px; align-items: center; gap: 10px; font-size: 12px; }
.obs-gap-label { color: var(--text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obs-gap-bar { position: relative; height: 10px; background: var(--border); border-radius: 6px; overflow: hidden; }
.obs-gap-bar i { position: absolute; left: 0; top: 0; height: 100%; border-radius: 6px; opacity: .85; }
.obs-gap-bar i + i { top: 4px; height: 6px; opacity: .9; }
.obs-gap-delta { text-align: right; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.obs-gap-delta.neg { color: #f43f5e; } .obs-gap-delta.pos { color: #10b981; }
.obs-swot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.obs-swot-q { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.obs-swot-q.s { border-color: rgba(16,185,129,.35); } .obs-swot-q.w { border-color: rgba(244,63,94,.35); } .obs-swot-q.o { border-color: rgba(139,92,246,.35); } .obs-swot-q.t { border-color: rgba(245,158,11,.35); }
.obs-swot-t { font-weight: 700; font-size: 12px; margin-bottom: 6px; }
.obs-bullets { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 3px; }
.obs-action { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.obs-action.closed { opacity: .55; }
.obs-kind { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; color: white; white-space: nowrap; }
.obs-kind.fix { background: #f43f5e; } .obs-kind.use { background: #10b981; } .obs-kind.atk { background: #8b5cf6; } .obs-kind.def { background: #f59e0b; } .obs-kind.ai { background: #06b6d4; }
.obs-status { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--c); color: var(--c); background: transparent; font-weight: 800; cursor: pointer; flex: 0 0 auto; }
.obs-signal { display: flex; align-items: flex-start; gap: 10px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--border); }
.obs-signal-impact { min-width: 30px; text-align: center; font-weight: 800; font-size: 12px; border-radius: 8px; padding: 2px 4px; background: var(--border); color: var(--muted); }
.obs-signal-impact.neg { background: rgba(244,63,94,.18); color: #f43f5e; } .obs-signal-impact.pos { background: rgba(16,185,129,.18); color: #10b981; }
.obs-lost { display: flex; gap: 10px; align-items: center; font-size: 12px; color: inherit; text-decoration: none; padding: 4px 8px; border-radius: 8px; }
.obs-lost:hover { background: var(--surface-hover); }
.obs-rank { display: block; color: inherit; text-decoration: none; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); }
.obs-rank:hover { border-color: var(--border-strong); }
.obs-rank-bar { height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; margin: 6px 0 4px; }
.obs-rank-bar i { display: block; height: 100%; border-radius: 4px; }
.obs-map-q { font-size: 11px; font-weight: 700; fill: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.obs-map-ax { font-size: 10px; fill: var(--muted); }
.obs-map-lbl { font-size: 11px; font-weight: 600; fill: var(--text); }
.obs-slider { display: grid; grid-template-columns: minmax(150px, 220px) 1fr 70px; align-items: center; gap: 12px; font-size: 13px; }
.obs-slider-label { font-weight: 600; color: var(--text-2); }
.obs-slider input[type=range] { width: 100%; accent-color: #8b5cf6; }
.obs-slider-val { font-weight: 700; }
.obs-form { padding: 10px; border: 1px dashed var(--border-strong); border-radius: 12px; margin-bottom: 10px; }
.obs-ai { border-color: rgba(6,182,212,.4); }
.pill-ok { color: #10b981; font-weight: 700; white-space: nowrap; }
@media (max-width: 760px) { .obs-swot { grid-template-columns: 1fr; } .obs-gap { grid-template-columns: 120px 1fr 32px; } .obs-slider { grid-template-columns: 1fr 60px; } .obs-slider input[type=range] { grid-column: 1 / -1; } .obs-action { flex-wrap: wrap; } }

/* ── OKR: pannello «Come funziona» ── */
.okr-help { padding: 0; overflow: hidden; }
.okr-help-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; background: transparent; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.okr-help-toggle:hover { background: var(--surface-hover); }
.okr-help-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 16px 16px; border-top: 1px solid var(--border); }
.okr-help-body > p { padding-top: 12px; }
.okr-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.okr-step { position: relative; padding: 12px 12px 12px 44px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.okr-step-n { position: absolute; left: 12px; top: 12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: white; background: var(--grad, linear-gradient(135deg, #8b5cf6, #06b6d4)); }
.okr-help-grid { gap: 10px; }
@media (max-width: 1000px) { .okr-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .okr-steps, .okr-help-grid { grid-template-columns: 1fr; } }

/* ── PERT (preventivo e commessa) ── */
.pert-row td { background: color-mix(in srgb, #8b5cf6 7%, transparent); padding: 8px 14px 12px; }
.pert-panel { border: 1px dashed rgba(139,92,246,.5); border-radius: 12px; padding: 10px 12px; }
.pert-summary { margin-bottom: 12px; }
.pert-table .pert-in { width: 64px; }
.pert-critical td:first-child { border-left: 3px solid #f43f5e; }
.pert-hint { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); line-height: 1.45; }
.pert-node-t { font-size: 11px; font-weight: 700; fill: var(--text); }
.pert-node-s { font-size: 9.5px; fill: var(--muted); }
.btn.tiny.on { background: rgba(139,92,246,.18); color: #8b5cf6; }
@media (max-width: 760px) { .pert-panel .field { min-width: 0; } }

/* ── Situazione cliente (intelligence) ── */
.ci-hero { border-color: rgba(139,92,246,.35); }
.ci-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; }
.ci-part { min-width: 0; }
.ci-bar { height: 6px; border-radius: 4px; background: var(--border); overflow: hidden; margin: 3px 0; }
.ci-bar i { display: block; height: 100%; border-radius: 4px; }
.ci-bar.thin { height: 4px; opacity: .8; }
.ci-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ci-fact { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); border-left-width: 3px; }
.ci-fact.ok { border-left-color: #10b981; } .ci-fact.warn { border-left-color: #f59e0b; } .ci-fact.bad { border-left-color: #f43f5e; } .ci-fact.neutral { border-left-color: var(--border-strong); }
.ci-fact-l { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ci-fact-v { font-family: 'Space Grotesk'; font-size: 18px; font-weight: 700; }
.ci-fact-n { font-size: 11px; color: var(--text-2); }
.ci-item, .ci-action { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.ci-item.sev3 { border-left: 3px solid #f43f5e; } .ci-item.sev2 { border-left: 3px solid #f59e0b; } .ci-item.sev1 { border-left: 3px solid var(--border-strong); } .ci-item.opp { border-left: 3px solid #10b981; }
.ci-icon { font-size: 18px; flex: 0 0 auto; }
.ci-kind { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 10px; }
.ci-kind.difendere { color: #f43f5e; } .ci-kind.crescere { color: #10b981; } .ci-kind.capire { color: #06b6d4; } .ci-kind.AI { color: #8b5cf6; }
.ci-ai { border: 1px solid rgba(6,182,212,.4); border-radius: 12px; padding: 10px 12px; }
.ci-mix { display: grid; grid-template-columns: 190px 1fr 150px; align-items: center; gap: 10px; font-size: 13px; }
.ci-mix-l { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.ci-mix-v { text-align: right; font-size: 12px; }
@media (max-width: 760px) { .ci-facts { grid-template-columns: 1fr; } .ci-mix { grid-template-columns: 1fr; } .ci-mix-v { text-align: left; } }

/* ── Timer rapido: invito a installarlo come app (Dock / schermata Home) ── */
.qt-install { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-color: rgba(139, 92, 246, .35); }
.qt-install-icon { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 13px; overflow: hidden; box-shadow: 0 8px 20px -8px rgba(139, 92, 246, .8); }
.qt-install-icon img { display: block; width: 100%; height: 100%; }
.qt-install-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
@media (max-width: 760px) { .qt-install { flex-wrap: wrap; } .qt-install-actions { flex-direction: row; width: 100%; justify-content: flex-end; } }

/* ── Timesheet: pannello «Come si usa» (stessa grafica del pannello OKR) ── */
.ts-help { margin-bottom: 18px; }
/* ── Timer rapido: pannello «Come si usa» (colonna stretta: passi su due colonne, riquadri in colonna) ── */
.qt-help .okr-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qt-help .okr-help-grid { grid-template-columns: 1fr; }
@media (max-width: 760px) { .qt-help .okr-steps { grid-template-columns: 1fr; } }

/* ── Dashboard: invito all'app desktop Mosaico Timesheet (Mac e Windows) ── */
.desk-promo { position: relative; display: grid; grid-template-columns: 200px 1fr; gap: 26px; align-items: center; padding: 20px 26px; margin-bottom: 18px; border-radius: 18px; background: var(--grad-soft); border: 1px solid rgba(139, 92, 246, .35); overflow: hidden; }
.desk-promo::before { content: ""; position: absolute; width: 320px; height: 320px; right: -90px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(236, 72, 153, .28), transparent 65%); pointer-events: none; }
.desk-promo-shot { margin: 0; }
.desk-promo-shot img { width: 100%; max-height: 230px; object-fit: cover; object-position: top; border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); transform: rotate(-2.5deg); }
.desk-promo-body { position: relative; }
.desk-promo h2 { margin: 4px 0 6px; font-size: 22px; letter-spacing: -.01em; }
.desk-promo p { margin: 0; max-width: 760px; }
.desk-promo-feats { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.desk-promo-feats span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.desk-promo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 1100px) { .desk-promo { grid-template-columns: 150px 1fr; gap: 18px; } }

/* ── Promemoria «Installa Mosaico» in testa alle pagine (InstallBanner.razor) ── */
/* ── Mosaico come app: rifiniture per il telefono e per la finestra installata ── */
html { background: var(--bg); }   /* il fondo oltre la pagina (rimbalzo dello scroll su iOS) resta del colore del tema */
/* Barre e menu si comportano da interfaccia, non da testo: niente selezione né menu «Copia» tenendo premuto */
@media (hover: none) {
    .topbar, .bottom-nav, .sidebar nav, .brand-row, .tabs, .btn, .bnav-link, .nav-link { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
    .bottom-nav a, .sidebar nav a, .brand, .brand-mini { -webkit-user-drag: none; }
}
/* Telefono in orizzontale: barre e contenuto fuori dalla tacca e dagli angoli arrotondati */
@media (max-width: 760px) {
    .topbar { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
    .content { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
    .bottom-nav { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
}
@media (display-mode: standalone) {
    /* Su iPhone la barra di stato dell'app installata ha sempre il testo bianco: con il tema chiaro le si mette dietro una fascia scura */
    [data-theme="light"] body::after {
        content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); z-index: 1000;
        background: #0b0b12; pointer-events: none;
    }
    /* Niente evidenziazione azzurra dei link al tocco e niente trascinamento delle immagini dell'interfaccia */
    a, button { -webkit-tap-highlight-color: transparent; }
    .brand-logo, .install-pop-icon img, .avatar { -webkit-user-drag: none; }
}

/* ── Versione cliccabile, novità e dashboard dei profili (1.043) ─────── */
.brand a { color: inherit; text-decoration: none; }
.brand-ver { display: block; background: none; border: 0; padding: 0; font: inherit; font-size: 11px; color: var(--muted); cursor: pointer; text-align: left; text-decoration: underline dotted; text-underline-offset: 3px; white-space: nowrap; }
.brand-ver:hover, .brand-ver:focus-visible { color: var(--accent-2); outline: none; }

/* Menu «Dashboard dei profili»: sotto la versione, solo per Direzione, Admin e Platform Admin */
.dash-switch { margin: -8px 0 14px; }
.dash-switch-btn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; min-width: 0; }
.dash-switch-btn:hover, .dash-switch-btn[aria-expanded="true"] { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); color: var(--text); }
.dash-switch-btn b { color: var(--text); font-weight: 600; }
.dash-switch-chev { transition: transform .15s ease; font-size: 11px; }
.dash-switch-chev.open { transform: rotate(180deg); }
.dash-switch-menu { margin-top: 6px; padding: 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, .25); animation: novita-in .2s ease-out both; }
.dash-switch-title { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 4px 8px 6px; }
.dash-switch-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--text-2); }
.dash-switch-item:hover { background: var(--surface-hover); color: var(--text); }
.dash-switch-item.active { background: var(--grad-soft); color: var(--text); }
.dash-switch-item .grow { min-width: 0; display: flex; flex-direction: column; }
.dash-switch-name { font-size: 12.5px; font-weight: 600; }
.dash-switch-hint { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Riquadro «Mosaico è stato aggiornato»: si apre da solo dopo ogni pubblicazione, deve farsi notare in entrambi i temi */
.novita { position: relative; padding: 12px 32px 12px 12px; border-radius: 14px; background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%); color: #fff; font-size: 12px; line-height: 1.4; box-shadow: 0 10px 28px rgba(124, 58, 237, .35), inset 0 0 0 1px rgba(255, 255, 255, .18); animation: novita-in .4s ease-out both; }
.novita-side { margin: 0 0 14px; }
.brand-row + .novita-side { margin-top: -8px; }
.novita-float { display: none; position: fixed; left: 92px; bottom: 16px; z-index: 90; width: min(340px, calc(100vw - 32px)); }
.shell.collapsed .novita-side { display: none; }
.shell.collapsed .novita-float { display: block; }
.novita-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; background: rgba(255, 255, 255, .2); padding: 2px 8px; border-radius: 999px; margin-bottom: 6px; }
.novita-dot { width: 7px; height: 7px; border-radius: 50%; background: #fde047; animation: novita-pulse 1.8s ease-out infinite; }
.novita-title { font-weight: 600; font-size: 13px; }
.novita-title b { font-weight: 800; white-space: nowrap; }
.novita-sub { margin-top: 6px; opacity: .9; font-size: 11.5px; }
.novita-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.novita-list li { padding: 5px 8px; background: rgba(255, 255, 255, .14); border-radius: 8px; font-size: 11.5px; }
.novita-list li span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.novita-all { display: inline-block; margin-top: 8px; color: #fff; font-weight: 700; font-size: 11.5px; border-bottom: 1px solid rgba(255, 255, 255, .5); }
.novita-all:hover { border-bottom-color: #fff; }
.novita-close { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: rgba(255, 255, 255, .18); color: #fff; padding: 0; }
.novita-close:hover { background: rgba(255, 255, 255, .32); }
@keyframes novita-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes novita-pulse { 0% { box-shadow: 0 0 0 0 rgba(253, 224, 71, .8); } 70% { box-shadow: 0 0 0 7px rgba(253, 224, 71, 0); } 100% { box-shadow: 0 0 0 0 rgba(253, 224, 71, 0); } }
@media (prefers-reduced-motion: reduce) { .novita, .novita-dot, .dash-switch-menu { animation: none; } }
@media (max-width: 760px) {
    /* telefono: il menu laterale è un cassetto chiuso, il riquadro esce sopra la barra in basso */
    .novita-side, .shell.collapsed .novita-side { display: none; }
    .novita-float, .shell.collapsed .novita-float { display: block; left: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); }
    .dash-switch { margin-top: 0; }
}

/* Dashboard di profilo: avviso «stai guardando un altro profilo» e coda «da fare» */
.dash-sim { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 14px; border-radius: 12px; background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .3); color: var(--text-2); font-size: 13px; }
.dash-sim span { flex: 1 1 260px; }
.dash-sim b { color: var(--text); }
.dash-todo { display: flex; flex-wrap: wrap; gap: 10px; }
.dash-todo-item { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.dash-todo-item:hover { background: var(--surface-hover); color: var(--text); }
.dash-todo-item b { font-family: 'Space Grotesk'; font-size: 20px; color: var(--text); font-variant-numeric: tabular-nums; }
.dash-todo-item.hot { background: color-mix(in srgb, var(--danger) 14%, transparent); }
/* Promemoria di installazione nella pagina di accesso: largo quanto il modulo, pulsanti sotto il testo */
/* Tessy si veste per stagioni e ricorrenze (TessyCalendar): l'oggetto del costume ondeggia e gira al passaggio del mouse */
.tessy-float { transform-box: fill-box; transform-origin: center; animation: tessy-bob 3.2s ease-in-out infinite; }
.brand:hover .tessy-float, .login-art .brand-logo:hover .tessy-float, .tessy-card:hover .tessy-float { animation: tessy-twirl .7s ease-out; }
.welcome-float { transform-box: fill-box; transform-origin: center; animation: tessy-twirl 1.8s linear infinite; }
@keyframes tessy-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-1.5px) rotate(-6deg); } }
@keyframes tessy-twirl { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tessy-float, .welcome-float { animation: none !important; } }
/* Galleria dei costumi nella pagina About */
.tessy-wardrobe { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin: 14px 0 6px; }
.tessy-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 8px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-align: center; }
.tessy-card.today { border-color: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 18%, transparent); }
.tessy-card-art { width: 56px; height: 56px; margin-bottom: 6px; }
.tessy-card b { font-size: 13px; }
.tessy-card span { font-size: 11px; color: var(--muted); }
.tessy-card:hover .tessy { animation: tessy-hop .7s cubic-bezier(.34, 1.56, .64, 1); }

/* Logo MMG Design in fondo al menu laterale: il file è scuro, nel tema scuro si inverte */
.side-brand { display: flex; justify-content: center; margin-top: 12px; padding: 4px 0; opacity: .7; transition: opacity .15s; }
.side-brand:hover { opacity: 1; }
.side-brand img { height: 18px; width: auto; display: block; filter: invert(1); }
[data-theme="light"] .side-brand img { filter: none; }

/* TrendChart: etichette e pallini in HTML sopra l'SVG elastico, così non vengono stirati */
.tchart { position: relative; width: 100%; }
.tchart > svg.chart { position: absolute; inset: 0; width: 100%; height: 100%; }
.tchart .tc-y, .tchart .tc-x, .tchart .tc-mark { position: absolute; font-size: 11px; line-height: 1; color: var(--muted); white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.tchart .tc-y { transform: translate(calc(-100% - 8px), -50%); }
.tchart .tc-x { transform: translate(-50%, 9px); }
.tchart .tc-mark { transform: translate(4px, 0); color: var(--accent-2); font-weight: 700; }
.tchart .tc-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; border: 2px solid; background: var(--bg); transform: translate(-50%, -50%); box-sizing: border-box; }

/* Orologio dei timer (LiveClock): finché lo script non scrive i secondi si vede il valore calcolato dal server */
.live-clock:empty::before { content: attr(data-clock-initial); }

/* ── Chat: anteprima del messaggio nell'avviso in barra (ChatAlert) ──────────── */
.chat-alert { max-width: 380px; }
.chat-alert-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.2; text-align: left; animation: chat-alert-in .3s ease; }
.chat-alert-who { display: flex; align-items: baseline; gap: 5px; max-width: 100%; min-width: 0; white-space: nowrap; }
.chat-alert-who b { overflow: hidden; text-overflow: ellipsis; }
.chat-alert-who .chat-alert-verb { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.chat-alert-more { flex-shrink: 0; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: rgba(236, 72, 153, .18); color: var(--accent-2); }
.chat-alert-prev { max-width: 100%; font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .chat-alert-text { display: none; } }

/* ── Nuova idea: il callout di Tessy accanto alla voce Idee (IdeaCallout) ──────────── */
.idea-callout {
    position: fixed; z-index: 120; top: 76px; right: 20px; width: 360px; max-width: calc(100vw - 24px);
    display: flex; gap: 14px; padding: 16px 18px 18px 14px; border-radius: 20px; overflow: visible;
    background: linear-gradient(135deg, rgba(139, 92, 246, .16), rgba(236, 72, 153, .08) 60%, rgba(249, 115, 22, .08)), var(--surface-solid);
    border: 1px solid rgba(236, 72, 153, .35);
    box-shadow: 0 24px 60px -18px rgba(139, 92, 246, .55), 0 0 0 1px rgba(139, 92, 246, .08);
    animation: idea-co-in .55s cubic-bezier(.2, 1.3, .4, 1) both;
}
.idea-callout::before { /* bordo sfumato */
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
    background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .8;
}
.idea-callout::after { /* freccia verso la voce di menu */
    content: ""; position: absolute; width: 14px; height: 14px; background: var(--surface-solid); transform: rotate(45deg); display: none;
    border: 1.5px solid #a855f7;
}
.idea-callout.at-side { right: auto; transform-origin: left center; }
.idea-callout.at-side::after { display: block; left: -8px; top: calc(var(--arrow, 46px) - 7px); border-right: 0; border-top: 0; }
.idea-callout.at-bottom { right: auto; transform-origin: bottom center; }
.idea-callout.at-bottom::after { display: block; bottom: -8px; left: calc(var(--arrow, 50%) - 7px); border-left: 0; border-top: 0; }
@keyframes idea-co-in { from { opacity: 0; transform: translateX(-18px) scale(.85); } to { opacity: 1; transform: none; } }

.idea-co-tessy { position: relative; flex: 0 0 74px; height: 84px; align-self: center; }
.idea-co-mark { position: absolute; left: 3px; bottom: 0; width: 68px; height: 68px; transform-origin: 50% 100%; animation: idea-co-hop 1.4s cubic-bezier(.3, 0, .4, 1) infinite; }
.idea-co-mark .tessy-tile { animation: tessy-spin 1.4s ease-in-out infinite; }
.idea-co-bulb { position: absolute; left: 50%; top: -14px; font-size: 24px; transform: translateX(-50%); animation: idea-co-bulb 1.4s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(250, 204, 21, .85)); z-index: 1; }
.idea-co-glow { position: absolute; left: 50%; top: -4px; width: 46px; height: 46px; border-radius: 50%; transform: translateX(-50%); background: radial-gradient(circle, rgba(250, 204, 21, .45), transparent 70%); animation: idea-co-glow 1.4s ease-in-out infinite; }
.idea-co-spark { position: absolute; left: 50%; top: 4px; width: 6px; height: 6px; border-radius: 2px; opacity: 0; animation: idea-co-spark 1.6s ease-out infinite; }
.idea-co-spark.s0 { --dx: -30px; --dy: -18px; background: #8b5cf6; animation-delay: .05s; }
.idea-co-spark.s1 { --dx: 28px;  --dy: -22px; background: #ec4899; animation-delay: .25s; }
.idea-co-spark.s2 { --dx: -36px; --dy: 8px;   background: #f97316; animation-delay: .45s; border-radius: 50%; }
.idea-co-spark.s3 { --dx: 34px;  --dy: 6px;   background: #facc15; animation-delay: .65s; }
.idea-co-spark.s4 { --dx: -14px; --dy: -34px; background: #06b6d4; animation-delay: .85s; border-radius: 50%; }
.idea-co-spark.s5 { --dx: 16px;  --dy: -36px; background: #8b5cf6; animation-delay: 1.05s; }
.idea-co-spark.s6 { --dx: -26px; --dy: -30px; background: #facc15; animation-delay: 1.25s; border-radius: 50%; }
.idea-co-spark.s7 { --dx: 30px;  --dy: -6px;  background: #ec4899; animation-delay: 1.45s; }
@keyframes idea-co-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 12% { transform: translateY(0) scale(1.08, .9); } 40% { transform: translateY(-10px) rotate(-7deg) scale(.96, 1.05); } 62% { transform: translateY(0) rotate(4deg); } 74% { transform: scale(1.05, .94); } }
@keyframes idea-co-bulb { 0%, 100% { transform: translateX(-50%) translateY(0) rotate(-8deg) scale(1); } 40% { transform: translateX(-50%) translateY(-9px) rotate(10deg) scale(1.15); } 62% { transform: translateX(-50%) translateY(0) rotate(-4deg); } }
@keyframes idea-co-glow { 0%, 100% { opacity: .5; transform: translateX(-50%) scale(.85); } 40% { opacity: 1; transform: translateX(-50%) translateY(-9px) scale(1.25); } }
@keyframes idea-co-spark { 0% { opacity: 0; transform: translate(-50%, 0) scale(.4) rotate(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), var(--dy)) scale(1) rotate(160deg); } }

.idea-co-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.idea-co-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 18px; }
.idea-co-text { font-size: 14px; color: var(--text); line-height: 1.3; }
.idea-co-text b { font-weight: 700; }
.idea-co-idea { display: flex; align-items: center; gap: 6px; margin-top: 2px; padding: 6px 9px; border-radius: 10px; background: var(--grad-soft); min-width: 0; }
.idea-co-code { flex-shrink: 0; font-size: 10.5px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.idea-co-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idea-co-client { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idea-co-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.idea-co-close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; }
.idea-co-close:hover { background: var(--surface-2); color: var(--text); }
.idea-co-timer { position: absolute; left: 18px; right: 18px; bottom: 7px; height: 3px; border-radius: 3px; background: var(--grad); transform-origin: left; animation: idea-co-timer 14s linear forwards; opacity: .55; }
.idea-callout:hover .idea-co-timer, .idea-callout:focus-within .idea-co-timer { animation-play-state: paused; }
@keyframes idea-co-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
    .idea-callout, .idea-co-mark, .idea-co-mark .tessy-tile, .idea-co-bulb, .idea-co-glow { animation: none !important; }
    .idea-co-spark { display: none; }
}
@media (max-width: 900px) { .idea-callout { width: 320px; } .idea-callout.at-bottom { transform-origin: bottom center; } }

/* Utenti e ruoli: persone da attivare e password provvisorie in blocco */
.act-callout { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; border-left: 4px solid #f59e0b; flex-wrap: wrap; }
.act-callout__icon { font-size: 26px; }
.act-badge { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, #f59e0b 18%, transparent); color: #d97706; }
.act-list { max-height: 52vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.act-row { display: flex; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; }
.act-row + .act-row { border-top: 1px solid var(--border); }
.act-row:hover { background: var(--surface-hover); }
.act-row input { width: 18px; height: 18px; accent-color: var(--accent-2); }
.act-warn { padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 13px; background: color-mix(in srgb, #f59e0b 14%, transparent); }
.act-pwd { font-size: 15px; letter-spacing: .05em; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); }
.act-badge--attesa { background: color-mix(in srgb, #0ea5e9 16%, transparent); color: #0284c7; }

/* Riconnessione: la finestra compare solo se il ricollegamento dura più di un secondo (tornando dallo sfondo di solito basta meno) */
.reconnect.components-reconnect-show { animation: rc-appear 0s linear 1.2s both; }
@keyframes rc-appear { from { visibility: hidden; } to { visibility: visible; } }

/* Gruppi del menu laterale richiudibili (accordion): un gruppo chiuso mostra solo la voce della pagina aperta; con il menu compresso a icone restano aperti */
button.nav-label {
    display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit;
    text-align: left; border-radius: 6px; padding-top: 4px; transition: color .15s ease;
}
button.nav-label:hover { color: var(--text); }
button.nav-label:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.nav-chev { margin-left: auto; width: 13px; height: 13px; opacity: .7; transition: transform .2s ease; }
.nav-group.closed .nav-chev { transform: rotate(-90deg); }
.nav-label-dot { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); }
.nav-group.closed .nav-link:not(.active) { display: none; }
.nav-group.closed:has(.nav-link:not(.active) .nav-badge) .nav-label-dot { display: inline-block; }
.nav-group:not(.closed) > .nav-link { animation: nav-open .18s ease-out; }
@keyframes nav-open { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (min-width: 761px) { .shell.collapsed .nav-group.closed .nav-link:not(.active) { display: flex; } }
@media (prefers-reduced-motion: reduce) { .nav-group > .nav-link { animation: none; } .nav-chev { transition: none; } }

/* Velo sul contenuto mentre una pagina aperta dal menu carica (PageVeil): niente pagina vuota che poi si riempie.
   Il contenuto sotto resta nascosto; la rotellina compare solo se l'attesa supera un terzo di secondo. */
main.content { position: relative; }
.page-veil { display: none; }
.page-veil.on { display: block; position: absolute; inset: 0; min-height: 60vh; z-index: 5; pointer-events: none; }
main.content:has(> .page-veil.on) > :not(.page-veil) { visibility: hidden; }
.page-veil-spin { position: absolute; left: 50%; top: 140px; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%;
    border: 3px solid var(--border-strong); border-top-color: var(--accent-2); opacity: 0; animation: spin .8s linear infinite, veil-in .2s ease .35s forwards; }
@keyframes veil-in { to { opacity: 1; } }

/* Riconnessione senza allarmi: niente conteggio dei tentativi (si riprova senza limite), finestra solo dopo 2 secondi,
   e mai «Connessione persa» o «Sessione scaduta»: in quei casi app.js ricarica subito la pagina da solo */
.reconnect .components-reconnect-current-attempt, .reconnect .rc-show.small { display: none !important; }
.reconnect.components-reconnect-show { animation: rc-appear 0s linear 2s both; }
.reconnect.components-reconnect-failed, .reconnect.components-reconnect-rejected { display: none !important; }

/* ── Meteo della sede (barra in alto) ─────────────── */
.hq-weather-trigger { display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 999px; font-weight: 600; }
.hq-weather-icon { font-size: 18px; line-height: 1; }
.hq-weather-temp { font-variant-numeric: tabular-nums; }
.hq-weather-city { font-weight: 500; color: var(--text-2); font-size: 13px; }
.hq-weather-dropdown { width: 384px; max-height: 560px; }
.hq-weather-head { display: flex; align-items: center; gap: 14px; padding: 16px 12px 12px 16px; background: var(--grad-soft); border-bottom: 1px solid var(--border); }
.hq-weather-big { font-size: 44px; line-height: 1; }
.hq-weather-now { font-size: 28px; font-weight: 700; line-height: 1.15; }
.hq-weather-now span { font-size: 14px; font-weight: 600; color: var(--text-2); }
.hq-weather-today { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.hq-weather-hours { display: flex; gap: 4px; overflow-x: auto; padding: 10px 12px; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.hq-weather-hour { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 42px; padding: 6px 2px; border-radius: 10px; font-size: 13px; }
.hq-weather-hour:hover { background: var(--surface-hover); }
.hq-weather-hicon { font-size: 18px; line-height: 1.2; }
.hq-weather-prob { color: #3b82f6; min-height: 1em; white-space: nowrap; }
.hq-weather-days { padding: 4px 0; }
.hq-weather-day { display: flex; align-items: center; gap: 10px; padding: 7px 16px; }
.hq-weather-day:hover { background: var(--surface-hover); }
.hq-weather-dname { width: 62px; font-weight: 600; font-size: 13px; }
.hq-weather-range { white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.hq-weather-foot { padding: 8px 16px 12px; border-top: 1px solid var(--border); }
@media (max-width: 1100px) { .hq-weather-city { display: none; } }
@media (max-width: 760px) { .hq-weather-trigger { padding: 4px 8px; gap: 4px; } }

/* ── Finestrella «Installa Mosaico» in basso a sinistra (InstallBanner.razor e pagina di accesso) ── */
.install-pop {
    position: fixed; left: 20px; bottom: 20px; z-index: 44; width: 360px; max-width: calc(100vw - 32px);
    padding: 16px 16px 12px; border-radius: 18px; isolation: isolate; overflow: hidden;
    background: color-mix(in srgb, var(--surface-solid) 88%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .03) inset, 0 18px 50px -30px var(--accent);
    animation: install-pop-in .55s cubic-bezier(.2, .9, .25, 1.15) 1.2s both;
}
/* Alone sfumato con i colori del marchio dietro all'icona */
.install-pop::before {
    content: ""; position: absolute; z-index: -1; left: -60px; top: -80px; width: 240px; height: 200px; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(139, 92, 246, .35), rgba(236, 72, 153, .16) 60%, transparent); filter: blur(6px); pointer-events: none;
}
.install-pop[hidden] { display: none !important; }
.install-pop [hidden] { display: none !important; }
.install-pop.closing { animation: install-pop-out .22s ease-in forwards; }
.install-pop-x {
    position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent;
    color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: background .15s, color .15s;
}
.install-pop-x:hover, .install-pop-x:focus-visible { background: var(--surface-hover); color: var(--text); outline: none; }
.install-pop-head { display: flex; align-items: center; gap: 12px; padding-right: 24px; }
.install-pop-head b { display: block; font-size: 15px; line-height: 1.25; }
.install-pop-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.install-pop-icon {
    flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px; overflow: hidden;
    box-shadow: 0 10px 24px -10px rgba(139, 92, 246, .9), 0 0 0 1px rgba(255, 255, 255, .08);
    animation: install-pop-bob 3.6s ease-in-out 2s infinite;
}
.install-pop-icon img { display: block; width: 100%; height: 100%; }
.install-pop-perks { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; }
.install-pop-perks li {
    font-size: 11.5px; padding: 3px 9px 3px 7px; border-radius: 999px; color: var(--text-2);
    background: var(--grad-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.install-pop-perks li::before { content: "✓"; margin-right: 4px; color: var(--accent-2); font-weight: 700; }
.install-pop-text { font-size: 13px; color: var(--text-2); margin-top: 10px; line-height: 1.45; }
.install-pop-text b { color: var(--text); }
.install-pop-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 12px; }
@keyframes install-pop-in { from { opacity: 0; transform: translate(-12px, 28px) scale(.92); } }
@keyframes install-pop-out { to { opacity: 0; transform: translate(-10px, 18px) scale(.95); } }
@keyframes install-pop-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-3deg); } }
@media (max-width: 760px) {
    /* Telefono: sopra la barra in basso, larga quanto lo schermo */
    .install-pop { left: 12px; right: 12px; width: auto; max-width: none; bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    .install-pop, .install-pop.closing, .install-pop-icon { animation: none !important; }
}
@media (max-width: 760px) { .install-pop.in-login { bottom: calc(12px + env(safe-area-inset-bottom)); } }

/* Utenti e ruoli: azioni sulla riga (modifica, disattiva/riattiva, elimina) e attività che impediscono di eliminare */
.user-actions { display: inline-flex; gap: 2px; justify-content: flex-end; }
.user-actions .danger:hover { color: var(--danger, #dc2626); }
.user-blockers { margin: 8px 0 12px; padding-left: 20px; }
.user-blockers li { margin: 2px 0; }
