* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%;
    height: 100vh !important;
    background: #222 !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    overflow: hidden !important;
    font-family: Arial, Helvetica, sans-serif;
}

/* Gabbia: non supera i 768px ma si adatta all'altezza reale del browser senza uscire dai bordi */
#frame-container {
    width: 1024px;
    height: min(768px, calc(100vh - 16px));
    flex: 0 0 auto;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,0,0,.6);
}

/* Top: sfondo solido a contrasto, ben staccato e mai tagliato */
#box-top {
    flex: 0 0 auto;
    background-color: #e2e8f0 !important;
    border-bottom: 2px solid #cbd5e1 !important;
    padding: 12px 20px !important;
}

/* Tipografia del top blindata contro i reset di Bulma */
#box-top h1 {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    line-height: 1.2 !important;
    margin: 0 0 4px 0 !important;
}

#box-top p {
    font-size: 12px !important;
    color: #475569 !important;
    line-height: 1.3 !important;
    margin: 0 !important;
}

#box-top a {
    color: #0284c7 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

#box-top a:hover {
    color: #0369a1 !important;
    text-decoration: underline !important;
}

/* Corpo centrale */
#box-middle {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    min-height: 0;
    overflow: hidden;
}

/* Area contenuti con scroll indipendente */
#area-pagina {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    padding: 20px 25px;
    color: #222;
}

/* Menu fisso compresso */
#box-menu {
    width: 200px;
    flex: 0 0 200px;
    height: 100%;
    overflow-y: auto;
    background: #f8fafc;
    border-left: 1px solid #cbd5e1;
    padding: 8px 6px;
}

#box-menu ul { list-style: none !important; margin: 0 !important; padding: 0 !important; }
#box-menu li { margin: 0 0 2px 0 !important; padding: 0 !important; }
#box-menu a {
    display: block;
    padding: 3px 8px;
    border-radius: 3px;
    color: #334155;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 500;
    text-decoration: none !important;
}
#box-menu a:hover {
    background: #0284c7;
    color: #fff !important;
}

/* Bottom fisso */
#box-bottom {
    flex: 0 0 auto;
    background-color: #f1f5f9;
    border-top: 1px solid #cbd5e1;
    padding: 8px 20px;
    font-size: 12px;
    color: #64748b;
}

#box-bottom a { color: #0284c7; text-decoration: none; }
#box-bottom a:hover { text-decoration: underline; }
