/* =====================================================
   SB UTENTI (pagina SbUtenti.aspx)
   ===================================================== */
.sb-box {
    max-width: 1200px;
    margin: 20px auto;
    padding: 14px;
    font-family: Arial;
}

.sb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.sb-title {
    margin: 0;
}

.sb-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 12px;
}

.sb-field-wide {
    min-width: 320px;
    flex: 1;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}

    .field label {
        font-size: 12px;
        opacity: .8;
    }

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sep {
    height: 1px;
    background: #ddd;
    margin: 14px 0;
}

.small {
    font-size: 12px;
    opacity: .8;
}

.grid {
    overflow-x: auto;
}

.sb-btn {
    border: 0;
    padding: 10px 12px;
    border-radius: 6px;
    background: #1f3b57;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

    .sb-btn:hover {
        background: #244766;
    }

    .sb-btn.secondary {
        background: #6c757d;
    }

        .sb-btn.secondary:hover {
            background: #5c636a;
        }

.sb-linkbtn {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    background: #eef2f6;
    color: #1f3b57;
    margin-right: 6px;
}

    .sb-linkbtn:hover {
        background: #e2e8f0;
    }

    .sb-linkbtn.danger {
        background: #fff2f2;
        color: #7a1f1f;
    }

        .sb-linkbtn.danger:hover {
            background: #ffe3e3;
        }

/* Messaggi coerenti con quelli già usati */
.msg {
    margin: 10px 0;
    padding: 10px;
    background: #f6f6f6;
    border: 1px solid #ddd;
}

    .msg.err {
        background: #fff2f2;
        border-color: #f1b0b7;
    }

    .msg.ok {
        background: #f2fff5;
        border-color: #b7f1c2;
    }

/* =====================================================
   MODAL (senza dipendenze esterne)
   ===================================================== */
.sb-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.sb-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
}

.sb-modal-dialog {
    position: relative;
    margin: 60px auto;
    width: min(720px, calc(100% - 24px));
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    overflow: hidden;
}

.sb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #1f3b57;
    color: #fff;
}

.sb-modal-title {
    font-size: 16px;
}

.sb-modal-x {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.sb-modal-body {
    padding: 14px;
}

.sb-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid #e5e5e5;
}

/* Input coerenti con il resto */
.sb-modal input[type=text],
.sb-modal input[type=password],
.sb-modal select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d6d6d6;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
}
/* =====================================================
   SB - UTENTI (GRID + MODAL)
   ===================================================== */
.sb-page {
    max-width: 1200px;
    margin: 20px auto;
    padding: 14px;
}

.sb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.sb-title {
    margin: 0;
    font-size: 22px;
    color: #1f3b57;
}

.sb-section-title {
    margin: 14px 0 10px;
    font-size: 16px;
    color: #1f3b57;
}

.sb-btn {
    border: 1px solid #cfd6dd;
    background: #fff;
    color: #1f3b57;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.sb-btn-primary {
    border-color: #1f3b57;
    background: #1f3b57;
    color: #fff;
}

.sb-msg {
    margin: 10px 0;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #f6f6f6;
}

.sb-msg-err {
    background: #fff2f2;
    border-color: #f1b0b7;
}

.sb-msg-ok {
    background: #f2fff5;
    border-color: #b7f1c2;
}

.sb-grid {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
}

    .sb-grid th, .sb-grid td {
        padding: 10px 12px;
        border-bottom: 1px solid #edf0f3;
        text-align: left;
        vertical-align: middle;
    }

    .sb-grid th {
        background: #f7f9fb;
        color: #1f3b57;
        font-size: 13px;
    }

.sb-link {
    color: #1f3b57;
    text-decoration: underline;
    cursor: pointer;
}

.sb-link-danger {
    color: #b00020;
}

.sb-action-sep {
    margin: 0 8px;
    color: #9aa4ad;
}

/* MODAL */
.sb-modal {
    display: none;
}

    .sb-modal.is-open {
        display: block;
    }

.sb-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9998;
}

.sb-modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: min(680px, calc(100vw - 24px));
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.25);
    z-index: 9999;
}

.sb-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #edf0f3;
    background: #f5f6f7;
}

.sb-modal-title {
    font-size: 16px;
    color: #1f3b57;
}

.sb-modal-x {
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #1f3b57;
}

.sb-modal-body {
    padding: 16px;
}

.sb-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sb-field label {
    display: block;
    font-size: 12px;
    color: #1f3b57;
    margin-bottom: 6px;
    opacity: .9;
}

.sb-field input[type=text],
.sb-field input[type=password],
.sb-field select {
    width: 100%;
    max-width: none;
}

.sb-field-span {
    grid-column: 1 / -1;
}

.sb-help {
    font-size: 12px;
    color: #66707a;
    margin-top: 6px;
}

.sb-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #edf0f3;
}

img.logo-screenbox {
    height: 32px !important;
    width: auto !important;
    max-height: 32px !important;
    display: block;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px; /* adegua se la tua barra è diversa */
    white-space: nowrap; /* evita l'andare a capo */
}

.topbar-left {
    display: flex;
    align-items: center;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px; /* spazio tra nome utente e "Esci" */
}

/* opzionale: evita che il nome utente vada a capo da solo */
.topbar-user {
    white-space: nowrap;
}

.grid-icon {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    cursor: pointer;
    vertical-align: middle;
}

    .grid-icon:hover {
        opacity: 0.8;
    }

/* --- Pulsante PRIMARIO (Conferma / Salva) --- */
.sb-btn-primary {
    background: #1f3b57;
    color: #ffffff !important;
    border: 1px solid #1f3b57;
}

    .sb-btn-primary:hover,
    .sb-btn-primary:focus {
        background: #244766;
        color: #ffffff !important;
    }

/* --- Pulsante SECONDARIO (Annulla) --- */
.sb-modal .sb-btn:not(.sb-btn-primary) {
    background: #ffffff;
    color: #1f3b57;
    border: 1px solid #cfd6dd;
}

    .sb-modal .sb-btn:not(.sb-btn-primary):hover,
    .sb-modal .sb-btn:not(.sb-btn-primary):focus {
        background: #244766;
        color: #ffffff !important;
    }