/* css/style.css */
:root {
    --primary: #1a5fb4;
    --primary-dark: #0d47a1;
    --success: #2e7d32;
    --warning: #f9a825;
    --danger: #c62828;
    --light: #f5f7fa;
    --dark: #263238;
    --gray: #78909c;
    --border: #cfd8dc;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: var(--dark);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 20px auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 25px 20px;
    text-align: center;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

header p {
    font-size: 1rem;
    opacity: 0.9;
}

.search-box {
    padding: 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.search-box input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 95, 180, 0.1);
}

.content {
    padding: 20px;
}

.apto-item, .morador-item, .card {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.apto-item:hover, .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: var(--primary);
}

.apto-num {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary);
    min-width: 60px;
    text-align: center;
    background: #e3f2fd;
    padding: 8px 12px;
    border-radius: 10px;
}

.moradores, .info {
    flex: 1;
    font-size: 1rem;
}

.moradores strong, .info strong {
    color: var(--dark);
    font-weight: 600;
}

.ifood {
    background: #ea1d22;
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.ze {
    background: var(--success);
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn {
    display: inline-block;
    padding: 10px 16px;
    margin: 5px 2px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }

.btn:hover { opacity: 0.9; transform: translateY(-1px); }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #f1f5f9;
    font-weight: 600;
    color: var(--primary);
}

form {
    background: #fafafa;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 20px 0;
}

form label {
    display: block;
    margin: 10px 0 5px;
    font-weight: 500;
}

form input, form select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

form button {
    margin-top: 15px;
    padding: 12px 20px;
}

.empty, .alert {
    text-align: center;
    padding: 30px;
    color: var(--gray);
    font-style: italic;
}

footer {
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    color: var(--gray);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
}

/* Responsivo */
@media (max-width: 768px) {
    header h1 { font-size: 1.5rem; }
    .apto-item, .card { flex-direction: column; align-items: flex-start; }
    .apto-num { margin-bottom: 8px; }
    .container { margin: 10px; }
}

@media (max-width: 480px) {
    .apto-num { font-size: 1.2rem; }
    .moradores, .info { font-size: 0.95rem; }
    th, td { padding: 10px; font-size: 0.9rem; }
}






/* === MELHORIA VISUAL DOS MORADORES === */

.moradores strong {

    font-size: 1.1rem;

    color: #1a1a1a;

}

.moradores small {

    display: block;

    margin-top: 4px;

    font-size: 0.85rem;

    color: #555;

}

.moradores .ifood,

.moradores .ze {

    display: inline-block;

    margin-right: 12px;

    font-weight: 500;

}

/* Separador visual entre moradores */

.morador-separator {

    height: 1px;

    background: #ddd;

    margin: 12px 0;

    border-radius: 1px;

}

/* Remove separador do último morador */

.apto-item .moradores > *:last-child + .morador-separator,

.apto-item .moradores > .morador-separator:last-child {

    display: none;

}


/* === BOTÕES COMPACTOS NO ADMIN === */

.admin-btn {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

    padding: 8px 12px !important;

    font-size: 0.85rem !important;

    font-weight: 600;

    white-space: nowrap;

    min-width: 80px;

    height: 36px;

}

.admin-btn .icon {

    font-weight: bold;

    font-size: 1.1em;

}

/* Botão pequeno para ações rápidas */

.btn-sm {

    padding: 6px 10px !important;

    font-size: 0.8rem !important;

    height: 32px;

}

/* Tabela mais compacta no admin */

table.admin-table th,

table.admin-table td {

    padding: 10px 8px;

    font-size: 0.9rem;

}

table.admin-table .actions {

    white-space: nowrap;

}