/* ==========================================================================
   Cavalieri Arcadia — interfaccia
   ========================================================================== */

:root {
    --red: #CF2030;
    --red-600: #B81B2A;
    --red-50: #FDF2F3;
    --red-100: #FBE3E6;

    --ink: #0F172A;
    --ink-2: #334155;
    --muted: #64748B;
    --faint: #94A3B8;
    --line: #E2E8F0;
    --line-2: #EEF2F6;
    --bg: #F6F7F9;
    --surface: #FFFFFF;
    --hover: #F1F5F9;

    --green: #15803D;
    --green-50: #F0FDF4;
    --amber: #B45309;
    --amber-50: #FFFBEB;
    --blue: #1D4ED8;
    --blue-50: #EFF6FF;

    --c-iscritto: #CF2030;
    --c-visitatore: #2563EB;
    --c-ospite: #B7791F;

    --sidebar-w: 256px;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, .25);
    --focus: 0 0 0 3px rgba(207, 32, 48, .18);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-600); }

h1, h2, h3 { color: var(--ink); letter-spacing: -.015em; }
h1 { font-size: 1.5rem; font-weight: 650; margin: 0; line-height: 1.25; }
h2 { font-size: 1rem; font-weight: 600; margin: 0 0 .9rem; }
p { margin: 0 0 .75rem; }

.icon { flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.strong { font-weight: 600; color: var(--ink); }
.strong:hover { color: var(--red); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }

/* --------------------------------------------------------------------------
   Struttura: menu laterale + contenuto
   -------------------------------------------------------------------------- */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--line);
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1rem 1rem 1.1rem;
    padding-top: calc(1.1rem + env(safe-area-inset-top));
}

.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand img { border-radius: 8px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: .95rem; font-weight: 650; }
.brand-text span { font-size: .78rem; color: var(--muted); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: .25rem .75rem 1rem; }

.nav-group {
    margin: 1.1rem .6rem .35rem;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--faint);
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .65rem;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--ink-2);
    font-weight: 500;
}
.nav-item .icon { color: var(--faint); }
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item:hover .icon { color: var(--ink-2); }
.nav-item.active { background: var(--red-50); color: var(--red); }
.nav-item.active .icon { color: var(--red); }
.nav-item.active::before {
    content: "";
    position: absolute;
    left: -.75rem;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--red);
}
.nav-count {
    margin-left: auto;
    min-width: 1.6rem;
    padding: 0 .4rem;
    border-radius: 99px;
    background: var(--line-2);
    color: var(--muted);
    font-size: .75rem;
    font-weight: 600;
    text-align: center;
}
.nav-item.active .nav-count { background: var(--red-100); color: var(--red); }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: .75rem;
    margin-bottom: calc(.75rem + env(safe-area-inset-bottom));
    padding: .7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.sidebar-user form { margin: 0 0 0 auto; }
.avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: .78rem;
    font-weight: 650;
}
.user-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-text strong { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-text span { font-size: .75rem; color: var(--muted); }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.sidebar-close { display: none !important; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.content { max-width: 1320px; margin: 0 auto; padding: 2rem 2.25rem 4rem; }

.mobilebar { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-lg);
    }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open { overflow: hidden; }
    .sidebar-close { display: inline-grid !important; }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 30;
        display: block;
        background: rgba(15, 23, 42, .35);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

    .main { margin-left: 0; }
    .mobilebar {
        position: sticky;
        top: 0;
        z-index: 20;
        display: flex;
        align-items: center;
        gap: .5rem;
        height: calc(56px + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) .75rem 0;
        background: rgba(255, 255, 255, .92);
        backdrop-filter: saturate(180%) blur(10px);
        -webkit-backdrop-filter: saturate(180%) blur(10px);
        border-bottom: 1px solid var(--line);
    }
    .mobilebar img { border-radius: 6px; margin-left: auto; }
    .mobilebar-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .content { padding: 1.25rem 1rem 3rem; }
}

/* --------------------------------------------------------------------------
   Intestazione di pagina
   -------------------------------------------------------------------------- */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.page-head p { margin: .3rem 0 0; color: var(--muted); }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

@media (max-width: 1023px) {
    .page-head h1 { font-size: 1.3rem; }
}

/* --------------------------------------------------------------------------
   Card e griglie
   -------------------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }
.card.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.card.empty .icon { margin: 0 auto .75rem; color: var(--faint); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* Statistiche dashboard */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.1rem 1.2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    transition: border-color .15s ease, transform .15s ease;
}
.stat:hover { color: var(--ink); border-color: #CBD5E1; transform: translateY(-1px); }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; flex: none; }
.stat-body { display: flex; flex-direction: column; line-height: 1.2; }
.stat-n { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.stat-l { color: var(--muted); font-size: .85rem; }
.stat-iscritto .stat-icon { background: var(--red-50); color: var(--c-iscritto); }
.stat-visitatore .stat-icon { background: var(--blue-50); color: var(--c-visitatore); }
.stat-ospite .stat-icon { background: var(--amber-50); color: var(--c-ospite); }
.stat-premi .stat-icon { background: var(--line-2); color: var(--ink-2); }
@media (max-width: 520px) {
    .stat { padding: .9rem; gap: .7rem; }
    .stat-icon { width: 36px; height: 36px; }
    .stat-n { font-size: 1.35rem; }
}

.quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
@media (max-width: 520px) { .quick-actions { grid-template-columns: 1fr; } }
.quick-action {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .8rem .9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-weight: 500;
}
.quick-action .icon { color: var(--muted); }
.quick-action:hover { border-color: var(--red); color: var(--red); background: var(--red-50); }
.quick-action:hover .icon { color: var(--red); }

.actions-list { display: flex; flex-direction: column; gap: .5rem; }
.actions-list .btn { justify-content: flex-start; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line-2); }
.list li:first-child { padding-top: 0; }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list a { color: var(--ink); font-weight: 500; display: inline-flex; align-items: center; gap: .5rem; }
.list a:hover { color: var(--red); }
.list a .icon { color: var(--faint); }
.list form { margin: 0; }
.badge-count { background: var(--line-2); border-radius: 99px; padding: .05rem .6rem; font-size: .8rem; color: var(--muted); font-weight: 600; }

/* --------------------------------------------------------------------------
   Pulsanti
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    height: 38px;
    padding: 0 .95rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-2);
    font: inherit;
    font-size: .9rem;
    font-weight: 550;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--hover); color: var(--ink); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #1E293B; color: #fff; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-50); border-color: #F5C2C7; color: var(--red-600); }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-sm { height: 32px; padding: 0 .7rem; font-size: .83rem; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--red); cursor: pointer; }

/* --------------------------------------------------------------------------
   Form
   -------------------------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 1rem; }
.form label { display: flex; flex-direction: column; gap: .35rem; font-weight: 550; font-size: .88rem; color: var(--ink-2); }
.form .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 640px) { .form .row { grid-template-columns: 1fr; } }
.form-narrow { max-width: 720px; }

input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date],
input[type=search], input[type=url], input[type=file], select, textarea {
    width: 100%;
    min-height: 40px;
    padding: .5rem .75rem;
    border: 1px solid #CBD5E1;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 400;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: var(--focus); }
input[type=file] { padding: .45rem; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; margin: 0; accent-color: var(--red); cursor: pointer; }

.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .25rem; }

.type-switch, .corner-choice {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--line-2);
    align-self: flex-start;
}
.form .pill, .print-options .pill, .pill {
    position: relative;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: .4rem;
    padding: .35rem .85rem;
    border-radius: 7px;
    font-size: .86rem;
    font-weight: 550;
    color: var(--muted);
    cursor: pointer;
}
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.pill:has(input:focus-visible) { box-shadow: var(--focus); }

.hint { font-size: .8rem; font-weight: 400; color: var(--muted); }

/* --------------------------------------------------------------------------
   Filtri, barra di selezione, tabelle
   -------------------------------------------------------------------------- */

.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.search-field { position: relative; flex: 1 1 260px; }
.search-field .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-field input { padding-left: 2.25rem; }
.filters input[type=date] { width: auto; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: clip; /* non crea un contenitore di scorrimento: la barra di selezione resta sticky */
}

.bulkbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .65rem .9rem;
    border-bottom: 1px solid var(--line);
    background: #FBFCFD;
    border-radius: var(--radius) var(--radius) 0 0;
}
.bulk-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.check-all { display: inline-flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .87rem; cursor: pointer; }
.check-all [data-selected-count] { color: var(--ink); font-weight: 600; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .75rem .9rem; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line-2); }
.table th {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    background: #FBFCFD;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFBFC; }
.table tbody tr:has(.col-check input:checked) { background: var(--red-50); }
.col-check { width: 44px; }
.col-actions { text-align: right !important; }
.row-actions { display: inline-flex; gap: .35rem; }
.row-muted td { color: var(--faint); }
.table-foot { padding: .65rem .9rem; border-top: 1px solid var(--line-2); color: var(--muted); font-size: .85rem; }
.note { white-space: pre-line; max-width: 52ch; margin-top: .15rem; }

.tag { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; padding: .1rem .55rem; border-radius: 99px; background: var(--line-2); color: var(--muted); vertical-align: middle; }
.tag-iscritto { background: var(--red-50); color: var(--c-iscritto); }
.tag-visitatore { background: var(--blue-50); color: var(--c-visitatore); }
.tag-ospite { background: var(--amber-50); color: var(--amber); }

/* Tabelle come schede su schermi piccoli */
@media (max-width: 720px) {
    .table.stack thead { display: none; }
    .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
    .table.stack tr { position: relative; padding: .85rem .9rem .85rem 3rem; border-bottom: 1px solid var(--line-2); }
    .table.stack tbody tr:last-child { border-bottom: 0; }
    .table.stack td { padding: .1rem 0; border: 0; }
    .table.stack td.col-check { position: absolute; left: .95rem; top: .95rem; width: auto; padding: 0; }
    .table.stack td[data-label]:not(:empty)::before { content: attr(data-label) " · "; color: var(--faint); font-size: .8rem; }
    .table.stack td.col-actions { text-align: left !important; padding-top: .55rem; }
    .bulkbar { position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 5; }
    .bulk-actions { width: 100%; }
    .bulk-actions .btn { flex: 1; padding: 0 .5rem; }
}

/* --------------------------------------------------------------------------
   Elenco persone con riquadro opzioni di stampa
   -------------------------------------------------------------------------- */

.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.list-main { min-width: 0; }
@media (max-width: 1240px) {
    .with-aside { grid-template-columns: 1fr; }
    .print-options { order: -1; }
}

.print-options { position: sticky; top: 1.5rem; margin: 0; padding: 0; }
@media (max-width: 1240px) { .print-options { position: static; } }
.print-options > summary {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.25rem;
    list-style: none;
    cursor: pointer;
}
.print-options > summary::-webkit-details-marker { display: none; }
.print-options > summary::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid var(--faint);
    border-bottom: 2px solid var(--faint);
    transform: rotate(45deg) translateY(-2px);
    transition: transform .15s ease;
}
.print-options[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.print-options[open] > summary { border-bottom: 1px solid var(--line-2); }
.po-status { font-size: .8rem; color: var(--muted); font-weight: 500; }
.po-body { display: flex; flex-direction: column; gap: 1rem; padding: 1rem 1.25rem 1.25rem; }
.print-options h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.print-options h2 .icon { color: var(--muted); }
.print-options p { margin: 0; }
.print-options label { display: flex; flex-direction: column; gap: .35rem; font-weight: 550; font-size: .88rem; color: var(--ink-2); }
.print-options .corner-choice { display: flex; align-self: stretch; }
.print-options .corner-choice .pill { flex: 1; justify-content: center; padding: .4rem .5rem; text-align: center; }
.apply-to { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .88rem; }
.print-options .check { flex-direction: row; align-items: center; gap: .45rem; font-weight: 500; }

.corner-preview {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8%;
    aspect-ratio: 297 / 105;
    padding: 0 7%;
    border: 1px dashed #CBD5E1;
    border-radius: var(--radius-sm);
    background: #fff;
}
.cp-logo { color: var(--red); font-weight: 900; font-size: 1.05rem; letter-spacing: -.03em; }
.cp-lines { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cp-lines i { display: block; height: 6px; width: 80%; background: var(--ink); border-radius: 2px; }
.cp-lines i + i { width: 55%; height: 4px; opacity: .5; }
.cp-corner { position: absolute; right: 6%; bottom: 8%; font-weight: 300; font-size: .8rem; color: var(--ink); letter-spacing: .05em; }
.cp-corner.qr { width: 20px; height: 20px; background: repeating-conic-gradient(var(--ink) 0 25%, #fff 0 50%) 0 0 / 6px 6px; outline: 2px solid var(--ink); }

/* --------------------------------------------------------------------------
   Messaggi
   -------------------------------------------------------------------------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    flex-wrap: wrap;
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: .92rem;
}
.alert a { font-weight: 600; margin-left: auto; white-space: nowrap; }
.alert-success { background: var(--green-50); border-color: #BBF7D0; color: var(--green); }
.alert-error { background: var(--red-50); border-color: #FBCFD4; color: var(--red-600); }
.alert-warning { background: var(--amber-50); border-color: #FDE68A; color: var(--amber); }
.alert-info { background: var(--blue-50); border-color: #BFDBFE; color: var(--blue); }

.debug { text-align: left; white-space: pre-wrap; font-size: .75rem; background: var(--bg); padding: 1rem; border-radius: 8px; overflow: auto; }

.offline-banner {
    position: fixed;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    padding: .55rem 1rem;
    border-radius: 99px;
    background: var(--ink);
    color: #fff;
    font-size: .88rem;
    box-shadow: var(--shadow-lg);
}

/* --------------------------------------------------------------------------
   Pagine senza login (accesso, setup, offline)
   -------------------------------------------------------------------------- */

.guest-main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem 1rem;
    background: radial-gradient(1200px 500px at 50% -10%, var(--red-100), transparent 60%), var(--bg);
}
.guest-content { width: 100%; max-width: 400px; }
.login { padding: 2rem 1.75rem; box-shadow: 0 10px 30px -12px rgba(15, 23, 42, .18); }
.login-head { text-align: center; margin-bottom: 1.6rem; }
.login-head img { border-radius: 14px; margin: 0 auto 1rem; display: block; }
.login-head h1 { font-size: 1.35rem; }
.login-head p { margin: .3rem 0 0; color: var(--muted); }
.guest-foot { text-align: center; color: var(--faint); font-size: .8rem; margin-top: 1.25rem; }

/* Pagina offline */
.container.narrow { max-width: 400px; margin: 0 auto; padding: 12vh 1rem 2rem; }
.brand-mark { display: inline-block; background: var(--red); color: #fff; font-weight: 900; padding: .15rem .6rem; border-radius: 8px; }
.brand-mark.big { font-size: 1.5rem; margin-bottom: .75rem; }

/* Mostra / nascondi password */
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 2.75rem; }
.pw-toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--faint);
    cursor: pointer;
}
.pw-toggle:hover { color: var(--ink); background: var(--hover); }
.pw-toggle:focus-visible { outline: none; box-shadow: var(--focus); }

.print-options > summary h2 { white-space: nowrap; }
.po-status { white-space: nowrap; }
.print-options[open] .po-status { display: none; }
.form > .btn:not(.btn-block) { align-self: flex-start; }

/* Profilo */
.user-link { display: flex; align-items: center; gap: .65rem; min-width: 0; color: var(--ink); border-radius: var(--radius-sm); }
.user-link:hover { color: var(--ink); }
.user-link:hover .user-text strong { color: var(--red); }
.sidebar-user.active { border-color: var(--red-100); background: var(--red-50); }
.profile-head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.25rem; }
.profile-head strong { font-size: 1.05rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.05rem; }
.card h2 .icon { display: inline-block; vertical-align: -3px; margin-right: .35rem; color: var(--muted); }
a.tag:hover { color: var(--red); }
