body {
    background-color: rgb(32, 30, 76);
    color: rgb(219, 246, 246);
    font-family: "Elms Sans", sans-serif;
}

.titolo {
    margin-left: 5px;
}

.container {
    display: flex;
}

@keyframes lampeggioRosso {
    0% {
        background-color: transparent;
    }

    50% {
        background-color: rgba(220, 53, 69, 0.4);
    }

    100% {
        background-color: transparent;
    }
}

.riga-critica {
    animation: lampeggioRosso 2s infinite ease-in-out;
}

.sidebar {
    width: 200px;
    padding: 20px;
    background-color: rgba(219, 246, 246, 0.05);
    border-radius: 10px;
    margin-right: 20px;
}

.main-content {
    flex-grow: 1;
    padding: 20px;
    border: 2px solid rgb(219, 246, 246);
    border-radius: 10px;
    background-color: rgba(219, 246, 246, 0.02);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(219, 246, 246, 0.15);
}

th {
    font-weight: bold;
    color: rgb(219, 246, 246);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

tr:hover {
    background-color: rgba(219, 246, 246, 0.05);
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar button {
    background: transparent;
    border: 1px solid rgb(219, 246, 246);
    padding: 15px 65px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar button:hover {
    background-color: rgb(219, 246, 246);
}

.sidebar button a {
    color: rgb(219, 246, 246);
    text-decoration: none;
    font-weight: bold;
}

.sidebar button:hover a {
    color: rgb(32, 30, 76);
}

.ai-consultant-box {
    background-color: rgb(65, 54, 107);
    border-radius: 15px;
    padding-inline: 20px;
    padding-top: 1px;
    padding-bottom: 15px;
    margin-top: 15px;
}

.btn-analizza {
    background-color: rgb(237, 255, 255);
    border-radius: 10px;
    color: rgb(32, 30, 76);
    text-decoration: none;
    padding: 5px
}

.widget-grafico {
    margin-top: 30px;
    padding: 15px;
    background-color: rgba(219, 246, 246, 0.03);
    border: 1px solid rgba(219, 246, 246, 0.15);
    border-radius: 8px;
}

.widget-grafico h4 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: rgb(219, 246, 246);
    text-transform: uppercase;
}

.grafico-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 8px;
    color: rgba(219, 246, 246, 0.7);
}

.grafico-barra-sfondo {
    height: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.grafico-barra-riempimento {
    height: 100%;
    background-color: rgb(46, 196, 182);
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

.ai-prompt-area {
    margin-top: 30px;
    padding: 20px;
    background-color: rgba(219, 246, 246, 0.03);
    border: 1px solid rgba(219, 246, 246, 0.15);
    border-radius: 10px;
}

.ai-prompt-area h3 {
    margin-top: 0;
    color: rgb(219, 246, 246);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: rgba(219, 246, 246, 0.8);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(219, 246, 246, 0.3);
    border-radius: 5px;
    background-color: rgb(32, 30, 76);
    color: rgb(219, 246, 246);
    font-family: inherit;
    box-sizing: border-box;
}

.form-group textarea {
    height: 80px;
    resize: vertical;
}

.btn-invia {
    background-color: rgb(46, 196, 182);
    color: rgb(32, 30, 76);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-invia:hover {
    background-color: rgb(38, 166, 154);
}

.ai-response-box {
    margin-top: 20px;
    padding: 15px;
    background-color: rgb(65, 54, 107);
    border-radius: 8px;
    border-left: 4px solid rgb(46, 196, 182);
}

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: rgb(32, 30, 76);
}

.login-box {
    background-color: rgba(65, 54, 107, 0.65);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid rgba(219, 246, 246, 0.2);
    text-align: center;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    box-sizing: border-box;
}

.login-box h2 {
    margin-top: 0;
    color: rgb(219, 246, 246);
    font-size: 1.8rem;
}

.login-box p {
    color: rgba(219, 246, 246, 0.7);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.login-box input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid rgba(219, 246, 246, 0.25);
    background-color: rgba(32, 30, 76, 0.8);
    color: rgb(219, 246, 246);
    font-size: 1rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.login-box input[type="password"]:focus {
    border-color: rgb(46, 196, 182);
}

.login-box .btn-invia {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.errore {
    color: #ff4d4d;
    font-size: 0.9rem;
    margin-top: 10px;
}

.btn-logout {
    margin-top: 20px;
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgb(220, 53, 69);
    padding: 12px 20px;
    border-radius: 5px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-sizing: border-box;
}

.btn-logout:hover {
    background-color: rgb(220, 53, 69);
}

.btn-logout a {
    color: rgb(220, 53, 69);
    text-decoration: none;
    font-weight: bold;
    display: block;
    width: 100%;
}

.btn-logout:hover a {
    color: rgb(219, 246, 246);
}

.btn-pdf {
    display: inline-block;
    background-color: rgb(46, 196, 182);
    color: rgb(32, 30, 76);
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 15px;
    transition: background-color 0.2s ease;
}

.btn-pdf:hover {
    background-color: rgb(38, 166, 154);
}

/* Spinner caricamento AJAX */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(219, 246, 246, 0.2);
    border-top-color: rgb(46, 196, 182);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 10px auto 0;
}