* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #f3f4f6; /* Fundo claro gelo */
    color: #1f2937; /* Texto principal cinza escuro */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.08), transparent 25%);
}

/* --- TELA DE LOGIN --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.login-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid #e5e7eb;
}

.login-card h2 {
    color: #111827;
    margin-bottom: 8px;
    font-weight: 600;
}

.app-logo {
    max-width: 220px;
    height: auto;
    margin: 0 auto 20px auto;
    display: block;
}

.app-logo-small {
    max-width: 140px;
    height: auto;
}

.brand-container {
    display: flex;
    flex-direction: column;
}

.app-subtitle {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-card p {
    color: #6b7280;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#loginForm input {
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #1f2937;
    outline: none;
    font-size: 1rem;
    transition: all 0.2s;
}

#loginForm input:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#loginBtn {
    background: #3b82f6;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

#loginBtn:hover {
    background: #2563eb;
}

.error-msg {
    color: #ef4444;
    font-size: 0.85rem;
    min-height: 20px;
    margin-top: 5px;
}

/* --- TELA PRINCIPAL (APP) --- */
.app-container {
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.08);
}

.sidebar {
    width: 350px;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.search-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.header-top h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #111827;
}

.logout-btn {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #4b5563;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}

#searchInput {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #1f2937;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.attendance-list {
    flex: 1;
    overflow-y: auto;
}

.attendance-list::-webkit-scrollbar {
    width: 6px;
}
.attendance-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.attendance-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.2s ease;
}

.attendance-item:hover {
    background: #eff6ff; /* Fundo leve azul no hover */
}

.attendance-item h4 {
    color: #111827;
    font-size: 1rem;
    margin-bottom: 5px;
}

.attendance-item p {
    color: #6b7280;
    font-size: 0.85rem;
}

.info-message, .empty-state {
    padding: 30px;
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #e2e8f0; /* Fundo das mensagens estilo WhatsApp/Web */
}

.chat-header {
    padding: 20px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.chat-header h3 {
    color: #111827;
    font-size: 1.1rem;
}

.chat-header span {
    color: #6b7280;
    font-size: 0.85rem;
}

.chat-messages {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 10px;
}

.message {
    max-width: 65%;
    padding: 12px 18px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease forwards;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Bolha Verde (Mensagem Enviada pela Clínica) */
.message.sent {
    align-self: flex-end;
    background: #dcf8c6; 
    color: #111827;
    border-bottom-right-radius: 5px;
}

/* Bolha Branca (Mensagem Recebida do Cliente) */
.message.received {
    align-self: flex-start;
    background: #ffffff;
    color: #111827;
    border-bottom-left-radius: 5px;
}

.msg-time {
    display: block;
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 5px;
    text-align: right;
}
