/*
 * Gestione modifica nomi strutture magazzini.
 * Stili condivisi per le tabelle di modifica nomi (scaffali/file/piani)
 * e per i checkbox delle opzioni, usati da mappaMagazzino,
 * gestioneMagazzino e clonaMagazzinoFisico.
 */

.custom-names-body {
    max-height: 60vh;
    overflow-y: auto;
}

.custom-names-title {
    margin: 18px 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #2c3e50;
    border-left: 4px solid #337ab7;
    padding-left: 8px;
}

.custom-names-title:first-child {
    margin-top: 0;
}

.custom-names-count {
    color: #95a5a6;
    font-weight: 600;
    font-size: 13px;
}

.custom-names-table {
    margin-bottom: 6px;
    background-color: #fff;
}

.custom-names-table > thead > tr > th {
    background-color: #f2f6fa;
    color: #2c3e50;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
    border-bottom: 2px solid #d6e0ea;
    padding: 8px 12px;
}

.custom-names-table > tbody > tr > td {
    vertical-align: middle;
    padding: 5px 12px;
}

.custom-names-table > tbody > tr:nth-child(odd) {
    background-color: #fafbfc;
}

.custom-names-table > tbody > tr:hover {
    background-color: #eef4fb;
}

.custom-names-table .cn-col-prog {
    width: 90px;
    text-align: center;
}

.custom-names-table .cn-col-nome {
    width: 30%;
}

.custom-names-table .cn-prog-cell {
    font-weight: 600;
    color: #34495e;
}

.custom-names-table .form-control {
    height: 30px;
    font-size: 13px;
}

/* Nome mancante o duplicato nella sezione */
.custom-names-table .form-control.cn-invalid {
    border-color: #c0392b;
    background-color: #fdecea;
    box-shadow: none;
}

.custom-names-table .form-control.cn-invalid:focus {
    border-color: #c0392b;
    box-shadow: 0 0 4px rgba(192, 57, 43, 0.6);
}

/* ---- Modale a tab annidati: scaffale > fila > piano > cella ---- */
.nu-tabs-root {
    font-size: 13px;
}

.nu-tabs-root .nu-nav {
    margin-bottom: 0;
    flex-wrap: wrap;
}

.nu-tabs-root .nu-nav > li > a {
    padding: 5px 12px;
    font-size: 12px;
    color: #34546f;
    border-radius: 4px 4px 0 0;
}

.nu-tabs-root .nu-nav > li > a:hover {
    background: #eaf2fb;
    border-color: #cfe0f2 #cfe0f2 #ddd;
    color: #1f3a54;
}

/* Tab attivo ben visibile (blu) a ogni livello */
.nu-tabs-root .nu-nav > li.active > a,
.nu-tabs-root .nu-nav > li.active > a:hover,
.nu-tabs-root .nu-nav > li.active > a:focus {
    background: #337ab7;
    border-color: #2e6da4;
    color: #ffffff;
    font-weight: 600;
}

/* Breadcrumb del percorso ubicazione */
.nu-breadcrumb {
    margin-bottom: 10px;
    padding: 7px 12px;
    background: #eef4fb;
    border: 1px solid #d6e0ea;
    border-radius: 6px;
    font-size: 13px;
    color: #1f3a54;
}

.nu-breadcrumb .nu-bc-label {
    font-weight: 700;
    color: #34546f;
    margin-right: 4px;
}

.nu-breadcrumb .nu-bc-sep {
    color: #5b7fa6;
    margin: 0 6px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    vertical-align: -1px;
}

.nu-tab-content {
    border: 1px solid #ddd;
    border-top: 0;
    padding: 12px;
    background: #fff;
}

/* Ogni livello annidato conserva la larghezza del livello radice e cambia
   sfondo per dare profondita'. */
.nu-subtabs {
    margin-top: 12px;
    margin-left: -12px;
    margin-right: -12px;
    margin-bottom: -12px;
}

.nu-subtabs > .nu-tab-content {
    background: #fafbfc;
}

.nu-subtabs .nu-subtabs > .nu-tab-content {
    background: #f4f7fa;
}

/* Campi nome/descrizione affiancati */
.nu-fields {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nu-fields .nu-field {
    flex: 1 1 220px;
    margin-bottom: 6px;
}

.nu-fields .nu-field label {
    font-size: 12px;
    font-weight: 600;
    color: #29445f;
    margin-bottom: 3px;
}

/* Separatore tra i campi del piano e quelli della cella (1 cella per piano) */
.nu-cella-sep {
    margin: 12px 0;
    border: 0;
    border-top: 1px solid #cfdae6;
}

.nu-cella {
    margin-top: 0;
}

/* Campo con nome mancante o duplicato (vale anche fuori dalle tabelle) */
.form-control.cn-invalid {
    border-color: #c0392b;
    background-color: #fdecea;
    box-shadow: none;
}

.form-control.cn-invalid:focus {
    border-color: #c0392b;
    box-shadow: 0 0 4px rgba(192, 57, 43, 0.6);
}

/* Checkbox opzioni "gestione nomi" */

/* Etichetta invisibile che replica quella del campo affiancato:
   mantiene il checkbox allineato al controllo sulla stessa riga. */
.nu-spacer-label {
    display: block;
    visibility: hidden;
    margin-bottom: 5px;
}

.nu-check-row {
    min-height: 34px;
    display: flex;
    align-items: center;
}

.nu-check-row > label {
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

.nu-check-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0 8px 0 0;
    cursor: pointer;
}

.nu-check-row a {
    margin-left: 5px;
}
