/* Base */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
}

header, footer {
    background-color: #555;
    color: #fff;
    text-align: center;
    padding: 1em 0;
}

header h1 {
    margin: 0;
}

main {
    padding: 20px;
}

/* Secções */
section {
    margin-bottom: 20px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h2 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Filtros */
#filters .filter-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    align-items: end;
}

#filters label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

#filters input[type="text"],
#filters input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

#filters button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    height: 38px;
}

#apply-filters {
    background-color: #007bff;
}
#apply-filters:hover {
    background-color: #0056b3;
}

#reset-filters {
    background-color: #6c757d;
}
#reset-filters:hover {
    background-color: #5a6268;
}

/* Tabela de stock */
#stock-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

#stock-table th,
#stock-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

#stock-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

#stock-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

#stock-table tbody tr:hover {
    background-color: #e9ecef;
}

/* Mensagem sem registos */
#no-records {
    color: #6c757d;
    font-style: italic;
}

/* Botões principais */
#actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#actions button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
}

#btn-add {
    background-color: #28a745;
}
#btn-add:hover {
    background-color: #218838;
}

#btn-remove {
    background-color: #dc3545;
}
#btn-remove:hover {
    background-color: #c82333;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.modal-content {
    background-color: white;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
}

.modal-content h2 {
    margin-top: 0;
}

.modal-content form label {
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: bold;
}

.modal-content form input[type="text"],
.modal-content form input[type="number"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

.modal-buttons button[type="submit"] {
    background-color: #28a745;
}
.modal-buttons button[type="submit"]:hover {
    background-color: #218838;
}

#btn-close-modal {
    background-color: #6c757d;
}
#btn-close-modal:hover {
    background-color: #5a6268;
}

.low-stock {
    background-color: #fff3cd !important; /* amarelo claro (Bootstrap warning) */
}

.admin-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease;
    z-index: 999;
}

.admin-button:hover {
    background-color: #0056b3;
}

