:root {
    /* Paleta institucional Providenza */
    --primary: #B39A68;       /* Dourado/Areia */
    --primary-hover: #c4ac7a; /* Dourado claro (hover) */
    --primary-light: #f0ead9; /* Tint claro do dourado */
    --navy: #172A3A;          /* Fundo header/sidebar, texto de ênfase */
    --sage: #82958A;          /* Texto secundário/tagline */
    --success: #10b981;      /* Verde Esmeralda */
    --success-light: #d1fae5;
    --danger: #ef4444;       /* Vermelho Suave */
    --danger-light: #fee2e2;
    --warning: #f59e0b;      /* Âmbar */
    --warning-light: #fef3c7;
    --bg-body: #F5F1E8;       /* Creme/Off-white */
    --bg-card: #ffffff;
    --text-main: #172A3A;     /* Navy */
    --text-muted: #3d5164;    /* Navy suave */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --sidebar-w: 260px;
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-body); }

h1, h2, h3 { font-family: var(--font-display); }

body { 
    background-color: var(--bg-body); 
    color: var(--text-main);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* --- LOGIN (CENTRALIZADO) --- */
body.auth-page {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-body) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.8);
}

.auth-box h2 { color: var(--text-main); font-size: 2rem; margin-bottom: 8px; font-weight: 800; letter-spacing: -1px; }
.auth-box h2 span { color: var(--primary); }
.auth-box p { color: var(--text-muted); margin-bottom: 30px; }
.auth-box .input-group { margin-bottom: 20px; text-align: left; }
.auth-box label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-main); margin-bottom: 5px; }

/* --- DASHBOARD LAYOUT --- */
.dashboard-container { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-card);
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: all 0.3s ease;
}

.brand h2 { font-size: 1.5rem; font-weight: 800; color: var(--text-main); margin-bottom: 40px; letter-spacing: -0.5px; }
.brand h2 span { color: var(--primary); }

.menu { display: flex; flex-direction: column; gap: 8px; flex: 1; }

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-item i { width: 24px; margin-right: 12px; font-size: 1.1rem; text-align: center; }
.menu-item:hover { background: #f9fafb; color: var(--primary); }
.menu-item.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.menu-item.logout { color: var(--danger); margin-top: auto; }
.menu-item.logout:hover { background: var(--danger-light); }

.content { flex: 1; padding: 40px; overflow-y: auto; }

/* --- GRID RESPONSIVO --- */
.perfil-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    align-items: start;
}

@media (min-width: 1024px) {
    .perfil-grid-layout { grid-template-columns: 380px 1fr; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .content { padding: 20px; }
}

/* --- CARDS (CARTÕES) --- */
.card-detalhe, .card-info, .card-grafico, .card-remedios, .card-remedio-agrupado {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    border: 1px solid #f3f4f6;
    margin-bottom: 25px;
}

h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
h3 i { color: var(--primary); }

/* --- FORMULÁRIOS E INPUTS --- */
input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    outline: none;
    color: var(--text-main);
}

input:focus, textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-group { margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 0.9rem; }

/* --- BOTÕES --- */
button { font-family: inherit; font-weight: 600; cursor: pointer; transition: all 0.2s; border: none; }

.btn-primary { background: var(--primary); color: var(--navy); padding: 12px 24px; border-radius: 12px; }
.btn-success { background: var(--success); color: white; padding: 12px; border-radius: 12px; width: 100%; }
.btn-cancel { background: white; color: var(--text-muted); border: 1px solid #e5e7eb; padding: 8px 16px; border-radius: 8px; }
.btn-block { width: 100%; }

/* Botões de Ação Pequenos */
.btn-edit-small { color: var(--warning); background: none; font-size: 1.1rem; padding: 4px; cursor: pointer; }
.btn-delete-small { color: var(--danger); background: none; font-size: 1.1rem; padding: 4px; cursor: pointer; }

/* Botões de Edição/Delete Estilo Mini */
.btn-mini { background: none; border: none; cursor: pointer; font-size: 0.9rem; padding: 4px; opacity: 0.6; transition: 0.2s; }
.btn-mini:hover { opacity: 1; transform: scale(1.1); }
.btn-mini.edit { color: var(--warning); }
.btn-mini.del { color: var(--danger); }

/* --- MODAIS --- */
.modal { 
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.5); 
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px); 
    justify-content: center; 
    align-items: center; 
    z-index: 9999; 
}

.modal-content { 
    background: white; 
    padding: 35px; 
    border-radius: 24px; 
    width: 90%; 
    max-width: 450px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.2); 
}

.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions button { flex: 1; }

/* --- MEDICAMENTOS & PROTOCOLOS --- */
.nota-item {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.protocolo-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.lista-protocolos-scroll {
    max-height: 500px;
    overflow-y: auto;
}

/* --- UTILITÁRIOS --- */
.hidden { display: none !important; }
.mt-20 { margin-top: 20px; }

/* ==========================================
   MODO SMARTPHONE (RESPONSIVO)
   ========================================== */
@media (max-width: 768px) {
    /* Força o container a não usar Flexbox que possa prender a barra no topo */
    .dashboard-container { 
        display: block !important; 
        min-height: 100vh !important;
        position: relative !important;
    }

    .sidebar {
        /* O segredo: Fixed com coordenadas 0 de todos os lados inferiores */
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important; /* Mata qualquer 'top: 0' anterior */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 75px !important;
        
        /* Visual */
        background-color: #ffffff !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-around !important;
        border-top: 2px solid #eee !important;
        padding: 0 !important;
        z-index: 999999 !important; /* Prioridade máxima absoluta */
    }

    .brand { display: none !important; }

    .menu {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        justify-content: space-around !important;
        margin: 0 !important;
    }

    .menu-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-decoration: none !important;
        color: #64748b !important;
        font-size: 11px !important;
    }

    .menu-item i {
        font-size: 22px !important;
        margin-bottom: 3px !important;
        margin-right: 0 !important;
    }



.canvas-container {
    position: relative;
    margin: auto;
    height: 250px; /* Define uma altura fixa para não crescer infinito */
    width: 250px;  /* Mantém ele centralizado e proporcional */
}

#graficoAdesao {
    max-width: 100%;
    max-height: 100%;
}

/* Limpeza de CSS Inline: Container do Gráfico */
.canvas-container {
    position: relative;
    height: 250px;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Limpeza de CSS Inline: Modais começam escondidos */
.modal {
    display: none;
    /* Mantenha o restante das configurações do seu modal aqui (position, background, etc) */
}

    .content {
        display: block !important;
        width: 100% !important;
        padding: 20px !important;
        padding-bottom: 100px !important; /* Espaço para o menu não cobrir nada */
        margin: 0 !important;
    }
}
/* ==========================================
   NOVAS CLASSES — evitam inline styles
   ========================================== */

/* Botão pequeno (header do paciente) */
.btn-sm {
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
}

/* Barra de pesquisa + ordenação */
.search-ordenar-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}
.search-ordenar-box .input-pesquisa {
    flex: 1;
}
.btn-ordenar {
    white-space: nowrap;
    padding: 12px 16px;
}

/* Modal mensagem avulsa */
.mensagens-rapidas-container {
    margin-bottom: 14px;
}
.mensagens-rapidas-titulo {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}
.mensagens-rapidas-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.btn-rapido {
    font-size: 0.78rem !important;
    padding: 5px 10px !important;
}

/* Textarea padrão */
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
    outline: none;
    color: var(--text-main);
}
textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Abas de configurações */
.abas-container {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #f3f4f6;
}
.aba-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.aba-btn.ativa {
    border-bottom-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
}

/* Header de configurações */
.config-header {
    margin-bottom: 24px;
}
.config-header h1 {
    font-size: 1.4rem;
    font-weight: 800;
}
.config-header p {
    color: var(--text-muted);
}

/* Info helper pequeno */
.input-helper {
    color: #9ca3af;
    font-size: 0.82rem;
    display: block;
    margin-top: 4px;
}

/* ==========================================
   PERFIL DO PACIENTE — NOVA VISUALIZAÇÃO
   ========================================== */

/* Card principal do paciente */
.card-paciente-perfil {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 8px;
    border: 1px solid #f3f4f6;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}

.paciente-info-principal {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.paciente-semaforo {
    font-size: 2rem;
    cursor: help;
    line-height: 1;
    margin-top: 4px;
}

.paciente-info-linha {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.paciente-info-linha span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Cards de resumo numérico */
.resumo-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .resumo-cards { grid-template-columns: repeat(2, 1fr); }
}

.resumo-card {
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.resumo-tomou { background: #d1fae5; }
.resumo-atraso { background: #fef3c7; }
.resumo-nao   { background: #fee2e2; }
.resumo-pct   { background: var(--primary-light); }

.resumo-numero {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.resumo-tomou  .resumo-numero { color: #065f46; }
.resumo-atraso .resumo-numero { color: #92400e; }
.resumo-nao    .resumo-numero { color: #991b1b; }
.resumo-pct    .resumo-numero { color: var(--primary); }

.resumo-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: inherit;
    opacity: 0.7;
}

/* Abas do conteúdo */
.aba-conteudo {
    animation: fadeIn 0.2s ease;
}

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

/* Semáforo */
.semaforo-verde    { filter: none; }
.semaforo-amarelo  { filter: none; }
.semaforo-vermelho { filter: none; }

/* Responsive ajuste no perfil */
@media (max-width: 768px) {
    .paciente-info-linha { gap: 8px; }
    .resumo-numero { font-size: 1.4rem; }
    .card-paciente-perfil { padding: 16px; }
}

/* Abas — ocultar/mostrar via classe */
.aba-oculta { display: none !important; }

/* Espaçamento padrão do conteúdo de cada aba */
.aba-card-top   { margin-top: 20px; }
.aba-grid-top   { margin-top: 20px; }

/* Subtítulo dentro de cards */
.subtitulo-card { margin-bottom: 12px; }

/* ==========================================
   MOBILE — LAYOUT COMPLETO REFORMULADO
   ========================================== */
@media (max-width: 768px) {

    /* === ESTRUTURA GERAL === */
    .dashboard-container {
        display: block !important;
        min-height: 100vh !important;
    }

    .content {
        padding: 12px 14px !important;
        padding-bottom: 90px !important;
        width: 100% !important;
        margin: 0 !important;
    }

    /* === SIDEBAR VIRA BARRA INFERIOR === */
    .sidebar {
        position: fixed !important;
        bottom: 0 !important; top: auto !important;
        left: 0 !important; right: 0 !important;
        width: 100% !important; height: 68px !important;
        background: #fff !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-around !important;
        border-top: 1px solid #e5e7eb !important;
        padding: 0 !important;
        z-index: 9999 !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.06) !important;
    }

    .brand         { display: none !important; }
    .logout-area   { display: none !important; }

    .menu {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        justify-content: space-around !important;
        margin: 0 !important;
        gap: 0 !important;
    }

    .menu-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        color: #64748b !important;
        font-size: 10px !important;
        padding: 8px 4px !important;
        border-radius: 0 !important;
        gap: 2px !important;
    }
    .menu-item i {
        font-size: 20px !important;
        margin: 0 !important;
        width: auto !important;
    }
    .menu-item.active { color: var(--primary) !important; background: none !important; }
    .menu-item.logout { display: none !important; }

    /* === CARDS === */
    .card-detalhe, .card-info, .card-grafico,
    .card-remedios, .card-paciente-perfil {
        padding: 16px !important;
        border-radius: 14px !important;
        margin-bottom: 12px !important;
    }

    /* === PERFIL DO PACIENTE MOBILE === */
    .card-paciente-perfil { padding: 14px !important; }

    .paciente-info-principal {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin-bottom: 14px;
    }

    .paciente-semaforo { font-size: 1.6rem; }

    .paciente-info-linha {
        flex-direction: column;
        gap: 4px;
        font-size: 0.8rem;
    }

    /* Cards de resumo — 2 colunas no mobile */
    .resumo-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .resumo-numero { font-size: 1.5rem !important; }
    .resumo-label  { font-size: 0.7rem !important; }

    /* === ABAS MOBILE === */
    .abas-container {
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }
    /* Oculta scrollbar — Chrome/Edge/Safari */
    .abas-container::-webkit-scrollbar { display: none; }
    /* Oculta scrollbar — Firefox (sem impacto em Safari/iOS) */
    .abas-container { scrollbar-width: none; }

    .aba-btn {
        padding: 8px 14px !important;
        font-size: 0.82rem !important;
        display: inline-block !important;
    }

    /* === GRID DE GRÁFICOS — 1 coluna === */
    .perfil-grid-layout {
        grid-template-columns: 1fr !important;
    }

    /* === HEADER DO PACIENTE === */
    .perfil-header-top {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
    }

    .header-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .header-actions button {
        font-size: 0.8rem !important;
        padding: 7px 10px !important;
    }

    /* === HEADER DASHBOARD === */
    .header-dashboard {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .welcome-title    { font-size: 1.3rem !important; }
    .welcome-subtitle { font-size: 0.85rem !important; }

    /* === BARRA DE PESQUISA === */
    .search-ordenar-box {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .btn-ordenar { width: 100% !important; }

    /* === GRID DE PACIENTES — 1 coluna === */
    .grid-pacientes {
        grid-template-columns: 1fr !important;
    }

    /* === MODAIS === */
    .modal-content {
        padding: 20px !important;
        border-radius: 16px !important;
        width: 95% !important;
        max-height: 85vh;
        overflow-y: auto;
    }

    /* === CANVAS / GRÁFICOS === */
    .canvas-container {
        height: 200px !important;
        width: 100% !important;
    }

    /* === FORMULÁRIOS === */
    .form-grid {
        grid-template-columns: 1fr !important;
    }

    /* === MENSAGENS RÁPIDAS === */
    .mensagens-rapidas-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .btn-rapido { text-align: center !important; }

    /* === BOTÕES DE FILTRO === */
    .botoes-filtro {
        gap: 4px !important;
    }
    .btn-filtro {
        padding: 5px 10px !important;
        font-size: 0.8rem !important;
    }

    /* === TIMELINE === */
    .titulo-select-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    .select-filtro { width: 100% !important; }

    /* === CONFIGURAÇÕES === */
    .config-header h1 { font-size: 1.2rem !important; }
}

/* Telas muito pequenas (<380px) */
@media (max-width: 380px) {
    .resumo-numero  { font-size: 1.2rem !important; }
    .aba-btn        { padding: 7px 10px !important; font-size: 0.75rem !important; }
    .header-actions button { padding: 6px 8px !important; font-size: 0.75rem !important; }
}

/* ==========================================
   CALENDÁRIO DE PRESCRIÇÕES
   ========================================== */
.calendario-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.btn-cal-nav {
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
    cursor: pointer;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.btn-cal-nav:hover { background: #e5e7eb; }

.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 16px;
}

.cal-header {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    padding: 4px 0;
}

.cal-dia {
    border-radius: 8px;
    padding: 4px 2px;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    transition: background 0.15s;
    position: relative;
}

.cal-dia.vazio { background: transparent; }
.cal-dia:not(.vazio) { background: #f9fafb; }
.cal-dia:not(.vazio):hover { background: #f3f4f6; }

.cal-hoje {
    background: var(--primary-light) !important;
    outline: 2px solid var(--primary);
}

.cal-tomou     { background: #d1fae5 !important; }
.cal-atraso    { background: #fef3c7 !important; }
.cal-nao-tomou { background: #fee2e2 !important; }

.cal-numero {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.4;
}

.cal-pontos {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    margin-top: 2px;
}

.cal-ponto {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.calendario-legenda {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid #f3f4f6;
    padding-top: 12px;
}

.cal-legenda-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Cards de prescrição */
.card-prescricao {
    background: #f9fafb;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.prescricao-inativa { opacity: 0.55; border-left-color: #9ca3af; }

.prescricao-info { flex: 1; }
.prescricao-nome { font-size: 0.92rem; display: block; margin-bottom: 4px; color: #111827; }
.prescricao-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.78rem; color: #6b7280; }

.prescricao-acoes { display: flex; gap: 8px; }
.btn-icon-edit, .btn-icon-del {
    border: none; background: none; cursor: pointer; font-size: 1rem; padding: 4px;
}
.btn-icon-edit { color: #f59e0b; }
.btn-icon-del  { color: #ef4444; }

/* Badges de prazo */
.badge-continuo  { background: var(--primary-light); color: var(--navy); padding: 2px 8px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; }
.badge-encerrado { background: #f3f4f6; color: #6b7280; padding: 2px 8px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; }
.badge-urgente   { background: #fef3c7; color: #92400e; padding: 2px 8px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; }
.badge-prazo     { background: #d1fae5; color: #065f46; padding: 2px 8px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; }

@media (max-width: 768px) {
    .calendario-grid { gap: 2px; }
    .cal-dia { min-height: 38px; padding: 2px 1px; }
    .cal-numero { font-size: 0.72rem; }
    .prescricao-meta { gap: 6px; }
}

/* Título do mês no calendário */
.calendario-titulo-mes { margin: 0; }

/* ==========================================
   CONVERSA MÉDICO / PACIENTE
   ========================================== */
.conversa-bloco {
    background: #f9fafb;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid #f3f4f6;
}

.conversa-medico, .conversa-paciente {
    margin-bottom: 8px;
}

.conversa-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 4px;
}

.conversa-bubble {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    max-width: 85%;
    line-height: 1.5;
}

.bubble-medico {
    background: var(--primary-light);
    color: var(--navy);
    border-bottom-left-radius: 4px;
}

.bubble-paciente {
    background: #d1fae5;
    color: #065f46;
    border-bottom-left-radius: 4px;
}

.bubble-aguardando {
    background: #f3f4f6;
    color: #9ca3af;
    font-style: italic;
    border-bottom-left-radius: 4px;
}

.conversa-hora {
    font-size: 0.72rem;
    color: #9ca3af;
    margin-top: 2px;
}

.btn-apagar-conversa {
    border: none;
    background: none;
    color: #d1d5db;
    cursor: pointer;
    font-size: 0.78rem;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.2s;
}
.btn-apagar-conversa:hover { color: #ef4444; }