/* Fundo geral em degradê clarinho */
body.bg-page {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #eef3ff 0%, #f6fbff 100%);
    color: #111827;
}

/* Container central */
.app-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Página inicial */
.home-page {
    max-width: 480px;
    width: 100%;
}

/* Cabeçalho */
.home-header {
    text-align: center;
    margin-bottom: 24px;
}

.home-icon {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 32px;
    margin: 0 auto 12px;
}

.home-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.home-subtitle {
    margin: 4px 0 0;
    font-size: 14px;
    color: #6b7280;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
}

.card-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px;
}

/* Botões */
.btn {
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 18px;
}

.btn-primary {
    background: #020617;
    color: #ffffff;
    width: 100%;
}

.btn-outline {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #111827;
}

.btn-outline + .btn-outline {
    margin-top: 8px;
}

.full-width {
    width: 100%;
}


/* Link de voltar */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #4b5563;
    text-decoration: none;
    margin-bottom: 8px;
}

/* Página de bloco / seleção de apto */
.block-page {
    max-width: 768px;
    width: 100%;
}

/* Cabeçalho colorido (vamos usar azul aqui) */
.block-header {
    background: #2563eb;
    color: #ffffff;
    border-radius: 24px;
    padding: 16px 16px 24px;
    margin-bottom: 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.15);
}

.block-header-top {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 8px;
}

.block-header .back-link {
    color: #e5e7eb;
}

.block-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.block-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #ffffff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.block-name {
    font-size: 16px;
    font-weight: 600;
}

.block-subtitle {
    font-size: 14px;
    color: #e5e7eb;
}

/* Caixa de busca */
.search-box {
    margin-bottom: 12px;
}

.search-box input {
    width: 100%;
    border-radius: 999px;
    border: none;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
}

/* Filtros de andar */
.floor-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.floor-pill {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.7);
    color: #e5e7eb;
    font-size: 13px;
    text-decoration: none;
}

.floor-pill-active {
    background: #ffffff;
    color: #2563eb;
}

/* Conteúdo principal (lista de aptos) */
.block-main {
    margin-top: 12px;
}

/* Grid de apartamentos */
.apartment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

/* Card de apartamento */
.apartment-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.apartment-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #dcfce7;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.apartment-number {
    font-size: 16px;
    font-weight: 600;
}

.apartment-sub {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.empty-state {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin-top: 24px;
}

/* Botões de papel (bloco_access) */
.role-buttons .btn + .btn {
    margin-top: 8px;
}

.apartment-card-link {
    text-decoration: none;
    color: inherit;
}

.apartment-card-link:hover .apartment-card {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}


/* Lista de moradores */
.resident-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.resident-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resident-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.resident-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #dcfce7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.resident-name {
    font-size: 15px;
    font-weight: 600;
}

.resident-role {
    font-size: 13px;
    color: #6b7280;
}

.resident-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.resident-btn {
    border-radius: 999px;
    border: none;
    font-size: 13px;
    padding: 8px 14px;
    cursor: pointer;
}

.resident-btn-message {
    background: #dcfce7;
}

.resident-btn-call {
    background: #dbeafe;
}

/* =========================================================
   DASHBOARD DO MORADOR
   ========================================================= */

/* Cabeçalho dentro do card do dashboard */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Se quiser títulos um pouco maiores no dashboard, pode ajustar aqui */
/* .card-title { }  -- já existe acima, reaproveitado */

/* Corpo do card no dashboard */
.card-body {
    font-size: 14px;
    color: #374151;
}

/* Grid para os números do resumo */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

.stat-item {
    background: #f3f4ff;
    border-radius: 12px;
    padding: 10px 12px;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

/* Lista de logs (últimos contatos) */
.log-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.log-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

.log-item:last-child {
    border-bottom: none;
}

.log-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.log-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.log-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.log-subtitle {
    font-size: 12px;
    color: #6b7280;
}

.log-meta {
    text-align: right;
    font-size: 12px;
    color: #6b7280;
    min-width: 120px;
}

.log-date {
    font-weight: 500;
    margin-bottom: 2px;
}

.log-meta-small {
    font-size: 11px;
    color: #9ca3af;
}
