/* ================================================= */
/* === ARQUIVO style.css COMPLETO E ATUALIZADO === */
/* ================================================= */

/* 1. Variáveis de Design e Reset Básico */
:root {
    --primary-color: #4a69bd; /* Um azul mais sofisticado */
    --primary-hover: #3b5496;
    --primary-color-rgb: 74, 105, 189;
    --secondary-color: #6a89cc;
    --background-color: #f4f7fa; /* Um cinza bem claro para o fundo */
    --surface-color: #ffffff;   /* Cor para cards, formulários, tabelas */
    --text-primary: #333333;
    --text-secondary: #777777;
    --border-color: #dde6e9;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --pending-color: #f39c12;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

h1, h2, h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; font-weight: 500; }

/* 2. Header e Navegação */
header {
    background-color: var(--surface-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 a {
    font-weight: 700;
    color: var(--primary-color);
}

header nav {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
}

header nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1rem;
}

header nav ul li a {
    display: block;
    padding: 0.7rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

header nav ul li a:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
}

header nav ul li a.active {
    background-color: var(--primary-color);
    color: white;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1.5rem;
}

.user-actions span {
    font-weight: 500;
    white-space: nowrap;
}

.btn-logout {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    background-color: #f8d7da;
    color: var(--error-color);
    font-weight: 500;
    border: 1px solid var(--error-color);
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: var(--error-color);
    color: white;
}

/* 3. Botões */
.btn, .btn-primary, .btn-danger, .btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.btn, .btn-primary { background-color: var(--primary-color); color: white; }
.btn:hover, .btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-danger { background-color: var(--error-color); color: white; }
.btn-danger:hover { background-color: #c0392b; transform: translateY(-2px); }
.btn-secondary { background-color: #bdc3c7; color: var(--text-primary); }
.btn-secondary:hover { background-color: #95a5a6; color: white; transform: translateY(-2px); }

/* 4. Formulários e Login */
.form-container, .login-container {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin: 2rem auto;
}
.login-container { max-width: 450px; }

.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.9rem; }

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 105, 189, 0.2);
}

/* 5. Tabelas */
.table-container { background-color: var(--surface-color); border-radius: 8px; box-shadow: var(--shadow-md); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 1rem 1.5rem; text-align: left; border-bottom: 1px solid var(--border-color); }
table th { background-color: #f8f9fa; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; color: var(--text-secondary); }
table tbody tr:hover { background-color: #f1f5f8; }
table tbody tr:last-child td { border-bottom: none; }
.status-pendente td:first-child { border-left: 4px solid var(--pending-color); }
.status-pendente strong { color: var(--pending-color); }
.status-entregue td:first-child { border-left: 4px solid var(--success-color); }
.status-entregue strong { color: var(--success-color); }

/* 6. Painel (Dashboard) */
.dashboard-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.summary-card { background-color: var(--surface-color); padding: 1.5rem; border-radius: 8px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 0.5rem; transition: all 0.2s ease; border-bottom: 4px solid transparent; }
.summary-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.summary-card h3 { font-size: 1rem; font-weight: 500; color: var(--text-secondary); margin: 0; }
.summary-card .count { font-size: 2.5rem; font-weight: 700; line-height: 1; }
.card-pendentes { border-color: var(--pending-color); }
.card-pendentes .count { color: var(--pending-color); }
.card-entregues { border-color: var(--success-color); }
.card-entregues .count { color: var(--success-color); }
.card-total { border-color: var(--secondary-color); }
.card-total .count { color: var(--secondary-color); }

/* 7. Alertas e Notificações */
.alert { padding: 1rem 1.5rem; margin-bottom: 1.5rem; border-radius: 6px; border: 1px solid transparent; font-weight: 500; }
.alert-success { background-color: #d4edda; border-color: #c3e6cb; color: #155724; }
.alert-error { background-color: #f8d7da; border-color: #f5c6cb; color: #721c24; }

/* 8. Footer */
footer { text-align: center; padding: 2rem; margin-top: 2rem; color: var(--text-secondary); font-size: 0.9rem; }

/* 9. Responsividade */
@media (max-width: 768px) {
    header .container { flex-direction: column; gap: 1rem; }
    header nav ul { flex-wrap: wrap; justify-content: center; gap: 1rem; }
    .form-container, .login-container { padding: 1.5rem; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.3rem; }
}

/* === SEÇÕES ADICIONADAS RECENTEMENTE === */

/* Ajuste no tamanho do logo no cabeçalho */
header h1 {
    font-size: 1.6rem;
    margin-bottom: 0;
}

/* Estilo para cards clicáveis */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.card-link:hover .summary-card {
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

/* Estilo para botões de grupo (NOVO) */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.button-group input[type="radio"] {
    display: none;
}
.button-group label {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    background-color: #ffffff;
    color: #495057;
    font-weight: 500;
    transition: all 0.2s ease;
}
.button-group label:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}
.button-group input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}


/* --------------------------------------------------- */
/* --- ESTILO PARA BOTÕES DE ORIGEM COM LOGO (v2) --- */
/* --------------------------------------------------- */

.logo-button-group {
    display: grid;
    /* Botões um pouco mais estreitos para caberem mais na mesma linha */
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px; /* Reduzido o espaço entre os botões */
}

.logo-button-group input[type="radio"] {
    display: none; /* Esconde o rádio original */
}

.logo-button-group label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px; /* Reduzido o preenchimento interno */
    border: 1px solid #ced4da;
    border-radius: 8px;
    cursor: pointer;
    background-color: #ffffff;
    text-align: center;
    height: 85px; /* ALTURA REDUZIDA de 100px para 85px */
    transition: all 0.2s ease;
}

.logo-button-group label:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.logo-button-group input[type="radio"]:checked + label {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.logo-button-group img {
    /* Removemos a altura fixa e definimos limites máximos */
    max-height: 35px;      /* Define uma altura MÁXIMA para o logo */
    max-width: 90%;        /* Define uma largura MÁXIMA (90% do botão) */
    
    margin-bottom: 6px;
    object-fit: contain; /* Garante que a imagem caiba sem distorcer */
}

.logo-button-group span {
    font-size: 0.75rem; /* Tamanho da fonte um pouco menor */
    font-weight: 500;
}

/* Garante que o texto do botão selecionado fique branco */
.logo-button-group input[type="radio"]:checked + label span {
    color: white;
}

/* ----------------------------------------------------------------- */
/* --- AJUSTE DE ALINHAMENTO PARA BOTÕES DE AÇÕES EM TABELAS --- */
/* ----------------------------------------------------------------- */

.actions-container {
    display: flex;
    align-items: center; /* Esta é a propriedade chave: alinha verticalmente os botões ao centro */
    gap: 10px;
}


/* ======================================================= */
/* --- ESTILOS PARA GERENCIAMENTO DE MORADORES E MODAIS --- */
/* ======================================================= */

/* Tags de Status (Ativo/Inativo) */
.status-tag {
    padding: .25em .6em;
    font-size: 80%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25rem;
    color: #fff;
}
.status-ativo {
    background-color: var(--success-color);
}
.status-inativo {
    background-color: var(--error-color); /* Status "Inativo" em vermelho */
}

/* Botões pequenos para a coluna de Ações */
.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}
.btn-success {
    background-color: var(--success-color);
}
.btn-success:hover {
    background-color: #27ae60;
}

/* Estilo para o botão de editar desabilitado */
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none; /* Remove efeito de hover */
    box-shadow: none; /* Remove efeito de hover */
}

/* Estrutura do Modal (pop-up) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}
.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.modal-content h3 {
    margin-top: 0;
}



/* ======================================================= */
/* === ESTILOS PARA O NOVO MENU LATERAL (SIDEBAR) === */
/* ======================================================= */

/* --- ESTRUTURA PRINCIPAL --- */
.page-wrapper {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    position: fixed;
    height: 100%;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}
.main-content {
    flex-grow: 1;
    margin-left: 280px;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
}
.container {
    padding: 2rem;
}

/* --- CABEÇALHO DO MENU LATERAL --- */
.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #4a69bd 0%, #3b5496 100%);
    position: relative;
}
.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
}
.sidebar-header h2 {
    color: #fff;
    border: none;
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.sidebar-logo {
    max-width: 160px;
    height: auto;
    display: inline-block;
}
.sidebar-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* --- NAVEGAÇÃO DO MENU LATERAL --- */
.sidebar-nav {
    overflow-y: auto;
    height: calc(100% - 100px);
    padding: 1rem 0 8rem;
}
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav .menu-header {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #bdc3c7;
    margin-top: 1.5rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.5rem;
}
.sidebar-nav .menu-header:first-child {
    margin-top: 0;
}
.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    border-radius: 0 25px 25px 0;
    margin: 2px 0;
    margin-right: 1rem;
}
.sidebar-nav li a:hover {
    background: linear-gradient(135deg, rgba(74, 105, 189, 0.2) 0%, rgba(59, 84, 150, 0.3) 100%);
    transform: translateX(5px);
    color: #fff;
}
.sidebar-nav li a.active {
    background: linear-gradient(135deg, #4a69bd 0%, #3b5496 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(74, 105, 189, 0.3);
    transform: translateX(5px);
}
.sidebar-nav li a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    border-radius: 0 2px 2px 0;
}
.sidebar-nav li a.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.sidebar-nav li a.disabled:hover {
    background: none;
    transform: none;
    color: #95a5a6;
}
.sidebar-nav li a .icon {
    margin-right: 1rem;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}
.sidebar-nav li a:hover .icon {
    transform: scale(1.1);
}
.sidebar-nav li a .menu-text {
    flex: 1;
}
.sidebar-nav li a .badge {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* --- CABEÇALHO DO CONTEÚDO PRINCIPAL --- */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 800;
}
.menu-toggle {
    display: none; /* Escondido em telas grandes */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: #333;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
    z-index: 1001;
    position: relative;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.user-info .btn-logout {
    background: #f1f3f5;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
}
.user-info .btn-logout:hover {
    background: var(--error-color);
    color: white;
}
footer {
    margin-top: auto; /* Empurra o rodapé para o fim da página */
}

/* --- OVERLAY PARA MENU MOBILE --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

body.sidebar-toggled .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

/* Prevenir scroll quando menu está aberto */
body.sidebar-toggled {
    overflow: hidden;
}

@media (min-width: 993px) {
    body.sidebar-toggled {
        overflow: auto;
    }
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        position: fixed;
        z-index: 999;
        height: 100vh;
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .page-wrapper.sidebar-collapsed .sidebar,
    body.sidebar-toggled .sidebar {
        transform: translateX(0);
    }
    .sidebar-nav li a {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    .sidebar-nav li a .icon {
        font-size: 1.3rem;
        margin-right: 1.2rem;
    }
}

/* ======================================================= */
/* --- BOTÃO DE FECHAR O MENU LATERAL (MOBILE) --- */
/* ======================================================= */

.sidebar-close {
    display: none; /* Escondido por padrão em telas grandes */
    position: absolute;
    top: 5px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2.5rem;
    line-height: 1;
    color: #ecf0f1;
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sidebar-close:hover {
    opacity: 1;
}

/* Regra para mostrar o botão apenas em telas menores (a mesma do menu-toggle) */
@media (max-width: 992px) {
    .sidebar-close {
        display: block;
    }
}


/* ============================================== */
/* === AJUSTES DE RESPONSIVIDADE E LAYOUTS === */
/* ============================================== */


/* RESPONSIVIDADE PARA O MENU LATERAL */
@media (max-width: 992px) {
    .sidebar { 
        transform: translateX(-100%); 
        width: 280px;
    }
    .main-content { 
        margin-left: 0; 
    }
    .menu-toggle { 
        display: block; 
    }
    .sidebar-close { 
        display: none; 
        position: absolute; 
        top: 15px; 
        right: 20px; 
        background: none; 
        border: none; 
        font-size: 2rem; 
        line-height: 1; 
        color: #ecf0f1; 
        cursor: pointer; 
        padding: 0.5rem; 
        opacity: 0.8; 
        transition: all 0.3s ease;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .sidebar-close:hover { 
        opacity: 1;
        background: rgba(255, 255, 255, 0.1);
        transform: rotate(90deg);
    }
    body.sidebar-toggled .sidebar { 
        transform: translateX(0); 
    }
    body.sidebar-toggled .sidebar-close { 
        display: flex; 
    }
}

/* RESPONSIVIDADE PARA TABELAS E FORMULÁRIOS DE FILTRO */
@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    .main-content .container { padding: 1rem; }
    .form-container, .login-container { padding: 1.5rem; }
    .filter-form { flex-direction: column; align-items: stretch; gap: 1rem; }
    .filter-form .form-group { width: 100%; }
    
    .table-container table thead { display: none; }
    .table-container table tr { display: block; border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 1rem; padding: 1rem; }
    .table-container table td { display: flex; justify-content: flex-start; align-items: center; text-align: left; padding: 0.75rem 0; border-bottom: 1px dashed var(--border-color); }
    .table-container table tr:last-child { border-bottom: 1px solid var(--border-color); }
    .table-container table td:last-child { border-bottom: none; }
    .table-container table td::before { content: attr(data-label); font-weight: bold; text-align: left; margin-right: 1rem; }
    .table-container table td[data-label="Ações"] .actions-container { width: 100%; justify-content: flex-end; }
}


/* ======================================================= */
/* === RESPONSIVIDADE P/ CADASTRO DE ENCOMENDA (MOBILE) === */
/* ======================================================= */

@media (max-width: 768px) {

    /* Ajusta a grade de botões de Origem em telas pequenas */
    .logo-button-group {
        /* Define um tamanho mínimo menor para os botões, permitindo que mais deles caibam na mesma linha antes de quebrar */
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px; /* Reduz um pouco o espaçamento */
    }

    /* Diminui a altura e o padding dos botões de Origem */
    .logo-button-group label {
        height: 80px;
        padding: 8px;
    }

    /* Diminui um pouco o logo dentro do botão */
    .logo-button-group img {
        max-height: 28px;
    }

    /* Diminui o texto dentro do botão */
    .logo-button-group span {
        font-size: 0.7rem;
    }

    /* Ajusta os botões de Tipo de Encomenda para ficarem mais compactos */
    .button-group label {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* ======================================================= */
/* === AJUSTE PARA LAYOUT CENTRALIZADO COM LARGURA MÁXIMA === */
/* ======================================================= */
.main-content .container {
    max-width: 1440px; /* Define uma largura máxima confortável para o conteúdo */
    margin-left: auto;   /* Estas duas linhas centralizam o container */
    margin-right: auto;  /* na área de conteúdo principal */
    padding: 2rem;      /* Mantém o espaçamento interno (respiro) */
}

/* ======================================================= */
/* === AJUSTE DE LARGURA PARA FORMULÁRIOS MAIORES === */
/* ======================================================= */

/*
 * Por padrão, .form-container tem 600px de largura máxima.
 * A classe .form-container-wide sobrescreve isso para ocupar
 * a largura total disponível dentro do seu contêiner pai.
 */
.main-content .form-container.form-container-wide {
    max-width: 100%;
}

/* =================================== */
/* ===== TESTE DE DIAGNÓSTICO ===== */
/* =================================== */

/*.form-container {
/*    border: 5px solid red !important;
 /*   max-width: 100% !important;
/*}

/* ============================================== */
/* === ESTILOS PARA O WIZARD DE APARTAMENTOS === */
/* ============================================== */
.wizard-step {
    display: none; /* Esconde todas as etapas por padrão */
}
.wizard-step.active {
    display: block; /* Mostra apenas a etapa ativa */
}
.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}
.form-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 1.5rem; 
}
.preview-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 1.5rem; 
}
.bloco-preview { 
    background: #f8f9fa; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    padding: 1rem; 
}
.bloco-preview h4 { 
    margin-top: 0; 
    border-bottom: 1px solid #ddd; 
    padding-bottom: 0.5rem; 
}
.aptos-list { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
    margin-top: 1rem; 
}
.aptos-list span { 
    background: #e9ecef; 
    padding: 5px 10px; 
    border-radius: 4px; 
    font-size: 0.9rem; 
}


/* ============================================== */
/* === ESTILOS PARA VISUALIZAÇÃO DE APARTAMENTOS === */
/* ============================================== */
.apartamentos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.actions-header {
    display: flex;
    gap: 0.5rem;
}
.accordion-container {
    margin-top: 2rem;
}
.accordion-item {
    background-color: var(--surface-color);
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.accordion-trigger {
    background-color: var(--surface-color);
    color: var(--text-primary);
    cursor: pointer;
    padding: 1.5rem;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.accordion-item.active .accordion-trigger {
    background-color: #f8f9fa;
}
.accordion-trigger .arrow {
    transition: transform 0.3s ease;
}
.accordion-item.active .arrow {
    transform: rotate(180deg);
}
.accordion-content {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.andar-group {
    padding: 1.5rem 0;
    border-bottom: 1px dashed var(--border-color);
}
.andar-group:last-child {
    border-bottom: none;
}
.andar-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}
.apto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.apto-badge {
    background-color: #e9ecef;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    border-left: 5px solid;
}
/* Cores dos status dos apartamentos */
.apto-badge.status-ocupado { border-color: var(--success-color); }
.apto-badge.status-vago { border-color: var(--pending-color); }
.apto-badge.status-manutencao { border-color: var(--error-color); }


/* ============================================== */
/* === ESTILOS PARA VISUALIZAÇÃO DE APARTAMENTOS === */
/* ============================================== */

.blocos-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.bloco-section {
    background-color: var(--surface-color);
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.bloco-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
}

.apartamentos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    justify-content: center;
}

.apto-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
    position: relative; /* Para o tooltip */
}

.apto-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

/* Cores de status dos apartamentos */
.apto-card.status-vago {
    background-color: #f8f9fa; /* Cinza claro */
    color: var(--text-secondary);
    border-color: #e9ecef;
}

.apto-card.status-ocupado {
    background-color: #e6f9f0; /* Verde bem claro */
    color: #1a6e41;
    border-color: var(--success-color);
}

.apto-card.status-inativo { /* Para futuros usos */
    background-color: #fbeeee;
    color: var(--error-color);
    border-color: var(--error-color);
    opacity: 0.7;
}

/* Tooltip (dica ao passar o mouse) */
.apto-card[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background-color: #343a40;
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 10;
}