* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background: #f4f7fb; display: flex; color: #2c3e50; transition: background 0.3s, color 0.3s; }

/* SIDEBAR MODERNA */
/* SIDEBAR MODERNA */
.sidebar { width: 260px; height: 100vh; background: #0a1128; position: fixed; left: 0; top: 0; padding: 30px 20px; overflow: auto; color: white; box-shadow: 4px 0 15px rgba(0,0,0,0.05); z-index: 100; transition: background 0.3s; }
.logo { text-align: center; margin-bottom: 40px; }
.logo-icon { width: 70px; height: 70px; background: linear-gradient(135deg, #3b82f6, #2563eb); border-radius: 16px; display: flex; align-items: center; justify-content: center; margin: auto; font-size: 22px; font-weight: bold; color: white; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3); }
.logo h2 { margin-top: 15px; font-size: 20px; font-weight: 600; letter-spacing: 1px; color: #f8fafc; }

/* MENU PREMIUM */
.menu-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #64748b; margin-bottom: 12px; padding-left: 20px; }
.menu button { width: 100%; padding: 14px 20px; border: none; border-radius: 10px; margin-bottom: 8px; background: transparent; color: #94a3b8; cursor: pointer; text-align: left; font-size: 15px; font-weight: 500; transition: all 0.3s ease; border-left: 4px solid transparent; display: flex; align-items: center; }
.menu button i { margin-right: 12px; width: 20px; text-align: center; font-size: 16px; }
.menu button:hover { background: #1e293b; color: #ffffff; border-left: 4px solid #3b82f6; transform: translateX(4px); }
.menu button.ativo { background: #1e293b; color: #ffffff; border-left: 4px solid #3b82f6; }

/* CONTENT & CARDS CLEAN */
.content { margin-left: 260px; padding: 40px; width: 100%; max-width: 1400px; margin-right: auto; position: relative; }
.box { background: #ffffff; padding: 25px; border-radius: 16px; margin-bottom: 25px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); border: 1px solid #e2e8f0; transition: background 0.3s, border 0.3s; }
.card { background: #ffffff; padding: 20px; border-radius: 12px; margin-top: 15px; box-shadow: 0 2px 10px rgba(0,0,0,0.04); border: 1px solid #f1f5f9; transition: transform 0.2s ease, background 0.3s, border 0.3s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.card h3 { color: #0f172a; margin-bottom: 12px; font-size: 18px; transition: color 0.3s; }
.card p { color: #475569; font-size: 14px; margin-bottom: 6px; line-height: 1.5; transition: color 0.3s; }

/* INPUTS MINIMALISTAS */
input, select, textarea { width: 100%; padding: 14px 16px; margin-top: 12px; border-radius: 10px; border: 1px solid #cbd5e1; font-size: 15px; background: #f8fafc; transition: all 0.3s; color: #334155; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #3b82f6; background: #ffffff; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
textarea { min-height: 100px; resize: vertical; }

/* BOTÕES MODERNOS */
.btn { width: 100%; padding: 14px; border: none; border-radius: 10px; margin-top: 15px; background: #3b82f6; color: white; cursor: pointer; font-size: 15px; font-weight: 600; transition: all 0.3s ease; box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2); }
.btn:hover { background: #2563eb; transform: translateY(-2px); box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3); }

/* BOTÕES DE AÇÃO DOS CARDS */
.acoes { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.btn-acao { flex: 1; padding: 10px; border: none; border-radius: 8px; cursor: pointer; color: white; font-weight: 600; font-size: 13px; text-align: center; transition: all 0.2s; }
.btn-acao:hover { filter: brightness(1.1); transform: scale(1.02); }
.editar { background: #f59e0b; color: #fff; }
.excluir { background: #ef4444; color: #fff; }
.entregue { background: #10b981; color: #fff; }
.whats { background: #25d366; color: #fff; }
.print { background: #475569; color: #fff; }
.qr-btn { background: #64748b; color: #fff; }
.finalizado { background: #3b82f6; color: #fff; }

/* BADGES */
.badge { display: inline-block; padding: 6px 12px; border-radius: 20px; margin-bottom: 15px; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.status-pendente { background: #fef3c7; color: #d97706; }
.status-andamento { background: #e0f2fe; color: #0284c7; }
.status-entregue { background: #d1fae5; color: #059669; }
.status-urgente { background: #fee2e2; color: #dc2626; }

/* FOTO E CANVAS */
.foto { width: 100%; border-radius: 10px; margin-top: 15px; max-height: 250px; object-fit: cover; border: 1px solid #e2e8f0; }
.tela { display: none; animation: fadeIn 0.4s ease; }
.ativa { display: block; }
canvas { width: 100%; height: 200px; background: #f8fafc; border: 2px dashed #cbd5e1; border-radius: 12px; margin-top: 10px; touch-action: none; cursor: crosshair; }

/* ESTILOS DA DASHBOARD COMPACTA */
.dash-header { display: flex; justify-content: space-between; align-items: center; background: white; padding: 20px 25px; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.03); border: 1px solid #e2e8f0; transition: background 0.3s, border 0.3s; }
.btn-dark { background: #1e293b; color: #f8fafc; border: none; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; font-size: 16px; transition: 0.3s; }
.btn-dark:hover { transform: scale(1.05); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 15px; margin-bottom: 25px; }
.stat-card { background: white; padding: 15px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #64748b; border: 1px solid #e2e8f0; transition: transform 0.2s, background 0.3s, border 0.3s; }
.stat-card:hover { transform: translateY(-3px); }
.stat-card i { font-size: 22px !important; margin-bottom: 8px !important; }
.stat-card span { font-size: 24px; margin-top: 5px; font-weight: 800; color: #0f172a; transition: color 0.3s; }
.stat-card p { font-size: 12px; font-weight: bold; margin-top: 5px; }

/* ANIMAÇÕES DO PONTO PULSANTE (ENCOMENDAS E OCORRÊNCIAS) */
@keyframes pulse-green { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
@keyframes pulse-yellow { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
.dot-status { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.dot-green { background: #10b981; animation: pulse-green 2s infinite; }
.dot-yellow { background: #f59e0b; animation: pulse-yellow 2s infinite; }
.dot-red { background: #ef4444; animation: pulse-red 2s infinite; }

/* ESTILOS ESPECÍFICOS: GRID DE APARTAMENTOS E MODAL (MORADORES) */
.apto-grid { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; margin-top: 20px; }
.apto-btn { background: #e0f2fe; color: #0284c7; border: 2px solid #bae6fd; border-radius: 50%; width: 65px; height: 65px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: bold; cursor: pointer; transition: all 0.2s; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.apto-btn:hover { background: #3b82f6; color: #fff; border-color: #3b82f6; transform: scale(1.1); }

/* LINHA DO TEMPO - PLANTÃO */
.timeline { position: relative; padding-left: 40px; margin-top: 20px; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 0; height: 100%; width: 2px; background: #e2e8f0; transition: background 0.3s; }
.timeline-item { position: relative; margin-bottom: 25px; }
.timeline-dot { position: absolute; left: -32.5px; top: 5px; width: 15px; height: 15px; background: #3b82f6; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #3b82f6; transition: border-color 0.3s; }

/* === O SEGREDO DO MODAL ESTÁ AQUI === */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(3px); animation: fadeIn 0.2s ease; }
.modal-overlay.ativo { display: flex; }
.modal-content { background: #fff; width: 90%; max-width: 400px; border-radius: 16px; padding: 25px; position: relative; box-shadow: 0 10px 25px rgba(0,0,0,0.2); max-height: 90vh; overflow-y: auto; }
.fechar-modal { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 20px; cursor: pointer; color: #94a3b8; transition: color 0.2s; }
.fechar-modal:hover { color: #ef4444; }

/* DARK MODE MÁGICO */
body.dark-mode { background: #0f172a; color: #f8fafc; }
body.dark-mode .content h2, body.dark-mode .content h3, body.dark-mode .content p, body.dark-mode .card h3, body.dark-mode .card p { color: #f8fafc; }
body.dark-mode .box, body.dark-mode .card, body.dark-mode .dash-header, body.dark-mode .stat-card { background: #1e293b; border-color: #334155; color: white; box-shadow: none; }
body.dark-mode .stat-card span { color: #f8fafc; }
body.dark-mode input, body.dark-mode select, body.dark-mode textarea { background: #0f172a; color: white; border-color: #475569; }
body.dark-mode .badge { background: rgba(255,255,255,0.1); }
body.dark-mode .btn-dark { background: #f8fafc; color: #1e293b; }
body.dark-mode canvas { background: #0f172a; border-color: #475569; }
body.dark-mode .apto-btn { background: #1e293b; color: #38bdf8; border-color: #334155; }
body.dark-mode .apto-btn:hover { background: #3b82f6; color: #fff; }
body.dark-mode .modal-content { background: #1e293b; border: 1px solid #334155; }
body.dark-mode .timeline::before { background: #334155; }
body.dark-mode .timeline-dot { border-color: #1e293b; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* RESPONSIVO */
@media(max-width: 800px) {
    .sidebar { width: 80px; padding: 20px 10px; }
    .logo h2 { display: none; }
    .logo-icon { width: 50px; height: 50px; font-size: 16px; }
    .menu-label { display: none; }
    .menu button { padding: 15px 0; text-align: center; font-size: 12px; flex-direction: column; align-items: center; border-left: none; border-bottom: 4px solid transparent; }
    .menu button:hover { border-left: none; border-bottom: 4px solid #3b82f6; transform: translateY(-4px); }
    .menu button i { margin-right: 0; margin-bottom: 5px; font-size: 20px; }
    .content { margin-left: 80px; padding: 20px; }
    .dash-header { flex-direction: column; gap: 15px; text-align: center; }
}

.filtro-container { display: flex; gap: 10px; align-items: center; margin-top: 15px; flex-wrap: wrap;}
.filtro-container input, .filtro-container select { margin-top: 0; flex: 1; min-width: 200px;}
.btn-limpar { background-color: #64748b; width: auto; white-space: nowrap; margin-top: 0; }

/* CORREÇÃO PARA CAMPOS DE DATA E MÊS */
input[type="month"], input[type="date"] {
    width: auto !important;
    margin-top: 0 !important;
    display: inline-block !important;
    appearance: auto !important; 
    -webkit-appearance: auto !important;
}

.filtro-container input[type="month"], .filtro-container input[type="date"] {
    flex: 1;
    min-width: 160px;
    height: 45px;
}

input[type="month"]::-webkit-datetime-edit-text,
input[type="month"]::-webkit-datetime-edit-month-field,
input[type="month"]::-webkit-datetime-edit-year-field {
    color: #0f172a !important;
}

input[type="month"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

/* ==========================================
   🖨️ REGRAS DE IMPRESSÃO (MEDIA PRINT)
   ========================================== */
@media print {
    body * {
        visibility: hidden;
    }
    
    #modalFichaCliente, #modalFichaCliente *,
    #clone-impressao-temporario, #clone-impressao-temporario * {
        visibility: visible;
    }

    #modalFichaCliente {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none !important;
    }

    #clone-impressao-temporario {
        position: absolute;
        left: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none !important;
    }

    body.print-duas-mesma-folha #modalFichaCliente {
        transform: scale(0.7); 
        transform-origin: top center;
    }
    body.print-duas-mesma-folha #clone-impressao-temporario {
        top: 50%; 
        transform: scale(0.7);
        transform-origin: top center;
        border-top: 1px dashed #94a3b8; 
        padding-top: 20px;
    }

    body.print-duas-separadas #modalFichaCliente {
        page-break-after: always; 
    }
    body.print-duas-separadas #clone-impressao-temporario {
        top: 0; 
    }

    button, .btn, .fa-link {
        display: none !important;
    }
}

/* ==========================================
   NOVO LAYOUT SAAS - FICHA DO CLIENTE        
   ========================================== */
.ficha-saas-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.ficha-top-row {
    display: flex;
    gap: 30px;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    align-items: center;
}

.ficha-foto-container {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.ficha-foto-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-upload-foto {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.7);
    color: white;
    text-align: center;
    padding: 8px 0;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 16px;
}

.ficha-foto-container:hover .btn-upload-foto {
    opacity: 1;
}

.ficha-dados-condominio {
    flex-grow: 1;
}

.ficha-titulo-badge {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.ficha-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

#ficha-nome-condominio {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 4px 0 0 0;
}

.badge-ativo {
    background: #dcfce7;
    color: #166534;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.ficha-infos-lista p {
    margin: 6px 0;
    font-size: 13px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ficha-infos-lista p i {
    color: #94a3b8;
    width: 16px;
    text-align: center;
}

.ficha-dados-contrato {
    min-width: 220px;
    border-left: 1px solid #e2e8f0;
    padding-left: 25px;
}

.ficha-dados-contrato h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 15px;
}

.linha-contrato {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 10px;
}

.linha-contrato span { color: #64748b; }
.linha-contrato strong { color: #1e293b; }

.ficha-cards-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.card-inteligente {
    background: #ffffff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid transparent;
    transition: 0.3s;
}

.card-inteligente:hover {
    border-color: #e2e8f0;
    transform: translateY(-2px);
}

.card-icone {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.card-textos span {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.card-textos h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.card-textos p {
    margin: 0;
    font-size: 11px;
    color: #94a3b8;
}

.ficha-progresso-container {
    background: #ffffff;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.progresso-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

#ficha-progresso-texto {
    color: #64748b;
    font-weight: 500;
    font-size: 13px;
}

.progresso-track {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progresso-fill {
    background: #8b5cf6;
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.8s ease-in-out;
}

/* ==========================================
   🎯 BANNER PREMIUM - AVISO DE VENCIMENTO
   ========================================== */
.banner-premium {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    display: none; 
    flex-direction: column;
}

.banner-premium:hover {
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.banner-premium.urgente {
    border-color: #fecaca;
    background: #fffcfc;
}

/* Barra de Progresso no Topo do Banner */
.progress-bar-container {
    height: 4px;
    width: 100%;
    background: #f1f5f9;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    width: 0%;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Botão de Fechar */
.btn-close-banner {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s;
    z-index: 10;
}

.btn-close-banner:hover {
    color: #ef4444;
    transform: scale(1.1);
}

/* Conteúdo Principal do Banner */
.banner-content {
    display: flex;
    align-items: center;
    padding: 25px 30px;
    gap: 25px;
}

/* --- Ícone Sino e Efeitos Orbitais --- */
.sino-container {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sino-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #ef4444;
    border-radius: 50%;
    filter: blur(15px);
    opacity: 0.2;
    animation: pulsarGlow 2s infinite alternate;
}

.sino-circle {
    position: relative;
    width: 45px;
    height: 45px;
    background: #fef2f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #fee2e2;
    z-index: 2;
}

.sino-icon {
    font-size: 20px;
    color: #ef4444;
    animation: tocarSino 4s infinite;
    transform-origin: top center;
}

.badge-notif {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* Órbitas Giratórias */
.orbita {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px dashed rgba(239, 68, 68, 0.2);
    animation: girarOrbita 10s linear infinite;
}

.orbita-2 { width: 130%; height: 130%; animation-direction: reverse; animation-duration: 15s; border-color: rgba(245, 158, 11, 0.2); }
.orbita-3 { width: 160%; height: 160%; animation-duration: 20s; }

.particula {
    position: absolute;
    top: -3px;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

.banner-texto {
    flex-grow: 1;
}

.banner-titulo {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 5px;
}

.banner-descricao {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
}

.contador-dias {
    color: #ef4444;
    font-weight: 800;
    padding: 2px 6px;
    background: #fef2f2;
    border-radius: 4px;
    margin: 0 2px;
}

/* Botão Pagar Premium */
.banner-acao {
    flex-shrink: 0;
}

.btn-pagar-premium {
    position: relative;
    background: #0f172a;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.2);
    transition: 0.3s;
}

.btn-pagar-premium:hover {
    background: #1e293b;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(15, 23, 42, 0.3);
}

.btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: passarBrilho 3s infinite;
}

/* 🌙 Dark Mode do Banner */
body.dark-mode .banner-premium {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

body.dark-mode .banner-premium.urgente {
    background: #3f1d1d;
    border-color: #ef4444;
}

body.dark-mode .progress-bar-container {
    background: #334155;
}

body.dark-mode .banner-titulo { color: #f8fafc; }
body.dark-mode .banner-descricao { color: #94a3b8; }
body.dark-mode .sino-circle { background: #1e293b; border-color: #475569; }
body.dark-mode .contador-dias { background: rgba(239, 68, 68, 0.2); }

/* Keyframes */
@keyframes girarOrbita { 100% { transform: rotate(360deg); } }
@keyframes pulsarGlow { 0% { transform: scale(0.8); opacity: 0.1; } 100% { transform: scale(1.2); opacity: 0.3; } }
@keyframes tocarSino { 0%, 20% { transform: rotate(0); } 2%, 6%, 10%, 14%, 18% { transform: rotate(10deg); } 4%, 8%, 12%, 16% { transform: rotate(-10deg); } }
@keyframes passarBrilho { 0% { left: -100%; } 20% { left: 200%; } 100% { left: 200%; } }

/* Responsivo do Banner */
@media(max-width: 768px) {
    .banner-content { flex-direction: column; text-align: center; gap: 15px; padding: 20px; }
    .banner-acao { width: 100%; }
    .btn-pagar-premium { width: 100%; justify-content: center; }
    .btn-close-banner { top: 10px; right: 10px; }
}
/* ========================================== */
        /* GRID DE APARTAMENTOS E SIDE PANEL (V2)     */
        /* ========================================== */
        .painel-grid-moradores {
            display: flex;
            gap: 20px;
            align-items: flex-start;
        }

        .grid-container-apts {
            flex: 1;
            background: white;
            border-radius: 12px;
            padding: 20px;
            border: 1px solid #e2e8f0;
        }

        .side-panel-apto {
            width: 380px;
            background: white;
            border-radius: 12px;
            border: 1px solid #e2e8f0;
            padding: 20px;
            display: none; /* Escondido até clicar em um apto */
            position: sticky;
            top: 20px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.05);
        }

        .matriz-aptos {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
            gap: 12px;
            margin-top: 20px;
        }

        /* O Cartão do Apartamento */
        .apt-card {
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            padding: 15px 5px;
            text-align: center;
            cursor: pointer;
            position: relative;
            transition: all 0.2s ease;
            background: #f8fafc;
        }

        .apt-card:hover {
            border-color: #3b82f6;
            background: #eff6ff;
            transform: translateY(-2px);
        }

        .apt-card h3 {
            margin: 0;
            font-size: 16px;
            color: #1e293b;
        }

        .apt-card i {
            color: #94a3b8;
            font-size: 14px;
            margin-top: 5px;
        }

        /* Bolinhas de Status */
        .status-dot {
            position: absolute;
            top: 8px;
            right: 8px;
            width: 10px;
            height: 10px;
            border-radius: 50%;
        }
        .bg-verde { background-color: #10b981; box-shadow: 0 0 5px rgba(16, 185, 129, 0.4); }
        .bg-amarelo { background-color: #f59e0b; box-shadow: 0 0 5px rgba(245, 158, 11, 0.4); }
        .bg-vermelho { background-color: #ef4444; box-shadow: 0 0 5px rgba(239, 68, 68, 0.4); }
        .bg-cinza { background-color: #94a3b8; }

        /* Apartamento Inteligente (Tooltip) */
        .apt-tooltip {
            visibility: hidden;
            opacity: 0;
            position: absolute;
            bottom: calc(100% + 10px);
            left: 50%;
            transform: translateX(-50%) translateY(10px);
            background: #1e293b;
            color: white;
            padding: 12px;
            border-radius: 8px;
            width: max-content;
            z-index: 100;
            text-align: left;
            font-size: 12px;
            box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2);
            transition: all 0.3s ease;
            pointer-events: none;
        }

        .apt-tooltip::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            margin-left: -6px;
            border-width: 6px;
            border-style: solid;
            border-color: #1e293b transparent transparent transparent;
        }

        .apt-card:hover .apt-tooltip {
            visibility: visible;
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        .apt-tooltip p {
            margin: 4px 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        /* Estilos do Side Panel */
        .sp-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e2e8f0; padding-bottom: 15px; margin-bottom: 15px; }
        .sp-header h2 { margin: 0; font-size: 18px; color: #0f172a; }
        .sp-btn-fechar { background: #f1f5f9; border: none; width: 30px; height: 30px; border-radius: 6px; cursor: pointer; color: #64748b; }
        .sp-btn-fechar:hover { background: #e2e8f0; color: #1e293b; }
        
        .sp-morador-principal { display: flex; gap: 15px; align-items: center; padding: 15px; background: #f8fafc; border-radius: 8px; margin-bottom: 15px; border: 1px solid #e2e8f0; }
        .sp-avatar { width: 50px; height: 50px; background: #3b82f6; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: bold; }
        
        .sp-menu-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 10px; cursor: pointer; transition: 0.2s; }
        .sp-menu-item:hover { border-color: #cbd5e1; background: #f8fafc; }
        .sp-menu-item-left { display: flex; gap: 12px; align-items: center; color: #475569; font-size: 14px; font-weight: 600; }
        
        .sp-acoes-rapidas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; border-top: 1px solid #e2e8f0; padding-top: 15px; }
        .sp-btn-acao { background: white; border: 1px solid #cbd5e1; padding: 10px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: 0.2s; }
        .sp-btn-acao.primary { color: #3b82f6; border-color: #bfdbfe; background: #eff6ff; }
        .sp-btn-acao.danger { color: #ef4444; border-color: #fecaca; background: #fef2f2; }
        .sp-btn-acao:hover { filter: brightness(0.95); }