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

/* FUNDO GLOBAL */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background:
        linear-gradient(rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.75)),
        url("https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&w=1600&q=80");
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* LOGIN */
#login {
    width: 380px;
    padding: 40px;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(14px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
    text-align: center;
    color: white;
}

#login h2 {
    font-size: 28px;
    margin-bottom: 28px;
}

.campo {
    margin-bottom: 16px;
}

#login input {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 15px;
}

#login input::placeholder {
    color: #cbd5e1;
}

#login input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #22c55e;
}

#login button {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

#login button:first-of-type {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

#login button:last-of-type {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

#login button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.35);
}

/* APLICAÇÃO */
.container {
    width: 100%;
    max-width: 900px;
    background: rgba(15, 23, 42, 0.84);
    backdrop-filter: blur(14px);
    padding: 30px;
    border-radius: 22px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.55);
    color: white;
}

h1 {
    text-align: center;
    color: #f8fafc;
    margin-bottom: 22px;
    font-size: 32px;
}

.form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.form input,
.form select {
    flex: 1 1 160px;
    padding: 13px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 15px;
}

.form input::placeholder {
    color: #cbd5e1;
}

.form select option {
    color: #0f172a;
}

.form input:focus,
.form select:focus {
    outline: none;
    box-shadow: 0 0 0 2px #22c55e;
}

.form button {
    padding: 13px 18px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.35);
}

.saldo {
    text-align: center;
    margin: 20px 0;
    color: #f1f5f9;
}

.saldo h2 {
    font-size: 24px;
}

/* DASHBOARD */
.dashboard {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    margin-top: 20px;
}

canvas {
    width: 100% !important;
    max-width: 280px;
    height: 280px !important;
    display: block;
    margin: 0 auto;
}

.lista {
    flex: 1;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.lista h3 {
    margin-bottom: 12px;
    color: #f8fafc;
}

.lista ul {
    list-style: none;
    padding: 0;
}

.lista li {
    background: rgba(255, 255, 255, 0.10);
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lista button {
    background: #ef4444;
    border: none;
    padding: 7px 10px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
}

.lista button:hover {
    background: #dc2626;
}

/* RESPONSIVO */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
    }

    #login {
        width: 100%;
        max-width: 380px;
        margin-top: 40px;
    }

    .container {
        padding: 22px;
    }

    .dashboard {
        flex-direction: column;
        align-items: center;
    }

    canvas {
        max-width: 230px;
        height: 230px !important;
    }

    .lista {
        width: 100%;
    }
}
.ia-box {
    margin-top: 20px;
    background: rgba(15, 23, 42, 0.8);
    padding: 15px;
    border-radius: 10px;
}

.ia-box input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    border: none;
}

.ia-box button {
    padding: 10px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#respostaIA {
    margin-top: 10px;
    color: #f1f5f9;
}
/* Corrige tamanho do gráfico */
#grafico {
    width: 260px !important;
    height: 260px !important;
    max-width: 260px;
    max-height: 260px;
}

/* Mantém dashboard organizado */
.dashboard {
    display: grid;
    grid-template-columns: 280px 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Caixa da IA com rolagem */
.ia-box {
    max-height: 320px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.75);
    padding: 18px;
    border-radius: 14px;
}

/* Resposta da IA não estoura a tela */
#respostaIA {
    margin-top: 15px;
    max-height: 210px;
    overflow-y: auto;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Responsivo */
@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    #grafico {
        margin: 0 auto;
    }
}