body {
    font-family: Arial, sans-serif;
    background-color: #2e2e2e;
    color: #f0f0f0;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px; /* ### MODIFICAÇÃO 2: Aumentado para acomodar a nova tabela */
    margin: 0 auto;
    background-color: #3c3c3c;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

h1, h2 {
    color: #4CAF50;
    text-align: center;
    margin-bottom: 20px;
}

h2 {
    font-size: 1.8em;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    margin-top: 30px;
}

p.logged-in-as {
    text-align: right;
    margin-bottom: 20px;
    color: #bbb;
}

.logout-link {
    color: #EF5350;
    text-decoration: none;
    font-weight: bold;
}

.logout-link:hover {
    text-decoration: underline;
}

/* Flash Messages */
.flashes {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.flashes li {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-weight: bold;
    text-align: center;
}

.flashes .error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flashes .success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flashes .info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Forms */
.section {
    background-color: #4a4a4a;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 25px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #ccc;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select {
    width: 100%; /* ### MODIFICAÇÃO 2: Ajustado para 100% e usando box-sizing */
    padding: 10px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #333;
    color: #f0f0f0;
    font-size: 1em;
    box-sizing: border-box;
}

.form-group small {
    display: block;
    color: #aaa;
    font-size: 0.8em;
    margin-top: 5px;
}

/* Buttons */
.button-primary, .button-secondary, .button-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s;
}

.button-primary {
    background-color: #4CAF50;
    color: white;
    margin-top: 15px;
    width: 100%;
}

.button-primary:hover {
    background-color: #45a049;
}

.button-secondary {
    background-color: #2196F3;
    color: white;
}

.button-secondary:hover {
    background-color: #1976D2;
}

.button-danger {
    background-color: #EF5350;
    color: white;
}

.button-danger:hover {
    background-color: #D32F2F;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.inline-form input[type="password"],
.inline-form input[type="text"],
.inline-form select {
    flex-grow: 1;
    padding: 8px;
    font-size: 0.9em;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #333;
    color: #f0f0f0;
}

.inline-form .button-secondary,
.inline-form .button-danger {
    flex-shrink: 0;
    width: auto;
    padding: 8px 15px;
}


/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.95em;
    table-layout: fixed;
}

table, th, td {
    border: 1px solid #555;
    color: #f0f0f0;
}

th, td {
    padding: 10px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}

th {
    background-color: #3a3a3a;
    color: #ccc;
}

tbody tr:nth-child(even) {
    background-color: #444;
}

tbody tr:nth-child(odd) {
    background-color: #4a4a4a;
}

.user-actions-cell {
    white-space: normal;
}


/* ### MODIFICAÇÃO 2: Larguras de coluna ajustadas para a nova tabela */
table th:nth-child(1), table td:nth-child(1) { width: 20%; } /* Nome */
table th:nth-child(2), table td:nth-child(2) { width: 25%; } /* Email / Telefone */
table th:nth-child(3), table td:nth-child(3) { width: 15%; } /* Expira Em / Papel */
table th:nth-child(4), table td:nth-child(4) { width: 40%; } /* Ações */


/* Login page specific styles */
.login-body {
    background-color: #2e2e2e;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 0;
}

.login-container {
    background-color: #3c3c3c;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.status-expired {
    color: #EF5350;
    font-weight: bold;
    margin-left: 5px;
    font-size: 0.9em;
}


/* Media Queries for responsiveness */
@media (max-width: 900px) { /* ### MODIFICAÇÃO 2: Ponto de quebra ajustado */
    .inline-form {
        flex-wrap: wrap; /* Permite que os itens quebrem para a próxima linha */
    }
    .inline-form input, .inline-form select, .inline-form button {
        flex-basis: 100%; /* Cada item ocupa a linha inteira */
        margin-bottom: 5px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .container {
        padding: 15px;
    }

    h1, h2 {
        font-size: 1.5em;
    }

    .section {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 10px;
    }
    .login-container {
        padding: 25px;
    }
}