/* Fundo preto #000 rigoroso para alívio extremo da visão */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #000000;
    color: #e0e0e0;
    margin: 0;
    padding: 20px;
}
.container {
    max-width: 950px;
    margin: 0 auto;
}
h2, h3, h4 {
    text-align: center;
    color: #ffffff;
    margin-top: 0;
}
.subtitle {
    text-align: center;
    font-size: 13px;
    color: #888888;
    margin-bottom: 20px;
}

/* Cartões rebaixados ao máximo, absorvendo luz em vez de refletir */
.card {
    background: #050505;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,1);
    border: 1px solid #141414;
    margin-bottom: 25px;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.form-group {
    display: flex;
    flex-direction: column;
}
.full-width {
    grid-column: 1 / -1;
}
label {
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
    color: #909090;
}

/* Campos de preenchimento suavizados */
input[type="text"], input[type="password"], input[type="email"], select, textarea {
    width: 100%;
    padding: 8px 12px;
    background-color: #0f0f0f;
    color: #ffffff;
    border: 1px solid #222222;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.3s;
}
input:focus, select:focus, textarea:focus {
    border-color: #25D366;
    background-color: #151515;
    outline: none;
}
::placeholder {
    color: #444444;
}
.button-center {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Botões base do sistema */
button, .btn-info {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    font-size: 14px;
    transition: filter 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
button:hover, .btn-info:hover { filter: brightness(1.2); }
button:active { transform: scale(0.98); }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-primary { background-color: #17823f; color: #ffffff; }
.btn-success { background-color: #125e3a; }
.btn-warning { background-color: #b38600; color: #000000; }
.btn-info { background-color: #0a7d91; color: #ffffff; }
.btn-secondary { background-color: #1f1f1f; }
.btn-delete { background-color: #8c1e27; }

/* GRELHA EXATA DE 4 BOTÕES POR LINHA NOS ENVIOS RÁPIDOS */
.quick-buttons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}
.btn-quick { 
    background-color: #0d0d0d; 
    border: 1px solid #222222;
    color: #b0b0b0;
    width: 100%;
    height: 100%;
    padding: 12px;
}
.btn-quick:hover {
    background-color: #1a1a1a;
    border-color: #333333;
    color: #ffffff;
}

.template-box { 
    background: #080808; 
    border: 1px solid #141414; 
    padding: 20px; 
    border-radius: 8px; 
    margin-top: 20px; 
}
.btn-action { padding: 6px 10px; margin-right: 5px; font-size: 12px; border-radius: 4px; }
.btn-edit { background-color: #0947a6; } 

/* Tabela focada na legibilidade, sem bordas agressivas */
table { width: 100%; border-collapse: collapse; margin-top: 15px; min-width: 600px; font-size: 14px; }
table, th, td { border: 1px solid #161616; }
th, td { padding: 12px 15px; text-align: left; }
th { background-color: #080808; color: #c0c0c0; }
tr:nth-child(even) { background-color: #030303; }
hr { border: 0; height: 1px; background: #1a1a1a; margin: 25px 0; }

@media print { 
    .no-print { display: none !important; } 
    body { background: white; color: black; padding: 0; } 
    .card { background: white; box-shadow: none; border: none; padding: 0; } 
    table, th, td { border: 1px solid #ccc; color: black; }
    th { background-color: #f2f2f2; color: black; }
    tr:nth-child(even) { background-color: #fff; }
}

/* Responsividade: Reduz a quantidade de botões por linha em ecrãs menores */
@media (max-width: 900px) {
    .quick-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    body { padding: 10px; }
    .card { padding: 15px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
}
@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .button-center { flex-direction: column; width: 100%; gap: 8px; }
    .button-center button, .button-center .btn-info, .button-center label.btn-info { width: 100%; margin: 0; box-sizing: border-box; }
    .btn-action { display: block; width: 100%; margin-bottom: 5px; text-align: center; }
    table, th, td { font-size: 13px; padding: 8px; }
    .quick-buttons-grid {
        grid-template-columns: 1fr;
    }
}