/* ============================================================
   Gestionale Clienti — Leonik Informatica
   Tema: Corporate italiana, palette Leonik
   Font: system font stack (nessuna dipendenza esterna — rispetta la CSP
   script/style/font-src 'self' e la privacy: nessuna chiamata a Google).
   ============================================================ */

/* ---- Design tokens ---- */
:root {
    /* Brand */
    --blu:          #0048A8;
    --blu-scuro:    #003A87;
    --blu-chiaro:   #E8F0FB;
    --ambra:        #D8A048;
    --ambra-chiaro: #FDF3E0;

    /* Testo */
    --testo:        #2A2A2A;
    --testo-soft:   #484848;
    --testo-muted:  #7A8394;

    /* Superfici */
    --bg:           #F4F6FA;
    --bg-alt:       #EEF1F7;
    --card:         #FFFFFF;
    --bordo:        #DDE2EC;
    --bordo-focus:  rgba(0, 72, 168, 0.4);

    /* Feedback */
    --ok-bg:        #EAF5EC;
    --ok-fg:        #1A6B2A;
    --ok-bordo:     #B2D9BA;
    --err-bg:       #FBE8E8;
    --err-fg:       #9A1F1F;
    --err-bordo:    #F0BABA;
    --warn-bg:      #FFF8E8;
    --warn-fg:      #7A5700;

    /* Geometria */
    --radius-sm:    6px;
    --radius:       10px;
    --radius-lg:    14px;
    --shadow-xs:    0 1px 3px rgba(0, 30, 70, 0.06);
    --shadow-sm:    0 2px 8px rgba(0, 30, 70, 0.09);
    --shadow-md:    0 4px 18px rgba(0, 30, 70, 0.11);
    --shadow-card:  0 1px 3px rgba(0, 30, 70, 0.06), 0 3px 10px rgba(0, 30, 70, 0.07);

    /* Tipografia */
    --font:         system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono:    ui-monospace, 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', monospace;

    /* Transizioni */
    --t-fast:       0.12s ease;
    --t-mid:        0.20s ease;

    /* Topbar height (usato per offset sticky) */
    --topbar-h:     64px;
}

/* ---- Reset + base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--testo);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
}

img { display: block; max-width: 100%; }
a { color: var(--blu); }
a:focus-visible {
    outline: 2px solid var(--blu);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ================================================================
   TOPBAR
   ================================================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 28px;
    background: var(--card);
    border-bottom: 1px solid var(--bordo);
    /* Sottile accent laterale sinistro in blu */
    border-left: 4px solid var(--blu);
    box-shadow: var(--shadow-sm);
}

/* Brand / logo */
.brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    margin-right: 32px;
}

.brand-logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}

/* Barra separatrice verticale dopo logo */
.topbar-sep {
    width: 1px;
    height: 28px;
    background: var(--bordo);
    margin-right: 28px;
    flex-shrink: 0;
}

/* Nav principale */
.topnav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.topnav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.933rem;
    color: var(--testo-soft);
    transition: background var(--t-fast), color var(--t-fast);
    white-space: nowrap;
}

.topnav a:hover {
    background: var(--bg);
    color: var(--blu);
}

.topnav a.active {
    background: var(--blu-chiaro);
    color: var(--blu);
    font-weight: 600;
}

/* Icone nav (SVG inline via CSS background — usiamo emoji Unicode come fallback) */
.topnav a .nav-icon {
    font-size: 1em;
    opacity: 0.7;
}

/* Area utente */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    padding-left: 20px;
    border-left: 1px solid var(--bordo);
}

.topbar-username {
    font-size: 0.867rem;
    font-weight: 500;
    color: var(--testo-soft);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-username::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF7E;
    margin-right: 7px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.logout-form { margin: 0; }

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.867rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--testo-soft);
    background: none;
    cursor: pointer;
    border: 1px solid var(--bordo);
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.logout-btn:hover {
    background: var(--err-bg);
    color: var(--err-fg);
    border-color: var(--err-bordo);
}

/* ================================================================
   LAYOUT CONTENUTO
   ================================================================ */
.content {
    max-width: 940px;
    margin: 0 auto;
    padding: 36px 24px 64px;
}

/* Intestazioni pagina */
.page-header {
    margin-bottom: 28px;
}

h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--testo);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

h1 .h1-accent {
    color: var(--blu);
}

h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--testo);
}

/* ================================================================
   FLASH / ALERT
   ================================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 0.933rem;
    font-weight: 500;
    border: 1px solid transparent;
    animation: slideDown 0.22s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: var(--ok-bg);
    color: var(--ok-fg);
    border-color: var(--ok-bordo);
}

.alert-error,
.alert-danger {
    background: var(--err-bg);
    color: var(--err-fg);
    border-color: var(--err-bordo);
}

.alert-icon {
    font-size: 1.1em;
    flex-shrink: 0;
    margin-top: 0.05em;
}

/* ================================================================
   CARD
   ================================================================ */
.card {
    background: var(--card);
    border: 1px solid var(--bordo);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 28px 32px;
}

.card + .card { margin-top: 20px; }

/* ================================================================
   BOTTONI
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    background: var(--blu);
    color: #fff;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.933rem;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.btn:hover {
    background: var(--blu-scuro);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 72, 168, 0.25);
}

.btn:active { transform: translateY(0); box-shadow: none; }

.btn:focus-visible {
    outline: 2px solid var(--blu);
    outline-offset: 3px;
}

/* Ghost */
.btn-ghost {
    background: var(--card);
    color: var(--testo-soft);
    border: 1px solid var(--bordo);
    box-shadow: var(--shadow-xs);
}
.btn-ghost:hover {
    background: var(--bg);
    color: var(--testo);
    border-color: #c0c8d8;
    box-shadow: var(--shadow-sm);
}

/* Danger */
.btn-danger {
    background: var(--err-fg);
}
.btn-danger:hover {
    background: #7a1818;
    box-shadow: 0 3px 10px rgba(154, 31, 31, 0.25);
}

/* Amber accent (secondario) */
.btn-amber {
    background: var(--ambra);
    color: #fff;
}
.btn-amber:hover {
    background: #b8853a;
    box-shadow: 0 3px 10px rgba(216, 160, 72, 0.3);
}

/* Size variants */
.btn-sm { padding: 7px 14px; font-size: 0.867rem; }
.btn-lg { padding: 14px 28px; font-size: 1.067rem; }

/* ================================================================
   HOME — AZIONI PRINCIPALI
   ================================================================ */
.home-hero {
    margin-bottom: 36px;
}

.home-hero h1 {
    font-size: 2rem;
    margin-bottom: 6px;
}

.home-hero p {
    color: var(--testo-soft);
    font-size: 1rem;
}

.home-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.home-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 28px;
    background: var(--card);
    border: 1px solid var(--bordo);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-decoration: none;
    color: var(--testo);
    transition: border-color var(--t-mid), transform var(--t-mid), box-shadow var(--t-mid);
    position: relative;
    overflow: hidden;
}

/* Barra colorata in alto */
.home-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--blu);
    opacity: 0;
    transition: opacity var(--t-mid);
}

.home-card:hover::before { opacity: 1; }

.home-card:hover {
    border-color: var(--blu);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.home-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--blu-chiaro);
    margin-bottom: 16px;
    font-size: 1.5rem;
    transition: background var(--t-mid);
}

.home-card:hover .home-card-icon {
    background: var(--blu);
}

/* Icona SVG dentro il box */
.home-card-icon svg {
    width: 26px;
    height: 26px;
    fill: var(--blu);
    transition: fill var(--t-mid);
}
.home-card:hover .home-card-icon svg { fill: #fff; }

.home-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--testo);
    letter-spacing: -0.01em;
}

.home-card-desc {
    font-size: 0.9rem;
    color: var(--testo-soft);
    line-height: 1.5;
}

/* Freccia decorativa */
.home-card-arrow {
    position: absolute;
    right: 24px;
    bottom: 24px;
    color: var(--bordo);
    font-size: 1.3rem;
    transition: color var(--t-mid), transform var(--t-mid);
}
.home-card:hover .home-card-arrow {
    color: var(--blu);
    transform: translate(3px, -3px);
}

/* ================================================================
   FORM
   ================================================================ */
.form-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--testo-muted);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--bordo);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--testo-soft);
    margin-bottom: 7px;
}

.form-row label .req {
    color: var(--blu);
    font-weight: 700;
    line-height: 1;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    background: var(--card);
    font-family: var(--font);
    font-size: 0.967rem;
    color: var(--testo);
    line-height: 1.5;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
    -webkit-appearance: none;
    appearance: none;
}

.form-row select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23484848' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-row textarea {
    resize: vertical;
    min-height: 110px;
}

.form-row input:hover,
.form-row select:hover,
.form-row textarea:hover {
    border-color: #c0c8d8;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--blu);
    box-shadow: 0 0 0 3px rgba(0, 72, 168, 0.12);
    background: var(--card);
}

.form-row input::placeholder,
.form-row textarea::placeholder {
    color: #B0B8C8;
}

/* Hint sotto campo */
.form-hint {
    font-size: 0.8rem;
    color: var(--testo-muted);
    margin-top: 5px;
}

/* Form actions */
.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--bordo);
}

/* Errori form */
.errors-box {
    background: var(--err-bg);
    border: 1px solid var(--err-bordo);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 24px;
}

.errors-box strong {
    display: block;
    font-size: 0.867rem;
    font-weight: 700;
    color: var(--err-fg);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.errors-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.errors-list li {
    font-size: 0.9rem;
    color: var(--err-fg);
    padding: 3px 0 3px 16px;
    position: relative;
}

.errors-list li::before {
    content: '›';
    position: absolute;
    left: 4px;
    color: var(--err-fg);
    font-weight: 700;
}

/* ================================================================
   LISTA CLIENTI
   ================================================================ */
/* Barra di ricerca */
.search-wrap {
    position: relative;
    margin-bottom: 20px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--testo-muted);
    font-size: 1.1rem;
}

.search-box {
    width: 100%;
    padding: 12px 16px 12px 42px;
    font-family: var(--font);
    font-size: 1rem;
    border: 2px solid var(--blu);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--testo);
    box-shadow: 0 0 0 0 rgba(0, 72, 168, 0);
    transition: box-shadow var(--t-mid);
    -webkit-appearance: none;
    appearance: none;
}

.search-box:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 72, 168, 0.1);
}

.search-box::placeholder { color: #B0B8C8; }

/* Contatore risultati */
.list-meta {
    font-size: 0.867rem;
    color: var(--testo-muted);
    margin-bottom: 12px;
}

/* Lista */
.customer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--card);
    border: 1px solid var(--bordo);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.customer-list li {
    border-bottom: 1px solid var(--bordo);
}

.customer-list li:last-child { border-bottom: none; }

.customer-list a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--testo);
    transition: background var(--t-fast);
    gap: 0;
}

.customer-list a:hover {
    background: var(--bg);
}

.customer-list a:focus-visible {
    outline: 2px solid var(--blu);
    outline-offset: -2px;
}

/* Iniziale avatar */
.list-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--blu-chiaro);
    color: var(--blu);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 14px;
    letter-spacing: -0.02em;
}

.list-info { flex: 1; min-width: 0; }

.list-nome {
    font-weight: 600;
    font-size: 0.967rem;
    color: var(--testo);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-meta-row {
    display: flex;
    gap: 12px;
    margin-top: 2px;
    font-size: 0.833rem;
    color: var(--testo-muted);
}

.list-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.list-gestore-badge {
    flex-shrink: 0;
    font-size: 0.767rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--ambra-chiaro);
    color: var(--warn-fg);
    margin-left: auto;
    white-space: nowrap;
}

.list-arrow {
    color: var(--bordo);
    margin-left: 12px;
    font-size: 1rem;
    flex-shrink: 0;
    transition: color var(--t-fast), transform var(--t-fast);
}

.customer-list a:hover .list-arrow {
    color: var(--blu);
    transform: translateX(3px);
}

/* Stato vuoto */
.empty-state {
    text-align: center;
    padding: 56px 24px;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.25;
}

.empty-state p {
    color: var(--testo-soft);
    margin-bottom: 20px;
}

#no-results {
    padding: 24px;
    text-align: center;
    color: var(--testo-soft);
    font-size: 0.933rem;
}

/* ================================================================
   SCHEDA CLIENTE (DETAIL)
   ================================================================ */
.detail-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.detail-avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--blu-chiaro);
    color: var(--blu);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(0, 72, 168, 0.15);
}

.detail-title-area h1 { margin-bottom: 2px; }

.detail-subtitle {
    font-size: 0.867rem;
    color: var(--testo-muted);
}

/* Griglia campi */
.detail-grid {
    display: flex;
    flex-direction: column;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--bordo);
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
    width: 130px;
    flex-shrink: 0;
    font-size: 0.833rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--testo-muted);
}

.detail-value {
    flex: 1;
    font-size: 0.967rem;
    color: var(--testo);
    word-break: break-word;
    min-width: 0;
}

.detail-value.is-empty {
    color: var(--testo-muted);
    font-style: italic;
}

.detail-value.is-note {
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Tasto copia */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border: 1px solid var(--bordo);
    background: var(--card);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--testo-soft);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--blu-chiaro);
    color: var(--blu);
    border-color: rgba(0, 72, 168, 0.3);
}

.copy-btn:focus-visible {
    outline: 2px solid var(--blu);
    outline-offset: 2px;
}

.copy-btn.copied {
    background: var(--ok-bg);
    border-color: var(--ok-bordo);
    color: var(--ok-fg);
}

/* Azioni scheda */
.detail-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    flex-wrap: wrap;
}

/* Link indietro */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: 0.867rem;
    font-weight: 500;
    color: var(--testo-muted);
    margin-bottom: 16px;
    transition: color var(--t-fast);
}
.back-link:hover { color: var(--blu); }

/* ================================================================
   LOGIN / INSTALL (pagine bare)
   ================================================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
    /* Leggero motivo geometrico */
    background-image:
        radial-gradient(circle at 20% 80%, rgba(0, 72, 168, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(216, 160, 72, 0.04) 0%, transparent 50%);
}

.auth-box {
    width: 100%;
    max-width: 400px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.auth-brand-logo {
    height: 52px;
    width: auto;
    margin: 0 auto 10px;
    object-fit: contain;
}

.auth-brand-name {
    font-size: 0.867rem;
    font-weight: 600;
    color: var(--testo-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.auth-card {
    background: var(--card);
    border: 1px solid var(--bordo);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px 32px 28px;
}

.auth-card h1 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--testo-muted);
}

/* ================================================================
   BADGE / PILLOLE
   ================================================================ */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.767rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.badge-blu  { background: var(--blu-chiaro); color: var(--blu); }
.badge-ok   { background: var(--ok-bg);      color: var(--ok-fg); }
.badge-warn { background: var(--ambra-chiaro); color: var(--warn-fg); }

/* ================================================================
   BREADCRUMB / SOTTOTITOLO PAGINA
   ================================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.833rem;
    color: var(--testo-muted);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--testo-muted);
    text-decoration: none;
    transition: color var(--t-fast);
}
.breadcrumb a:hover { color: var(--blu); }

.breadcrumb-sep { color: var(--bordo); }

.breadcrumb-current {
    color: var(--testo-soft);
    font-weight: 500;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 680px) {
    :root { --topbar-h: 56px; }

    .topbar {
        padding: 0 16px;
        gap: 0;
    }

    .topbar-sep { display: none; }

    .brand { margin-right: 0; }

    .brand-logo { height: 30px; }

    .topnav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--card);
        border-top: 1px solid var(--bordo);
        padding: 6px 12px;
        justify-content: space-around;
        gap: 0;
        z-index: 200;
        box-shadow: 0 -2px 10px rgba(0,30,70,0.08);
    }

    .topnav a {
        flex-direction: column;
        padding: 6px 10px;
        font-size: 0.72rem;
        gap: 2px;
    }

    .nav-icon { font-size: 1.2rem !important; }

    .content { padding: 20px 16px 80px; }

    .home-actions { grid-template-columns: 1fr; }

    .form-grid-2 { grid-template-columns: 1fr; }

    .card { padding: 20px 18px; }

    .detail-label { width: 100px; font-size: 0.767rem; }

    .detail-avatar { width: 48px; height: 48px; font-size: 1.2rem; }

    .topbar-user { display: none; }

    h1 { font-size: 1.35rem; }

    .auth-card { padding: 24px 20px; }
}

@media (max-width: 420px) {
    .detail-row { flex-wrap: wrap; }
    .detail-label { width: 100%; margin-bottom: 4px; }
    .detail-value { width: 100%; }
}

/* ================================================================
   UTILITIES
   ================================================================ */
.text-muted { color: var(--testo-muted); }
.text-blue  { color: var(--blu); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }

/* Nasconde un elemento (sostituisce gli inline style="display:none",
   così la CSP può usare style-src 'self' senza 'unsafe-inline'). */
.is-hidden { display: none !important; }

/* Header della lista clienti: titolo + bottone inserisci. */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.list-header h1 { margin-bottom: 0; }

/* Lista puntata senza margini (box errori install). */
.plain-list { margin: 0; padding: 0; list-style: disc inside; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}
