/* CloudLMWebDesign — interfaccia gestionale
   Colori del brand: blu #016BFF, nero #212428, bianco/grigio #E5E6E8. Font: Poppins. */

:root {
    --brand: #016bff;
    --brand-600: #0154cc;
    --brand-700: #0143a3;
    --brand-50: #eaf2ff;
    --ink: #212428;
    --muted: #5b6270;
    --bg: #f3f5f9;
    --card: #ffffff;
    --line: #dde2ea;
    --soft: #e5e6e8;
    --ok: #0f6e4f;
    --ok-50: #e7f5ef;
    --warn: #a15c07;
    --warn-50: #fdf3e3;
    --danger: #c0262d;
    --danger-50: #fcebec;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 4px 16px rgba(20, 30, 60, .06);
    --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --side-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
:focus-visible { outline: 3px solid rgba(1, 107, 255, .45); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { left: 8px; }

/* Struttura */
.app { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.sidebar {
    background: var(--ink);
    color: #cfd3da;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar .brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 18px; color: #fff; font-weight: 600; text-decoration: none; }
.sidebar .brand img { width: 32px; height: 32px; }
.sidebar .brand { min-width: 0; }
.sidebar .brand img { flex: none; }
.sidebar .brand span { font-size: .9rem; line-height: 1.2; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav-group { margin: 14px 0 4px; padding: 0 10px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #8a909b; }
.nav a, .nav .soon {
    display: flex; align-items: center; gap: 11px;
    padding: 8px 10px; margin: 1px 0;
    color: #dfe2e7; border-radius: var(--radius-sm); font-size: .9rem;
    position: relative; transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav a > span, .nav .soon > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav-icon { width: 18px; height: 18px; flex: none; opacity: .85; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), opacity .18s ease; }
.nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; transform: translateX(2px); }
.nav a:hover .nav-icon { transform: scale(1.15) rotate(-4deg); opacity: 1; }
.nav a[aria-current="page"] { background: linear-gradient(90deg, var(--brand), #2b84ff); color: #fff; box-shadow: 0 4px 14px rgba(1, 107, 255, .35); }
.nav a[aria-current="page"] .nav-icon { opacity: 1; }
.nav .soon { color: #6f7580; cursor: default; }
.nav .soon .nav-icon { opacity: .45; }
.nav .soon small { margin-left: auto; flex: none; font-size: .6rem; border: 1px solid #4a4f58; border-radius: 99px; padding: 0 5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 28px; background: var(--card); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 10;
}
.topbar .who { display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--muted); }
.topbar .menu-toggle { display: none; }
.content { padding: 28px; max-width: 1200px; width: 100%; }
.page-head h1 { overflow-wrap: anywhere; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 0; }

/* Card e griglie */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.card > h2:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid > * { min-width: 0; }
.grid > .card { margin-bottom: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.stat { padding: 18px 20px; }
.stat .label { color: var(--muted); font-size: .82rem; }
.stat .value { font-size: 1.8rem; font-weight: 600; line-height: 1.2; margin-top: 4px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Tabelle */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; background: #fafbfd; }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }

/* Badge */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .75rem; font-weight: 500; background: var(--soft); color: var(--ink); white-space: nowrap; }
.badge.ok { background: var(--ok-50); color: var(--ok); }
.badge.warn { background: var(--warn-50); color: var(--warn); }
.badge.danger { background: var(--danger-50); color: var(--danger); }
.badge.brand { background: var(--brand-50); color: var(--brand-700); }

/* Form */
.form-row { margin-bottom: 16px; }
label, .label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: .82rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=search],
input[type=date], input[type=datetime-local], input[type=time], input[type=month], input[type=number], select, textarea {
    width: 100%; font: inherit; color: inherit;
    padding: 10px 12px; border: 1px solid #c9d0db; border-radius: var(--radius-sm); background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 3px solid rgba(1, 107, 255, .18); outline-offset: 0; }
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .84rem; margin: 6px 0 0; }
.code-input { font-size: 1.5rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-bottom: 8px; }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--brand); }
.check small { display: block; color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 16px; }
legend { padding: 0 6px; font-weight: 600; font-size: .9rem; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* Pulsanti */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 500; font-size: .92rem;
    padding: 9px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
    background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; line-height: 1.3;
}
.btn:hover { background: var(--brand-600); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--ink); border-color: #c9d0db; }
.btn.secondary:hover { background: #f4f6fa; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #9f1f25; }
.btn.link { background: none; color: var(--brand-600); padding: 0; border: 0; }
.btn.link:hover { text-decoration: underline; }
.btn.block { width: 100%; }
.btn.sm { padding: 5px 12px; font-size: .84rem; }
form.inline { display: inline; }

/* Messaggi */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-size: .92rem; }
.flash.success { background: var(--ok-50); border-color: #b5e0cd; color: #0c5a40; }
.flash.error { background: var(--danger-50); border-color: #f1c1c4; color: #8c1b20; }
.flash.warning { background: var(--warn-50); border-color: #f0d6a8; color: #7a4505; }
.flash.info { background: var(--brand-50); border-color: #c4dbff; color: var(--brand-700); }

/* Permessi */
.perm-group { margin-bottom: 18px; }
.perm-group h3 { font-size: .9rem; margin-bottom: 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
.override-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.override-row:last-child { border-bottom: 0; }
.override-row select { width: auto; padding: 4px 8px; font-size: .85rem; }

.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; font-family: ui-monospace, Menlo, monospace; font-size: 1rem; background: #fafbfd; padding: 14px; border-radius: var(--radius-sm); border: 1px dashed #c9d0db; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 1.1rem; letter-spacing: .08em; background: #fafbfd; border: 1px dashed #c9d0db; padding: 10px 14px; border-radius: var(--radius-sm); word-break: break-all; }
.pagination { display: flex; gap: 6px; margin-top: 16px; align-items: center; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .form-row { margin: 0; min-width: 180px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
pre.details { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: .78rem; color: var(--muted); max-width: 420px; }

/* Pagine di accesso */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #f3f6fb 0%, #e8eef9 100%); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(20, 30, 60, .12); padding: 34px 32px; }
.auth-card .logo { display: block; width: 72px; height: 72px; margin: 0 auto 10px; }
.auth-card h1 { text-align: center; font-size: 1.35rem; overflow-wrap: anywhere; }
.auth-card .logo-wide { width: 92px; height: auto; }
.auth-brand { overflow-wrap: anywhere;  text-align: center; font-weight: 600; color: var(--brand); margin: -4px 0 14px; letter-spacing: .01em; }
.auth-card .intro { text-align: center; color: var(--muted); font-size: .92rem; }
.auth-foot { text-align: center; margin-top: 18px; font-size: .88rem; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
details.alt summary { cursor: pointer; color: var(--brand-600); font-size: .9rem; margin-top: 14px; }

/* Animazioni (disattivate con "movimento ridotto") */
@keyframes cloud-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse-dot { 0% { box-shadow: 0 0 0 0 rgba(18, 128, 92, .45); } 70% { box-shadow: 0 0 0 7px rgba(18, 128, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 128, 92, 0); } }
.sidebar .brand img, .auth-card .logo:not(.logo-wide) { animation: cloud-float 4s ease-in-out infinite; }
.content > .card, .content > .grid, .content > .page-head { animation: rise-in .35s ease both; }
.content > .grid:nth-of-type(2) { animation-delay: .05s; }
.content > .grid:nth-of-type(3) { animation-delay: .1s; }
.card { transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease; }
.card.tile:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(20, 30, 60, .12); }
.badge.ok::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; animation: pulse-dot 2s infinite; }
.btn { transition: background .15s ease, transform .12s ease, box-shadow .15s ease; }
.btn:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Icone nelle pagine */
.title-icon { display: flex; align-items: center; gap: 10px; }
.page-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-50); color: var(--brand); flex: none; animation: icon-pop .45s cubic-bezier(.34, 1.56, .64, 1) both; }
.page-icon .icon { width: 22px; height: 22px; }
h2.title-icon .icon { width: 20px; height: 20px; color: var(--brand); flex: none; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.card:hover h2.title-icon .icon { transform: scale(1.12) rotate(-6deg); }
.card.tile { position: relative; overflow: hidden; }
.tile-icon { position: absolute; right: 16px; top: 16px; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), background .2s ease, color .2s ease; }
.tile-icon .icon { width: 22px; height: 22px; }
.card.tile:hover .tile-icon { transform: scale(1.1) rotate(-8deg); background: var(--brand); color: #fff; }
@keyframes icon-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

/* Moduli gestione */
.span-2 { grid-column: 1 / -1; }
.filters .grow { flex: 1 1 260px; }
.quick-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -6px 0 18px; }
.note { border-top: 1px solid var(--line); padding: 10px 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: 0; }
.reveal { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.secret-value { background: #fafbfd; border: 1px dashed #c9d0db; border-radius: 6px; padding: 1px 8px; max-width: 280px; overflow-wrap: anywhere; }
tr.archived td { opacity: .6; }
.scroll-box { max-height: 280px; overflow-y: auto; padding-right: 6px; }
.list-compact { margin: 0; padding-left: 18px; }

/* Responsive */
@media (max-width: 960px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; transform: translateX(-100%); transition: transform .2s ease; z-index: 50; }
    .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    .topbar .menu-toggle { display: inline-flex; }
    .topbar { padding: 10px 16px; }
    .content { padding: 18px 16px; }
    .grid-2, .grid-3, .grid-4, .grid-main, .perm-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
.card.tile { display: block; color: inherit; text-decoration: none; }
.card.tile:hover { border-color: var(--brand); text-decoration: none; }

/* Sito: schede di stato, editor informative, categorie cookie */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: .9rem; text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.tabs a:hover { border-color: var(--brand); }
.tabs a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs a[aria-current="page"] .badge { background: rgba(255, 255, 255, .25); color: #fff; }
textarea.editor { font-size: .88rem; line-height: 1.55; min-height: 420px; }
.policy-preview { max-width: 760px; }
.policy-preview h2 { font-size: 1.15rem; margin-top: 1.4em; }
.policy-preview h3 { font-size: 1rem; margin-top: 1.2em; }
.category-row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); }
.category-row:last-child { border-bottom: 0; }
.category-row .form-row { margin: 0; min-width: 200px; }
.category-row .grow { flex: 1 1 320px; }
.message-body { white-space: normal; line-height: 1.7; }

/* Area clienti */
body.area { background: var(--bg); }
.area-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.area-inner { max-width: 1200px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.area-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.area-brand img { animation: cloud-float 4s ease-in-out infinite; }
.area-brand:hover { text-decoration: none; color: var(--brand-600); }
.area-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.area-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; color: var(--ink); font-size: .9rem; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.area-nav a:hover { background: var(--brand-50); color: var(--brand-700); text-decoration: none; }
.area-nav a[aria-current="page"] { background: var(--brand); color: #fff; }
.area-nav .nav-icon { width: 17px; height: 17px; }
.area-user { display: flex; align-items: center; gap: 10px; }
.area-content { margin: 0 auto; }
.area-client { margin: 0 0 6px; }
.area-footer { text-align: center; padding: 24px; }
.card.narrow { max-width: 620px; }
.row-actions { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Conversazione dei ticket */
.thread { display: grid; gap: 14px; }
.msg { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: #fff; max-width: 88%; }
.msg.mine { margin-left: auto; background: var(--brand-50); border-color: #c4dbff; }
.msg.internal { background: var(--warn-50); border-color: #f0d6a8; border-style: dashed; }
.msg header { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.msg header time { margin-left: auto; }
.msg-body { line-height: 1.65; overflow-wrap: anywhere; }
.attachments { list-style: none; margin: 10px 0 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.attachments a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .85rem; }
.attachments .icon { width: 15px; height: 15px; }
@media (max-width: 1180px) {
    .area-nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
    .area-user { margin-left: auto; }
}
@media (max-width: 820px) {
    .area-inner { padding: 10px 16px; }
    .msg { max-width: 100%; }
}
td.center, th.center { text-align: center; }
.invoice-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.invoice-form input { width: auto; max-width: 140px; padding: 5px 8px; font-size: .84rem; }
.checklist-sm { padding-left: 18px; margin: 0; font-size: .9rem; }
.checklist-sm li { margin-bottom: 4px; }

/* Area clienti: scelta del piano */
.plan-card { display: flex; flex-direction: column; gap: 10px; }
.plan-card.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.plan-card .btn { margin-top: auto; align-self: flex-start; }
.plan-card .badge { align-self: flex-start; }
.plan-price { margin: 0; font-size: 1.05rem; }
.plan-price strong { font-size: 1.7rem; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }

/* Contratti */
.break { word-break: break-all; }
.contract-body { font-size: .95rem; line-height: 1.6; }
.contract-body ul, .contract-body ol { padding-left: 22px; }
.contract-scroll { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; background: #fff; }
.otp-input { font-size: 1.4rem; letter-spacing: .4em; max-width: 220px; text-align: center; }

/* Area clienti: passaggi e periodicità */
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.steps li { padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.steps li[aria-current="step"] { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.period-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.period-option { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.period-option:hover { border-color: var(--brand); }
.period-option.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.period-option .badge { align-self: flex-start; }
.period-option small { color: var(--muted); }

/* Registrazione */
.auth-card.wide { max-width: 820px; }
.auth-card.wide .card { box-shadow: none; padding: 0; border: 0; margin-bottom: 18px; }
.auth-card.wide .card h2 { font-size: 1rem; border-bottom: 1px solid var(--line); padding-bottom: 6px; }

/* "Non aggiornare": menu con il motivo */
.hold-menu { display: inline-block; position: relative; }
.hold-menu summary { list-style: none; cursor: pointer; }
.hold-menu summary::-webkit-details-marker { display: none; }
.hold-menu[open] form { position: absolute; right: 0; z-index: 20; margin-top: 6px; width: 260px; display: grid; gap: 6px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-align: left; white-space: normal; }

/* Monitoraggio: barre degli ultimi controlli */
.mon-bars { display: flex; align-items: flex-end; gap: 2px; height: 64px; padding: 4px 0; }
.mon-bars span { flex: 1 1 0; min-width: 2px; border-radius: 2px 2px 0 0; background: #49b97a; }
.mon-bars span.ko { background: var(--danger); }

.mon-bars span.h1 { height: 10%; }
.mon-bars span.h2 { height: 20%; }
.mon-bars span.h3 { height: 30%; }
.mon-bars span.h4 { height: 40%; }
.mon-bars span.h5 { height: 50%; }
.mon-bars span.h6 { height: 60%; }
.mon-bars span.h7 { height: 70%; }
.mon-bars span.h8 { height: 80%; }
.mon-bars span.h9 { height: 90%; }
.mon-bars span.h10 { height: 100%; }
.stat .value.value-sm { font-size: 1.1rem; }
.code-big { font-size: 1.3rem; letter-spacing: .05em; }

/* Area clienti: accessi */
.security-box { border-left: 4px solid var(--brand); }
.access-list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.access-list li:last-child { border-bottom: 0; }
.access-list .hold-menu, .access-list form.inline { justify-self: start; }

/* Scheda cliente: archivia o elimina */
.danger-zone { border-color: #f1c1c4; }
.danger-zone summary { list-style: none; cursor: pointer; display: inline-flex; }
.danger-zone summary::-webkit-details-marker { display: none; }
.erase-form { margin-top: 12px; max-width: 560px; }

/* Credenziali: schede per categoria e gruppi nella tabella */
.tabs .count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bg-alt, #f1f4f9); font-size: .78rem; font-weight: 600; }
.tabs a[aria-current="page"] .count { background: rgba(255, 255, 255, .25); color: #fff; }
.group-row th { background: var(--bg-alt, #f5f7fb); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft, #3a3f46); padding-top: 14px; }

/* Area clienti: scelta del pagamento e coordinate del bonifico */
.pay-choice { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 0 0 14px; display: grid; gap: 10px; }
.pay-choice legend { font-weight: 600; padding: 0 6px; }
.bank-box { background: var(--bg-alt, #f5f7fb); border-radius: 12px; padding: 14px 16px; }
.bank-box .mono { overflow-wrap: anywhere; }
table.compact th, table.compact td { padding: 6px 10px; }
.vault-group { margin: 12px 0 4px; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.vault-group:first-of-type { margin-top: 0; }

/* Campi data e ora: stessa altezza e stile degli altri, icona del calendario nei colori del gestionale */
input[type=date], input[type=datetime-local], input[type=time], input[type=month] { min-height: 42px; line-height: 1.2; appearance: none; -webkit-appearance: none; }
input[type=date]::-webkit-date-and-time-value, input[type=datetime-local]::-webkit-date-and-time-value { text-align: left; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator, input[type=month]::-webkit-calendar-picker-indicator {
    cursor: pointer; opacity: .55; padding: 4px; border-radius: 6px; transition: opacity .15s ease, background .15s ease;
}
input[type=date]:hover::-webkit-calendar-picker-indicator, input[type=datetime-local]:hover::-webkit-calendar-picker-indicator { opacity: 1; background: var(--brand-50); }
input[type=number] { -moz-appearance: textfield; }
.mail-preview { width: 100%; min-height: 520px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f3f5f9; }
/* schermi stretti: le etichette lunghe (es. "rinnovo automatico mensile") vanno a capo invece di uscire dal riquadro */
@media (max-width: 640px) { .badge { white-space: normal; text-align: left; } }

/* Editor delle comunicazioni */
.editor { border: 1px solid #c9d0db; border-radius: var(--radius-sm); background: #fff; overflow: hidden; }
.editor:focus-within { border-color: var(--brand); outline: 3px solid rgba(1, 107, 255, .18); }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--bg-alt, #f5f7fb); }
.editor-toolbar button { font: inherit; font-size: .82rem; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; min-height: 32px; }
.editor-toolbar button:hover { background: #fff; border-color: var(--line); }
.editor-toolbar button[aria-pressed="true"] { background: var(--brand-50); border-color: var(--brand); color: var(--brand-700); }
.editor-toolbar .sep { width: 1px; background: var(--line); margin: 4px 2px; }
.editor-area { min-height: 280px; padding: 14px 16px; line-height: 1.6; outline: none; }
.editor-area h2 { font-size: 1.2rem; margin: 18px 0 8px; }
.editor-area h3 { font-size: 1.05rem; margin: 14px 0 6px; }
.editor-area p { margin: 0 0 12px; }
.editor-area blockquote { margin: 0 0 12px; padding: 2px 0 2px 12px; border-left: 3px solid var(--brand); color: var(--ink-soft, #3a3f46); }
.editor-area a { color: var(--brand-700); }
.editor-area a[data-button] { display: inline-block; background: var(--brand); color: #fff; text-decoration: none; padding: 9px 20px; border-radius: 999px; font-weight: 600; }
.audience-list { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-left: 28px; }
.recipient-list { max-height: 320px; overflow: auto; margin-bottom: 16px; }
.send-box { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-alt, #f5f7fb); }
/* Storage Box: barre di occupazione */
.storage-meter { width: 100%; height: 10px; margin-top: 8px; }
.share-meter { width: 80px; height: 8px; vertical-align: middle; }

/* Vulnerabilità note: titoletto nel report e fonte Wordfence (licenza: link, copyright e testo della licenza) */
h3.small-title { font-size: .95rem; margin: 16px 0 6px; }
h3.small-title .icon { width: 16px; height: 16px; color: var(--brand); flex: none; }
.wordfence-credit { margin-top: 12px; }
.wordfence-credit summary { cursor: pointer; }
.wordfence-credit p { margin: 6px 0; }

/* Barra di avanzamento di backup, ripristini e operazioni sui siti */
.progress-wrap { display: grid; gap: 4px; min-width: 160px; margin-top: 4px; }
progress.progress { appearance: none; -webkit-appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--line, #e5e7eb); overflow: hidden; }
progress.progress::-webkit-progress-bar { background: var(--line, #e5e7eb); border-radius: 999px; }
progress.progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; transition: width .6s ease; }
progress.progress::-moz-progress-bar { background: var(--brand); border-radius: 999px; }
[data-live][data-busy] .live-note { display: inline-flex; align-items: center; gap: 6px; }
.live-note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: live-pulse 1.4s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .live-note::before { animation: none; } progress.progress::-webkit-progress-value { transition: none; } }
