/* Variáveis CSS atualizadas */
:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
    --footer-height: 60px;
    --primary-color: #2c7be5;
    --secondary-color: #6c757d;
    --light-color: #f8f9fa;
    --dark-color: #344050;
    --border-color: #e3ebf6;
    --sidebar-bg: #ffffff;
    --content-bg: #f5f7fa;
    --transition-speed: 0.3s;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    --radius: 0.375rem;
}



/* Reset e Estilos Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #dde2e7; /* Cinza bem claro */
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Garantir que áreas de conteúdo tenham fundo cinza claro */
main, .main-content, .container {
    background-color: transparent; /* Herda o fundo cinza do body */
}

/* Layout Principal */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* SIDEBAR GERAL */
.dashboard-sidebar {
    width: 60px; /* Largura minimizada por padrão */
    background: var(--sidebar-bg);
    position: fixed;
    top: 70px; /* Abaixo do header */
    left: 0; /* Sempre visível */
    bottom: 0; /* Vai até o final da tela, sobrepondo o footer */
    z-index: 9999 !important; /* Força o sidebar a ficar por cima de tudo */
    transition: all var(--transition-speed) ease;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px); /* Apenas abaixo do header */
}

/* Sidebar expandido */
.dashboard-sidebar.show {
    width: 280px;
}

/* NAVEGAÇÃO PRINCIPAL - ocupa o espaço disponível */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}

/* SEÇÃO DE LOGOUT - sempre no final */
.sidebar-logout {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.05);
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logout .logout-btn {
    width: 100%;
    background: none;
    border: none;
    color: #2c7be5;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 0.75rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logout .logout-btn .nav-icon {
    width: 20px;
    text-align: center;
    margin-right: 0;
}

.sidebar-logout .logout-btn:hover {
    background-color: rgba(44, 123, 229, 0.1); /* Azul claro */
    color: #2c7be5; /* Azul */
}


.sidebar-logout .logout-btn .nav-text {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin-left: 0;
    width: 0;
    overflow: hidden;
}

/* Quando sidebar está expandido */
.dashboard-sidebar.show .sidebar-logout .logout-btn {
    justify-content: flex-start;
    padding: 0.75rem 1.5rem;
}

.dashboard-sidebar.show .sidebar-logout .logout-btn .nav-icon {
    margin-right: 1rem;
}

.dashboard-sidebar.show .sidebar-logout .logout-btn .nav-text {
    opacity: 1;
    visibility: visible;
    margin-left: 0.5rem;
    width: auto;
}

/* Textos escondidos quando minimizado */
.dashboard-sidebar .nav-text {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Textos visíveis quando expandido */
.dashboard-sidebar.show .nav-text {
    opacity: 1;
    visibility: visible;
}

/* Ajustar links quando minimizado */
.dashboard-sidebar .nav-link {
    justify-content: flex-start;
    padding: 0.75rem;
    min-height: 50px;
}

.dashboard-sidebar.show .nav-link {
    padding: 0.75rem 1.5rem;
}

/* Centralizar ícones quando minimizado */
.dashboard-sidebar .nav-icon {
    width: 20px;
    text-align: center;
    margin-right: 0.5rem;
}

.dashboard-sidebar.show .nav-icon {
    margin-right: 1rem;
}

/* BOTÃO HAMBÚRGUER PADRÃO */
.sidebar-toggle {
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ÍCONE HAMBÚRGUER */
.sidebar-icon,
.sidebar-icon::before,
.sidebar-icon::after {
    display: block;
    background: #007bff;
    height: 3px;
    width: 24px;
    border-radius: 2px;
    position: relative;
    transition: all 0.3s;
    content: '';
}

.sidebar-icon::before,
.sidebar-icon::after {
    content: '';
    position: absolute;
    left: 0;
}

.sidebar-icon::before {
    top: -8px;
}

.sidebar-icon::after {
    top: 8px;
}

/* BOTÃO FOCUSLESS */
.sidebar-toggle:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* NAVIGATION */
.sidebar-nav {
    padding: 20px 0;
    flex-grow: 1;
}

/* ESTADO - COLAPSADA (DESKTOP) */
.dashboard-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.dashboard-sidebar.collapsed~.dashboard-content {
    margin-left: var(--sidebar-collapsed-width);
}

.dashboard-sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
    position: absolute;
}

.dashboard-sidebar.collapsed .nav-icon {
    margin-right: 0;
    font-size: 1.25rem;
}

.dashboard-sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
    margin: 0 5px;
}

.dashboard-sidebar.collapsed .nav-link.active::before {
    width: 3px;
    height: 100%;
    left: 0;
    top: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.dashboard-sidebar.collapsed .nav-item {
    position: relative;
}

.dashboard-sidebar.collapsed .nav-link:hover .nav-text {
    display: block;
    opacity: 1;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 5px 15px;
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    margin-left: 10px;
    white-space: nowrap;
    z-index: 1000;
    width: auto;
}

/* BOTÕES VISIBILIDADE - MOBILE / DESKTOP */
#toggleSidebarMobile {
    display: block;
    position: fixed;
    left: 10px;
    top: 12px;
    z-index: 1051;
    background: transparent;
    border: none;
    padding: 8px;
}

#toggleSidebarDesktop {
    display: none;
    margin-left: 22px;
    margin-top: 10px;
}

/* MOBILE (ATÉ 992px) */
@media (max-width: 992px) {
    #toggleSidebarMobile {
        display: block;
    }

    #toggleSidebarDesktop {
        display: none;
    }

    .sidebar-icon,
    .sidebar-icon::before,
    .sidebar-icon::after {
        background-color: white;
    }

    .dashboard-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: var(--sidebar-width, 250px);
        background: white;
        z-index: 9999 !important; /* Força o sidebar a ficar por cima de tudo em mobile também */
    }

    .dashboard-sidebar.show {
        transform: translateX(0);
    }

    .dashboard-content {
        margin-left: 0 !important;
    }

    .overlay-active::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1049;
    }
}

/* DESKTOP (993px +) */
@media (min-width: 993px) {
    #toggleSidebarMobile {
        display: none;
    }

    #toggleSidebarDesktop {
        display: block;
    }

    .sidebar-icon,
    .sidebar-icon::before,
    .sidebar-icon::after {
        background-color: #007bff;
    }
}




/*comentation: ################################################## */

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}

.nav-item {
    margin-bottom: 5px;
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--secondary-color);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    border-radius: var(--radius);
    margin: 0 10px;
}

.nav-link:hover {
    background-color: rgba(44, 123, 229, 0.1);
    color: var(--primary-color);
}

.nav-link.active {
    background-color: rgba(44, 123, 229, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.nav-icon {
    font-size: 1.1rem;
    margin-right: 15px;
    width: 24px;
    text-align: center;
    transition: all var(--transition-speed) ease;
}

.nav-text {
    transition: all var(--transition-speed) ease;
    white-space: nowrap;
}

/*  ###########################################################*/

/*  ###########################################################*/

/* Wrapper principal */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    outline: none;
    border: none;
}

.stat-card-link:hover,
.stat-card-link:focus,
.stat-card-link:active {
    text-decoration: none;
    color: inherit;
    outline: none;
    border: none;
}

/* Conteúdo principal */
.dashboard-content {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 32px;
    margin: 24px auto;
    width: calc(100% - 48px);
    max-width: 1200px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dashboard-content:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Título e breadcrumb */
.content-header {
    margin-bottom: 36px;
    padding-bottom: 16px;
    border-bottom: 1px solid #edf2f7;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    color: #3b82f6;
}

.breadcrumb {
    font-size: 14px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb span {
    color: #4a5568;
    font-weight: 500;
}

.breadcrumb .separator {
    color: #cbd5e0;
}

/* Card de boas-vindas */
.welcome-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03) 0%, rgba(59, 130, 246, 0.1) 100%);
    z-index: 0;
}

.welcome-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 56px;
    color: #3b82f6;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.9);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.welcome-card:hover .card-icon {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.2);
}

.card-content {
    flex: 1;
    min-width: 300px;
    position: relative;
    z-index: 1;
}

.card-content h2 {
    font-size: 22px;
    margin: 0 0 12px 0;
    color: #1a202c;
    font-weight: 600;
}

.card-content p {
    color: #4a5568;
    margin-bottom: 16px;
    line-height: 1.5;
    max-width: 600px;
}

.btn-primary {
    background-color: #3b82f6;
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
    z-index: -1;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover::before {
    left: 100%;
}

/* Cards de estatísticas */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 0;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.stat-card.bg-primary {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #f0f7ff 0%, #e1effe 100%);
}

.stat-card.bg-success {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.stat-card.bg-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.stat-card.bg-purple {
    border-left: 4px solid #64748b;
    /* Tailwind slate-500 */
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    /* Tons slate */
}


.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-right: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.stat-card.bg-primary .stat-icon {
    background-color: #3b82f6;
}

.stat-card.bg-success .stat-icon {
    background-color: #10b981;
}

.stat-card.bg-warning .stat-icon {
    background-color: #f59e0b;
}

.stat-card.bg-purple .stat-icon {
    background-color: #64748b;
}

.stat-info {
    position: relative;
    z-index: 1;
}

.stat-info h3 {
    margin: 0;
    font-size: 24px;
    color: #1a202c;
    font-weight: 700;
}

.stat-info p {
    margin: 6px 0 0;
    color: #4a5568;
    font-size: 15px;
    letter-spacing: 0.2px;
}

/* Barra de pesquisa */
.search-container {
    margin-bottom: 32px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 20px 12px 48px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f8fafc;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background-color: #fff;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
}

/* Efeito de onda nos botões e cards */
.wave-effect {
    position: relative;
    overflow: hidden;
}

.wave-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.wave-effect:focus:not(:active)::after {
    animation: wave 0.5s ease-out;
}

@keyframes wave {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }

    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* Responsividade */
@media (max-width: 992px) {
    .dashboard-content {
        padding: 24px;
        margin: 16px auto;
        width: calc(100% - 32px);
    }

    .content-header {
        margin-bottom: 28px;
    }

    .welcome-card {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: 20px;
        margin: 12px auto;
        width: calc(100% - 24px);
    }

    .page-title-patients {
        font-size: 24px;
    }

    .welcome-card {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        padding: 20px;
    }

    .card-icon {
        width: 64px;
        height: 64px;
        font-size: 32px;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .dashboard-content {
        padding: 16px;
    }

    .welcome-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .card-content {
        min-width: auto;
        text-align: center;
    }

    .card-icon {
        margin-right: 0;
        margin-bottom: 16px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .stat-icon {
        margin-right: 0;
        margin-bottom: 16px;
    }
}

/* #############################################*/

.content-header {
    margin-bottom: 30px;
    padding-top: 20px;
}

.page-title {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.75rem;
}

.breadcrumb {
    color: var(--secondary-color);
    font-size: 0.875rem;
    display: flex;
    gap: 8px;
}

.breadcrumb .active {
    color: var(--primary-color);
}

/* Cards */
.welcome-card {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.welcome-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.card-icon {
    background-color: rgba(44, 123, 229, 0.1);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 25px;
    color: var(--primary-color);
    font-size: 2rem;
}

.card-content h2 {
    color: var(--dark-color);
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.5rem;
}

.card-content p {
    color: var(--secondary-color);
    margin-bottom: 20px;
    max-width: 600px;
}



.btn-primary:hover {
    background-color: darken(var(--primary-color), 10%);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.bg-primary {
    background-color: var(--primary-color);
}

.bg-success {
    background-color: #00d97e;
}

.bg-warning {
    background-color: #f6c343;
}

.stat-info h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--dark-color);
    font-weight: 600;
}

.stat-info p {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin: 0;
}




@media (max-width: 768px) {
    .welcome-card {
        flex-direction: column;
        text-align: center;
    }

    .card-icon {
        margin-right: 0;
        margin-bottom: 20px;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }


}

/* Estilo base (todas as telas) */
.page-title-dashboard, .page-title-patients {

    margin-bottom: 1rem;
    width: 100%;
    font-size: 2.0rem;
    /* Tamanho padrão para desktop */
    font-weight: bold;
}

/* Responsivo */
@media (max-width: 768px) {
    .page-title-dashboard, .page-title-patients {
        font-size: 1.5rem;
        /* Tablet */
        font-weight: bold;
    }
}

@media (max-width: 576px) {
    .page-title-dashboard, .page-title-patients {
        font-size: 1.50rem;
        /* Celular */
        padding: 0 15px;
        text-align: center;
        font-weight: bold;
    }
}

/* Animações suaves */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.dashboard-content {
    animation: fadeIn 0.5s ease;
}

/*INICIO DO CSS DAS NOTAS DO PACIENTE
###########################################*/

/* Estilos para as evoluções do paciente */
.progress-notes-list {
    margin-top: 2rem;
}

.progress-notes-list h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #ffffff; /* Fundo branco para destacar do fundo cinza */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Sombra sutil para destacar */
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}



/* Ajustes para os ícones */
.fas.me-2 {
    margin-right: 0.5rem !important;
    color: white !important;
}

.fas.me-1 {
    margin-right: 0.25rem !important;
    /* color: white !important; */
}

/* Botão de adicionar evolução */
.btn-primary {
    background-color: #4299e1;
    border-color: #4299e1;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    margin-top: 1rem;
}

.btn-primary:hover {
    background-color: #3182ce;
    border-color: #3182ce;
}

/* Modal - Ajustes finais */
.modal-content {
    border: none;
    border-radius: 10px;
    overflow: hidden;
}

.modal-header {
    background-color: #007bff;
    color: white;
    border-bottom: none;
    position: relative;
}

.modal-title .fas {
    color: white;
}

.modal-footer {
    border-top: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem;
    gap: 0.75rem;
    /* Espaçamento entre os botões */
}

.modal-footer .btn {
    margin: 0;
    /* Remove margens padrão */
    padding: 0.5rem 1.25rem;
    min-width: 120px;
    /* Largura mínima para consistência */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* Opcional: efeito hover mais pronunciado */
.modal-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Botão de fechar personalizado */
.btn-close-custom {
    position: absolute;
    right: 1.25rem;
    top: 1rem;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    opacity: 0.8;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-custom:hover {
    opacity: 1;
    color: white;
}

/* Remove o contorno azul dos elementos */
*:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Ajuste para o textarea */
.form-control {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
}

.form-control:focus {
    border-color: #a0c4ff;
}

.current-user-info {
    font-size: 0.9rem;
    color: white;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    /* Espaço entre ícone e texto */
}

.current-user-info i {
    margin-right: 0.5rem;
}

/* ############################################*/

/* Estilos base para desktop */
.medication-title,
.medication-schedule-title {
    color: #2c3e50;
    margin-bottom: 1.5rem !important;
    font-weight: 600;
    font-weight: bold;
}

.medication-title {
    text-align: left;
}

.medication-schedule-title {
    text-align: left;
    font-size: 1.6rem;
    font-weight: bold;
}

/* Estilos específicos para a página de agendamentos */
.medication-schedule-container .form-card {
    padding: 1rem;
}

.medication-schedule-container .card-header {
    font-size: 1.2rem;
    padding: 1rem;
}

.medication-schedule-container .list-group-item.p-4 {
    padding: 1.5rem !important;
}

.medication-schedule-container .list-group-item h5 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem !important;
}

.medication-schedule-container .list-group-item p {
    font-size: 1rem;
    margin-bottom: 0.75rem !important;
}

.medication-schedule-container .btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* Responsividade para tablets (768px - 992px) */
@media (max-width: 992px) {

    .medication-title,
    .medication-schedule-title {
        font-size: 1.5rem;
        text-align: center;
    }

    .medication-schedule-container .form-card {
        padding: 0.75rem;
    }

    .medication-schedule-container .card-header {
        font-size: 1.1rem;
        padding: 0.9rem;
    }
}

/* Responsividade para celulares (576px - 768px) */
@media (max-width: 768px) {

    .medication-title,
    .medication-schedule-title {
        font-size: 1.3rem;
        margin-bottom: 1.2rem !important;
        font-weight: bold;
    }

    /* Container principal */
    .medication-schedule-container .form-card {
        padding: 0;
        margin: 0;
        width: 100%;
    }

    /* Cabeçalho */
    .medication-schedule-container .card-header {
        font-size: 1rem;
        padding: 0.75rem;
    }

    /* Itens da lista de pacientes */
    .medication-schedule-container .list-group-item.p-4 {
        padding: 1rem !important;
    }

    /* Nome do paciente e CPF */
    .medication-schedule-container .list-group-item h5 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem !important;
    }

    .medication-schedule-container .list-group-item p {
        font-size: 0.9rem;
        margin-bottom: 0.5rem !important;
    }

    /* Reorganização do container do paciente */
    .medication-schedule-container .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Container do botão de agendamento */
    .medication-schedule-container .d-flex.justify-content-between>div:last-child {
        width: 100%;
        margin-top: 0.75rem;
        display: flex;
        justify-content: center;
    }

    /* Botão de adicionar agendamento */
    .medication-schedule-container .btn-sm.btn-primary {
        width: 100%;
        max-width: 200px;
        padding: 0.4rem 0.5rem;
        font-size: 0.9rem;
        border-radius: 4px;
    }

    /* Ícone do botão */
    .medication-schedule-container .btn-sm.btn-primary i {
        margin-right: 0.3rem;
    }

    /* Itens de medicação */
    .medication-schedule-container .list-group .list-group-item {
        flex-direction: column;
        padding: 0.75rem;
    }

    /* Informações da medicação */
    .medication-schedule-container .list-group-item>div:first-child {
        width: 100%;
        margin-bottom: 0.75rem;
    }

    /* Botões de ação */
    .medication-schedule-container .mt-md-0 {
        margin-top: 0.5rem !important;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .medication-schedule-container .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
        margin: 0 0.25rem;
        flex: 0 0 auto;
    }

    /* Alerta de nenhum agendamento */
    .medication-schedule-container .alert {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
}

/* Responsividade para celulares pequenos (até 576px) */
@media (max-width: 576px) {

    .medication-title,
    .medication-schedule-title {
        font-size: 1.2rem;
        margin-bottom: 1rem !important;
        padding: 0 10px;
        font-weight: bold;
    }

    .medication-schedule-container .d-flex.justify-content-between>div:last-child {
        margin-top: 0.5rem;
    }

    .medication-schedule-container .btn-sm.btn-primary {
        max-width: 180px;
        font-size: 0.85rem;
    }

    .medication-schedule-container .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .medication-schedule-container .list-group-item>div:first-child {
        font-size: 0.85rem;
    }
}



/* Estilo base para o título - Alinhado à esquerda em desktop */
.medication-title {
    text-align: left;
    /* Alterado de center para left */
    color: #333;
    margin-bottom: 1.5rem !important;
}

/* Ajustes para telas médias (tablets) */
@media (max-width: 992px) {
    .medication-title {
        font-size: 1.5rem;
        text-align: center;
        /* Centraliza apenas em tablets */
    }
}

/* Ajustes para telas pequenas (celulares) */
@media (max-width: 768px) {
    .medication-title {
        font-size: 1.3rem;
        margin-bottom: 1.2rem !important;
        text-align: center;
        /* Mantém centralizado em celulares */
    }
}

/* Ajustes para telas muito pequenas */
@media (max-width: 576px) {
    .medication-title {
        font-size: 1.3rem;
        margin-bottom: 1rem !important;
        padding: 0 10px;
        text-align: center;
        /* Mantém centralizado em celulares pequenos */
    }
}

/* Estilo base para o título da página de agendamentos (desktop) */
.medication-schedule-title {
    text-align: left;
    /* Alinhado à esquerda em desktop */
    color: #2c3e50;
    margin-bottom: 1.5rem !important;
    font-weight: 600;
    font-size: 1.6rem;
    /* Tamanho padrão para desktop */
    font-weight: bold;
}

/* Ajustes para telas médias (tablets) */
@media (max-width: 992px) {
    .medication-schedule-title {
        font-size: 1.5rem;
        text-align: center;
        /* Centraliza em tablets */
        font-weight: bold;
    }
}

/* Ajustes para telas pequenas (celulares) */
@media (max-width: 768px) {
    .medication-schedule-title {
        font-size: 1.4rem;
        margin-bottom: 1.3rem !important;
        text-align: center;
        /* Mantém centralizado */
        font-weight: bold;
    }
}

/* Ajustes para telas muito pequenas */
@media (max-width: 576px) {
    .medication-schedule-title {
        font-size: 1.2rem;
        margin-bottom: 1rem !important;
        padding: 0 10px;
        /* Previne que o texto encoste nas bordas */
        text-align: center;
        /* Mantém centralizado */
        font-weight: bold;
    }
}



/* Classe específica para o cabeçalho de pacientes */
.patient-schedule-header strong {
    display: block;
    text-align: left;
    /* Alinhamento padrão (desktop) */
}

/* Apenas ajuste de alinhamento em telas pequenas */
@media (max-width: 768px) {
    .patient-schedule-header strong {
        text-align: center;
        /* Centraliza apenas em mobile */
    }
}

/* Se escolher a Opção 2 */
.bg-soft-primary {
    background-color: #e3f2fd;
    /* Azul bem claro */
}

/* Se escolher a Opção 3 */
.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Estilo adicional para o nome do paciente */
.patient-name {
    color: #2c3e50;
    /* Azul escuro */
    font-weight: 600;
}



.ui-autocomplete {
    position: absolute;
    z-index: 1000;
    cursor: default;
    padding: 0;
    margin-top: 2px;
    list-style: none;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.ui-autocomplete>li {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.ui-autocomplete>li:last-child {
    border-bottom: none;
}

.ui-autocomplete>li:hover {
    background-color: #f5f5f5;
    cursor: pointer;
}

.ui-autocomplete .text-muted {
    color: #6c757d;
    font-size: 0.9em;
    margin-left: 8px;
}


/* Estilo responsivo para botão de ação no log */
@media (max-width: 768px) {
    .log-item {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .log-item button {
        margin-top: 0.5rem;
        align-self: stretch;
        /* opcional: faz o botão ocupar 100% */
    }
}





/* Estilos específicos para a página de produtos */
.products-container {
    padding: 1rem;
}

/* Estilos para a tabela em telas grandes */
.products-container table {
    width: 100%;
    border-collapse: collapse;
}

/* Estilos para a mensagem de nenhum produto */
.products-container .no-patients {
    text-align: center;
    padding: 2rem;
    display: block;
    width: 100%;
}

/* Estilos para botões de ação */
.products-container .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Estilos para botões de incremento/decremento */
.products-container .d-flex.gap-1 {
    gap: 0.25rem !important;
}

/* Título da página */
.product-title {
    font-size: 2rem;
    text-align: left;
}

@media (max-width: 768px) {
    .product-title {
        font-size: 1.5rem;
        text-align: center;
        margin-bottom: 1rem;
    }

    .products-container table,
    .products-container thead,
    .products-container tbody,
    .products-container tr,
    .products-container td {
        display: block;
        width: 100%;
    }

    .products-container thead {
        display: none;
    }

    .products-container tr {
        margin-bottom: 1.5rem;
        border: 1px solid #ddd;
        border-radius: 0.5rem;
        padding: 1rem;
        background: #fff;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        text-align: center;
    }

    .products-container td {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 0;
        border: none;
        border-bottom: 1px solid #e0e0e0;
        margin-bottom: 0.5rem;
    }

    .products-container td::before {
        content: attr(data-label);
        display: block;
        font-weight: bold;
        margin-bottom: 0.25rem;
        color: #333;
    }

    .products-container td:last-child {
        border-bottom: none;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .products-container td:last-child a,
    .products-container td:last-child form {
        display: block;
        width: 100%;
        max-width: 220px;
    }

    .products-container td:last-child a>.btn,
    .products-container td:last-child form button {
        width: 100%;
    }


    /* Estoque com botões alinhados na mesma linha */
    .products-container .estoque-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        width: 100%;
        max-width: 220px;
        margin: 0 auto;
    }

    .products-container .estoque-wrapper span {
        font-weight: 500;
    }

    .products-container .estoque-botoes {
        display: flex;
        gap: 0.25rem;
    }

    /* Ajuste para estoque flex container */
    .products-container .d-flex.align-items-center.justify-content-between.w-100 {
        flex-direction: column;
        align-items: center !important;
        gap: 0.5rem;
    }

    .products-container .d-flex.gap-1.ms-auto {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 768px) {

    /* Garante que o formulário de exclusão também ocupe 100% */
    .products-container td:last-child form {
        width: 100%;
        max-width: 220px;
    }

    .products-container td:last-child form button {
        width: 100%;
    }
}

/* Bloco geral do estoque */
.estoque-bloco {
    border: 1px solid #d1d5db;
    /* cinza claro */
    background-color: #f9fafb;
    /* cinza muito claro */
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
}

/* Texto da quantidade */
.estoque-valor {
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
}

/* Botões */
.estoque-botoes form button {
    min-width: 36px;
    padding: 0.25rem 0.5rem;
    font-weight: bold;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

.estoque-botoes form button:hover {
    background-color: #e2e8f0;
    /* cinza hover */
    border-color: #cbd5e1;
}

/* Cards de Pacientes Mais Ativos - Tamanho Uniforme */
.active-patient-card {
    background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
    border-radius: 15px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 200px; /* Altura mínima fixa */
    max-height: 200px; /* Altura máxima fixa */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden; /* Evita quebra do layout */
}

.active-patient-card:hover {
    border-color: #3B82F6;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.patient-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.patient-info h6 {
    color: #1F2937;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    line-height: 1.3;
    min-height: 2.8rem; /* Altura fixa para nomes */
    max-height: 2.8rem; /* Altura máxima para nomes */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Máximo 2 linhas */
    line-clamp: 2; /* Propriedade padrão para compatibilidade */
    -webkit-box-orient: vertical;
}

.patient-info p {
    color: #059669;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.2;
}

.patient-info p i.fa-notes-medical {
    color: #059669;
    margin-right: 0.25rem;
}

.patient-info small {
    color: #6B7280;
    font-size: 0.85rem;
    line-height: 1.2;
    margin-top: auto; /* Empurra para o final */
}

.patient-info small i.fa-calendar {
    color: #6B7280;
    margin-right: 0.25rem;
}

/* Responsividade para mobile */
@media (max-width: 768px) {
    .active-patient-card {
        min-height: 180px;
        max-height: 180px;
        padding: 1.25rem;
    }
    
    .patient-info h6 {
        font-size: 1rem;
        min-height: 2.4rem;
        max-height: 2.4rem;
    }
    
    .patient-info p {
        font-size: 0.9rem;
    }
    
    .patient-info small {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .active-patient-card {
        min-height: 160px;
        max-height: 160px;
        padding: 1rem;
    }
    
    .patient-info h6 {
        font-size: 0.95rem;
        min-height: 2rem;
        max-height: 2rem;
    }
}