/* ==========================================================================
   FILE: /assets/css/layout_manage.css
   DESC: Stile globale protetto per i pannelli di gestione (Mondo e Moduli)
   ========================================================================== */

/* RESET E ISOLAMENTO STRUTTURALE 
   Applica un font e un box-sizing standard per prevenire rotture causate dai CSS della land */
.manage-container-isolated {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    box-sizing: border-box;
    width: 100%;
}

.manage-container-isolated *, 
.manage-container-isolated *::before, 
.manage-container-isolated *::after {
    box-sizing: inherit;
}

/* TITOLI E LINK DI RITORNO */
.manage-container-isolated h1 {
    margin-bottom: 5px;
}

.manage-container-isolated .back-link {
    display: inline-block;
    color: #3498db !important;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 15px;
}

.manage-container-isolated .back-link:hover {
    text-decoration: underline;
}

/* BANNER INFORMATIVO DI DESCRIZIONE (DARK) */
.manage-container-isolated .page-description-banner-custom {
    background: #1e1e24 !important;
    border: 1px solid #3a3a45 !important;
    border-radius: 8px;
    padding: 15px;
    color: #e0e0e6 !important;
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* NOTIFICHE E AVVISI DI SISTEMA (ALTO CONTRASTO) */
.manage-container-isolated .msg-success-custom {
    background: #2ecc71 !important;
    color: #ffffff !important;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: bold;
}

.manage-container-isolated .msg-error-custom {
    background: #e74c3c !important;
    color: #ffffff !important;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: bold;
}

/* LAYOUT PRINCIPALE A DUE COLONNE */
.manage-container-isolated .manage-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    align-items: flex-start;
}

/* ==========================================================================
   PANNELLO CENTRALE MONDO: MENU LATERALE (SIDEBAR DARK)
   ========================================================================== */
.manage-container-isolated .manage-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #1e1e24 !important;
    border: 1px solid #3a3a45 !important;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-self: flex-start;
    color: white;
}

.manage-container-isolated .manage-sidebar span {
    color: #a0a0b0 !important;
}

.manage-container-isolated .role-badge {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    background: #d4af37 !important;
    color: #000000 !important;
    font-weight: bold;
    text-align: center;
    font-size: 0.95em;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.manage-container-isolated .sidebar-note {
    background: rgba(255, 255, 255, 0.05) !important;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.85em;
    color: color !important;
    line-height: 1.4;
    border-left: 4px solid #555 !important;
}

.manage-container-isolated .sidebar-note strong {
    color: #ffffff !important;
    display: inline-block;
    margin-bottom: 3px;
}

/* ==========================================================================
   PANNELLO CENTRALE MONDO: CONTENITORE GRIGLIE (MAIN CONTENT)
   ========================================================================== */
.manage-container-isolated .manage-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* BLOCCHI CONTENITORI (LIGHT BACKGROUND PER LEGGIBILITÀ) */
.manage-container-isolated .manage-section,
.manage-container-isolated .editor-box,
.manage-container-isolated .list-box {
    background: #ffffff !important;
    border: 1px solid #dcdce6 !important;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.manage-container-isolated .manage-section h3,
.manage-container-isolated .editor-box h3,
.manage-container-isolated .list-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.05em;
    text-transform: uppercase;
    color: #1a1a24 !important;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #eaeaea !important;
    padding-bottom: 8px;
}

/* GRIGLIA CARD COMANDO */
.manage-container-isolated .manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

/* CARD LINK */
.manage-container-isolated .manage-card {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #f4f4f9 !important;
    border: 1px solid #e2e2ed !important;
    border-radius: 6px;
    color: #2e2e3a !important;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
    font-size: 0.9em;
    line-height: 1.2;
}

/* HOVER CARD */
.manage-container-isolated .manage-card:hover {
    background: #2a2a35 !important;
    border-color: #1a1a24 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.manage-container-isolated .manage-card span {
    margin-right: 12px;
    font-size: 1.3em;
    flex-shrink: 0;
}

/* ==========================================================================
   PAGINE MODULI INTERNI: COMPONENTI DI EDITING (FORM & LISTE)
   ========================================================================== */
.manage-container-isolated .editor-box {
    flex: 1.2;
}

.manage-container-isolated .list-box {
    flex: 0.8;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* INPUT FIELDS & TEXTAREAS & SELECTS */
.manage-container-isolated .form-row-custom {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.manage-container-isolated .form-row-custom label {
    color: #2e2e3a !important;
    font-weight: 600;
    font-size: 0.9em;
}

/* Forzatura assoluta di Sfondo Bianco e Testo Nero per tutti i campi compilabili */
.manage-container-isolated .form-row-custom input[type="text"],
.manage-container-isolated .form-row-custom input[type="number"],
.manage-container-isolated .form-row-custom input[type="datetime-local"],
.manage-container-isolated .form-row-custom textarea,
.manage-container-isolated select,
.manage-container-isolated input {
    width: 100%;
    padding: 10px;
    border: 1px solid #cccccc !important;
    border-radius: 4px;
    background: #ffffff !important; /* Sfondo forzato bianco */
    color: #000000 !important;      /* Testo forzato nero */
    font-size: 0.9em;
    font-family: inherit;
}

/* Protezione specifica per i menu a tendina e i loro elementi di opzione */
.manage-container-isolated select,
.manage-container-isolated select option {
    background-color: #ffffff !important; /* Forza sfondo dropdown bianco */
    color: #000000 !important;            /* Forza testo dropdown nero */
}

.manage-container-isolated .form-row-custom input:focus,
.manage-container-isolated .form-row-custom textarea:focus,
.manage-container-isolated select:focus {
    border-color: #2a2a35 !important;
    background: #ffffff !important;
    outline: none;
}

/* BOTTONI DI AZIONE GENERICA */
.manage-container-isolated .btn-action-custom {
    background: #2a2a35 !important;
    color: #ffffff !important;
    border: 1px solid #1a1a24 !important;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.15s;
}

.manage-container-isolated .btn-action-custom:hover {
    background: #444454 !important;
}

.manage-container-isolated .link-cancel-custom {
    color: #e74c3c !important;
    text-decoration: none;
    margin-left: 15px;
    font-size: 0.9em;
    font-weight: 600;
}

.manage-container-isolated .link-cancel-custom:hover {
    text-decoration: underline;
}

/* ELEMENTI DELLE LISTE DI GESTIONE (Es. Capitoli, Razze, Oggetti) */
.manage-container-isolated .ambient-list-item-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f4f4f9 !important;
    border: 1px solid #e2e2ed !important;
    border-radius: 6px;
    gap: 10px;
}

.manage-container-isolated .ambient-list-item-custom strong {
    color: #2e2e3a !important;
}

.manage-container-isolated .preview-box-empty-custom {
    width: 50px;
    height: 50px;
    background: #e2e2ed !important;
    border-radius: 4px;
}

/* AZIONI ALL'INTERNO DELLE LISTE (MODIFICA / ELIMINA) */
.manage-container-isolated .link-edit-custom {
    color: #e67e22 !important;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85em;
}

.manage-container-isolated .link-edit-custom:hover {
    text-decoration: underline;
}

.manage-container-isolated .btn-delete-custom {
    background: none !important;
    border: none !important;
    color: #e74c3c !important;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85em;
    padding: 0;
    font-family: inherit;
}

.manage-container-isolated .btn-delete-custom:hover {
    text-decoration: underline;
}