/* FICHEIRO: /css/style.css (Frontoffice) */

body, html {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
}

.container {
    max-width: 900px;
    margin: 30px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1, h2 {
    color: #1877f2; /* Azul Facebook */
    border-bottom: 2px solid #e7f3ff;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Component Selector */
.category-block {
    margin-bottom: 25px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    padding: 15px;
}

.category-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0 0 15px 0;
}

.component-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.component-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #ccd0d5;
    border-radius: 4px;
}

.component-item-info {
    flex-grow: 1;
}
.component-item-info .name {
    font-weight: 600;
}
.component-item-info .price {
    font-size: 0.9em;
    color: #606770;
}

/* Tabela de Configuração Atual */
#config-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
#config-table th, #config-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dddfe2;
}
#config-table th {
    background-color: #f5f6f7;
}
#config-table input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid #ccd0d5;
    border-radius: 3px;
    text-align: center;
}
#config-table tbody tr:last-child td {
    border-bottom: none;
}
.empty-config-message {
    text-align: center;
    padding: 20px;
    color: #606770;
}

/* Botões */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s, transform 0.1s;
    font-weight: bold;
    line-height: 20px;
}
.btn:active {
    transform: scale(0.98);
}
.btn-add {
    background-color: #e7f3ff;
    color: #1877f2;
}
.btn-add:hover {
    background-color: #dcebff;
}
.btn-remove {
    background-color: #fae0e0;
    color: #dd3c3c;
}
.btn-remove:hover {
    background-color: #f7d1d1;
}
.btn-primary {
    background-color: #1877f2;
    color: #fff;
    padding: 12px 24px;
    font-size: 1rem;
}
.btn-primary:hover {
    background-color: #166fe5;
}
.btn-secondary {
    background-color: #e4e6eb;
    color: #050505;
    padding: 12px 24px;
    font-size: 1rem;
}
.btn-secondary:hover {
    background-color: #dcdde1;
}

/* Secção de Totais */
.totals-section {
    margin-top: 30px;
    background-color: #f5f6f7;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    padding: 20px;
}
.totals-section .total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 1.1rem;
}
.totals-section .total-row:not(:last-child) {
    border-bottom: 1px solid #e4e6eb;
}
.totals-section .total-row.grand-total {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1877f2;
    margin-top: 10px;
}
.totals-section label {
    font-weight: bold;
}
.totals-section input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid #ccd0d5;
    border-radius: 4px;
    font-size: 1.1rem;
    text-align: right;
}

/* Formulário do Cliente */
#client-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}
#client-form .form-group {
    display: flex;
    flex-direction: column;
}
#client-form .form-group.full-width {
    grid-column: 1 / -1;
}
#client-form label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #606770;
}
#client-form input, #client-form textarea {
    padding: 10px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
}
#client-form .form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Mensagens de feedback */
#feedback-message {
    padding: 15px;
    margin: 20px 0;
    border-radius: 6px;
    display: none; /* Escondido por defeito */
    text-align: center;
}
#feedback-message.success {
    background-color: #e9f6ec;
    color: #1e6f34;
    display: block;
}
#feedback-message.error {
    background-color: #fdeeee;
    color: #b91c1c;
    display: block;
}