/* =============================================================================
   Hypercube Repo - app.css
   Stile: chiaro, pulito, minimale.
   Palette: bianco + grigi + lilla (#C7B8FF) e indaco (#4F46E5) come accenti.
   Tipografia leggera, system font, mobile-first.
   ============================================================================= */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

:root {
    /* Base: bianco e grigi neutri */
    --bg:            #fafafb;
    --surface:       #ffffff;
    --surface-2:     #f5f5f8;
    --text:          #1a1a24;
    --text-soft:     #4a4a55;
    --muted:         #8a8a95;
    --border:        #ececf2;
    --border-strong: #d8d8e0;

    /* Accenti: lilla e indaco */
    --lilac:         #c7b8ff;
    --lilac-soft:    #ede7ff;
    --indigo:        #4f46e5;
    --indigo-soft:   #eef0ff;
    --indigo-hover:  #4338ca;

    /* Semantica */
    --primary:           var(--indigo);
    --primary-contrast:  #ffffff;
    --accent:            var(--indigo);
    --accent-soft:       var(--indigo-soft);
    --danger:            #e11d48;
    --danger-soft:       #ffe4ea;
    --success:           #059669;
    --warn:              #b45309;

    /* Forme */
    --radius:    12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    /* Ombre molto leggere */
    --shadow-sm: 0 1px 2px rgba(20, 22, 40, .04);
    --shadow:    0 1px 2px rgba(20, 22, 40, .04), 0 2px 8px rgba(20, 22, 40, .04);
    --ring:      0 0 0 3px rgba(79, 70, 229, .15);

    --tap: 40px;
    --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --maxw: 760px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--indigo); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--indigo-hover); }

h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.015em; }
h1 { font-size: 1.5rem;  font-weight: 600; }
h2 { font-size: 1.05rem; font-weight: 600; }
h3 { font-size: .95rem;  font-weight: 600; }

.muted  { color: var(--muted); }
.soft   { color: var(--text-soft); }
.small  { font-size: .8rem; }
.center { text-align: center; }
.right  { text-align: right; }

/* ---------- Topbar ---------- */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    padding-top: calc(10px + env(safe-area-inset-top));
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: -.01em;
}
.brand:hover { color: var(--text); }
.brand-mark {
    width: 22px; height: 22px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--lilac), var(--indigo));
    flex-shrink: 0;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.iconbtn {
    width: var(--tap);
    height: var(--tap);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    border-radius: 10px;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn svg { stroke-width: 1.5; }

/* Menu dropdown */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
    position: absolute;
    right: 0;
    top: calc(var(--tap) + 6px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 220px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    z-index: 60;
}
.menu-panel a {
    display: block;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .9rem;
    line-height: 1.4;
}
.menu-panel a:hover { background: var(--surface-2); color: var(--text); }
.menu-panel a.danger { color: var(--danger); }
.menu-panel a.danger:hover { background: var(--danger-soft); color: var(--danger); }
.menu-panel hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

.lang-switcher {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding: 6px;
    justify-content: center;
}
.lang-switcher a {
    padding: 5px 9px;
    border-radius: 6px;
    font-size: .75rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: .03em;
}
.lang-switcher a:hover { background: var(--surface-2); color: var(--text); }
.lang-switcher a.active { background: var(--indigo); color: #fff; }
.lang-switcher.center { padding-top: 16px; }

/* ---------- Container & footer ---------- */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 20px 16px;
    padding-bottom: calc(56px + env(safe-area-inset-bottom));
    flex: 1;
}

.footer {
    text-align: center;
    color: var(--muted);
    padding: 24px 16px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    font-size: .8rem;
}

/* ---------- Page head ---------- */
.page-head { margin: 4px 0 18px; }
.page-head h1 { margin-bottom: 4px; }

.breadcrumb {
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: 6px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text-soft); }
.breadcrumb .sep { margin: 0 6px; opacity: .5; }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 7px 14px;
    font: inherit;
    font-size: .875rem;
    font-weight: 500;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    line-height: 1;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn svg { stroke-width: 1.5; width: 16px; height: 16px; }

.btn-primary {
    background: var(--indigo);
    color: #fff;
    border-color: var(--indigo);
}
.btn-primary:hover { background: var(--indigo-hover); border-color: var(--indigo-hover); color: #fff; }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-soft);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

.btn-sm     { min-height: 30px; padding: 4px 9px; font-size: .78rem; border-radius: 7px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-block  { width: 100%; }

.link-danger { color: var(--danger); cursor: pointer; }

/* ---------- Actions row ---------- */
.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 18px;
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
}
.card-title {
    margin: 0 0 12px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* ---------- Forms ---------- */
label {
    display: block;
    font-size: .8rem;
    font-weight: 500;
    margin: 14px 0 5px;
    color: var(--text-soft);
}
input[type=text], input[type=email], input[type=password], input[type=search],
input[type=file], textarea, select {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .9rem;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--indigo);
    box-shadow: var(--ring);
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a95' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 34px;
}
input[type=file] { padding: 6px; font-size: .85rem; }
input[inputmode=numeric] {
    letter-spacing: .25em;
    font-variant-numeric: tabular-nums;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 500;
}
.form-actions { margin-top: 18px; }
.form-card { padding: 20px; }

/* Segmented control (radio button stilizzati) */
.seg {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 8px;
    margin: 14px 0 6px;
}
.seg legend {
    padding: 0 6px;
    font-size: .72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.seg-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    margin: 0 !important;
    font-weight: 500;
    font-size: .88rem;
    color: var(--text);
}
.seg-opt:has(input:checked) { background: var(--lilac-soft); color: var(--text); }
.seg-opt input { accent-color: var(--indigo); }

.inline-form > summary { list-style: none; }
.inline-form > summary::-webkit-details-marker { display: none; }
.inline { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.inline input[type=text] { flex: 1; min-width: 160px; }

.row-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: 6px 0;
}
.row-form input[type=text], .row-form select, .row-form input[type=password] {
    min-width: 0;
    flex: 1 1 120px;
}
.check { display: inline-flex; align-items: center; gap: 6px; margin: 0; }

/* ---------- Item list (cartelle/file) ---------- */
.item-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .15s ease, background .15s ease;
}
.item:hover { border-color: var(--border-strong); }
.item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    min-height: 56px;
    color: var(--text);
}
.item-link:hover { background: var(--surface-2); color: var(--text); }
.item-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    flex-shrink: 0;
}
.item-icon svg { stroke-width: 1.5; width: 22px; height: 22px; }
.item-icon.folder {
    background: transparent;
    color: var(--indigo);
}
.item-icon.file {
    background: var(--surface-2);
    color: var(--text-soft);
}
.item-body { flex: 1; min-width: 0; }
.item-title {
    display: block;
    font-weight: 500;
    font-size: .92rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.item-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: .76rem;
    margin-top: 2px;
    flex-wrap: wrap;
}
.item-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.item-flags {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.item-chev {
    color: var(--muted);
    flex-shrink: 0;
}
.item-chev svg { stroke-width: 1.5; width: 16px; height: 16px; }

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--muted);
    font-size: .9rem;
}
.empty-state strong { color: var(--text); font-weight: 600; }

/* ---------- Flash ---------- */
.flash {
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: .88rem;
}
.flash-success { background: #ecfdf5; border-color: #a7f3d0; color: var(--success); }
.flash-error   { background: var(--danger-soft); border-color: #fecdd3; color: var(--danger); }

/* ---------- Tables ---------- */
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.tbl th, .tbl td {
    padding: 9px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.tbl th {
    font-size: .7rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.tbl .center { text-align: center; }
.tbl .right  { text-align: right; }
.tbl-zebra tbody tr:nth-child(odd) { background: var(--surface-2); }
.current-row { background: var(--lilac-soft) !important; }

@media (max-width: 540px) {
    .tbl thead { display: none; }
    .tbl tr {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid var(--border);
    }
    .tbl td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 4px 0;
        border-bottom: 0;
    }
    .tbl td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--muted);
        font-size: .75rem;
    }
}

/* ---------- Language pills (bandiere) ---------- */
.pills {
    list-style: none;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 6px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text-soft);
    font-size: .78rem;
    font-weight: 500;
    text-decoration: none;
    line-height: 1;
    transition: background .15s, border-color .15s, color .15s;
}
.pill:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-strong);
}
.pill-on {
    background: var(--indigo);
    color: #fff;
    border-color: var(--indigo);
}
.pill-on:hover { background: var(--indigo-hover); color: #fff; }

/* Flag emoji: dimensione uniforme via font-size */
.flag-emoji {
    display: inline-block;
    font-size: 14px;
    line-height: 1;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
    vertical-align: middle;
    flex-shrink: 0;
}
.flag-emoji-sm { font-size: 12px; }
.flag-emoji-lg { font-size: 18px; }

/* ---------- Preview (zero padding, immagine/pdf a tutta larghezza) ---------- */
.preview {
    margin: 14px 0;
}
.preview-image-wrap {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    justify-content: center;
    background: transparent;
}
.preview-image-wrap img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border-radius: var(--radius);
}
.preview-pdf-wrap {
    background: transparent;
    border-radius: var(--radius);
    padding: 0;
    overflow: auto;
    max-height: 80vh;
}
.pdf-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 4px 0 8px;
}
#pdfCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    background: white;
    box-shadow: var(--shadow-sm);
    border-radius: 6px;
}
.preview-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--muted);
    background: var(--surface-2);
    border-radius: var(--radius);
}
.preview-empty svg {
    stroke-width: 1.5;
    margin-bottom: 8px;
    color: var(--border-strong);
}
.preview-empty p { margin: 0; font-size: .85rem; }

/* ---------- Auth ---------- */
.auth-wrap {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.auth-card {
    width: 100%;
    max-width: 380px;
    text-align: center;
    padding: 28px 24px;
    box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.3rem; margin-bottom: 4px; font-weight: 600; }
.auth-card label { text-align: left; }
.auth-logo {
    width: 44px;
    height: 44px;
    margin: 0 auto 16px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--lilac), var(--indigo));
}

/* ---------- Search bar ---------- */
.search-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}
.search-bar input[type=search] {
    flex: 1;
}

/* ---------- Danger zone ---------- */
.danger-zone {
    margin-top: 18px;
}
.danger-zone summary {
    list-style: none;
    cursor: pointer;
    padding: 8px 0;
    color: var(--danger);
    font-size: .85rem;
    font-weight: 500;
}
.danger-zone summary::-webkit-details-marker { display: none; }
.dz-body {
    padding: 12px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ---------- File detail: titolo piccolo, accordion dettagli ---------- */
.page-head-sm h1.file-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 6px;
    word-break: break-word;
}
@media (min-width: 720px) {
    .page-head-sm h1.file-title { font-size: 1.25rem; }
}

/* Accordion "dettagli" molto discreto */
.details-disclosure {
    margin: 6px 0 14px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.details-disclosure > summary {
    list-style: none;
    cursor: pointer;
    padding: 8px 4px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color .15s;
}
.details-disclosure > summary::-webkit-details-marker { display: none; }
.details-disclosure > summary:hover { color: var(--text); }
.details-disclosure > summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
    margin-right: 4px;
    margin-top: -3px;
}
.details-disclosure[open] > summary::after { transform: rotate(-135deg); margin-top: 2px; }
.details-body {
    padding: 4px 4px 14px;
}

/* Definition list per i dettagli */
.kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 16px;
    row-gap: 4px;
    margin: 0;
    font-size: .85rem;
}
.kv dt {
    color: var(--muted);
    font-weight: 500;
    font-size: .78rem;
}
.kv dd {
    margin: 0;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    word-break: break-word;
}

/* ---------- Sezioni leggere senza card ---------- */
.section { margin: 20px 0; }
.section-title {
    margin: 0 0 10px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* ---------- Bottoni: variante icona-only e plus combinato ---------- */
.btn-icon {
    padding: 7px 10px;
    min-width: 38px;
}
.btn-icon svg { margin: 0; }

/* Icona con "+" già incorporato (non serve aggiungere testo "+") */
.ico-plus-on { /* per uniformità */ }

/* ---------- Pill "+" per aggiungere traduzione ---------- */
.pill-add {
    padding: 5px 8px;
    color: var(--indigo);
    border-color: var(--border-strong);
    background: var(--lilac-soft);
}
.pill-add:hover {
    background: var(--indigo);
    color: #fff;
    border-color: var(--indigo);
}
.pill-add svg { stroke-width: 1.8; }

/* ---------- Version list ---------- */
.version-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.version-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.version-current {
    border-color: var(--indigo);
    background: var(--indigo-soft);
}
.version-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text-soft);
    font-size: .75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.version-current .version-badge {
    background: var(--indigo);
    color: #fff;
}
.version-body { flex: 1; min-width: 0; }
.version-line { font-size: .88rem; color: var(--text); }
.version-note {
    margin-top: 2px;
    color: var(--text-soft);
    font-size: .8rem;
    word-break: break-word;
}
.version-dl { flex-shrink: 0; }

/* ---------- Form actions: variante centrata ---------- */
.form-actions-center {
    margin-top: 22px;
    display: flex;
    justify-content: center;
}
.form-actions-center .btn { min-width: 140px; }

/* Check inline */
.check-inline {
    display: inline-flex;
    margin: 14px 0 0;
    font-size: .88rem;
    color: var(--text);
}
.check-inline input { accent-color: var(--indigo); }

/* Grid 2 colonne per ruolo+lingua nel form utente */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 480px) {
    .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Admin: lista utenti come card pulite ---------- */
.user-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.user-row { }
.user-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .15s;
}
.user-card[open] { border-color: var(--border-strong); }
.user-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    min-height: 56px;
}
.user-summary::-webkit-details-marker { display: none; }
.user-summary:hover { background: var(--surface-2); }
.user-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--lilac), var(--indigo));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .9rem;
}
.user-info { flex: 1; min-width: 0; }
.user-name {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-weight: 500;
    font-size: .92rem;
    color: var(--text);
}
.user-email {
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-lang { flex-shrink: 0; }
.user-chev {
    color: var(--muted);
    transition: transform .2s ease;
    flex-shrink: 0;
}
.user-card[open] .user-chev { transform: rotate(180deg); }

.user-body {
    padding: 4px 16px 18px;
    border-top: 1px solid var(--border);
}
.user-form {
    padding-top: 6px;
}
.user-sep {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 18px 0 6px;
}

/* Badge per ruolo/stato */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.badge-indigo { background: var(--indigo-soft); color: var(--indigo); }
.badge-muted  { background: var(--surface-2); color: var(--muted); }

/* Form centrato (uso in danger zone) */
.form-centered { display: flex; justify-content: center; margin-top: 12px; }

/* ---------- Desktop polish ---------- */
@media (min-width: 720px) {
    h1 { font-size: 1.75rem; }
    .container { padding: 28px 24px; }
}
