/* ========================================
   ELOFLOW - ESTILOS PRINCIPAIS
   ======================================== */

/* ESTILOS CRÍTICOS INLINE - MOVIDOS DO INDEX.HTML */
body {
    font-family: 'Poppins', sans-serif !important;
    background-color: #d9d9d9 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Sidebar crítico */
#sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 300px !important;
    height: 100vh !important;
    background: linear-gradient(180deg, #001c28 0%, #001018 100%) !important;
    z-index: 1000 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
}

.app-container {
    margin-left: 300px !important;
    min-height: 100vh !important;
    background-color: #d9d9d9 !important;
}

@media (min-width: 768px) {
    #sidebar {
        left: 0 !important;
        display: flex !important;
        transform: translateX(0) !important;
    }

    .app-container {
        margin-left: 300px !important;
    }
}

@media (max-width: 767px) {
    #sidebar {
        transform: translateX(-100%) !important;
    }

    #sidebar.active,
    #sidebar.open {
        transform: translateX(0) !important;
    }

    .app-container {
        margin-left: 0 !important;
    }
}

/* Limita tamanho de todas as logos */
img.logo:not(.logo-full),
.logo:not(.logo-full),
img[src*="logo"]:not(.logo-full) {
    max-width: 40px !important;
    max-height: 40px !important;
    width: 40px !important;
    height: 40px !important;
    object-fit: contain !important;
}

/* Logo completa na sidebar */
.logo-full {
    width: 81% !important;
    max-width: 81% !important;
    height: auto !important;
    max-height: 138px !important;
    object-fit: contain !important;
}

/* Garante que seções ocultas não apareçam */
section.hidden {
    display: none !important;
}

/* Forçar tamanho correto dos ícones do menu */
.nav-icon,
.nav-item svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    flex-shrink: 0 !important;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 300px;
    height: 100vh;
    background: linear-gradient(180deg, #001c28 0%, #001018 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: visible;
    min-width: 0;
}

.nav-icon {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    flex-shrink: 0;
    color: currentColor;
}

/* Garantir que SVGs dentro de nav-item tenham tamanho correto */
.nav-item svg.nav-icon,
.nav-item .nav-icon {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #d4a94d;
}

.nav-item.active {
    background: rgba(212, 169, 77, 0.1);
    color: #d4a94d;
    border-left-color: #d4a94d;
}

.nav-item {
    position: relative;
}

.notification-badge {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #f97316;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.notification-badge.hidden {
    display: none;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    width: 100%;
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.2);
}

/* App Container */
.app-container {
    margin-left: 300px;
    min-height: 100vh;
    background-color: #d9d9d9;
}

/* Header */
header {
    background: white;
    padding: 16px 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s;
}

.menu-btn:hover {
    background: #f0f0f0;
}

.header-title {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
    color: #001c28;
}

/* Main Content */
.main-content {
    padding: 24px;
}

/* Garantir que modais fiquem ocultos por padrão */
#patientModal.hidden,
#userSettingsModal.hidden,
#inboxModal.hidden,
#recordingConsentModal.hidden,
#loadingOverlay.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Garantir que classes Tailwind funcionem mesmo se CDN falhar */
.grid {
    display: grid !important;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
}

.gap-6 {
    gap: 1.5rem !important;
}

.gap-4 {
    gap: 1rem !important;
}

.mb-6 {
    margin-bottom: 1.5rem !important;
}

.mb-4 {
    margin-bottom: 1rem !important;
}

.bg-white {
    background-color: white !important;
}

.rounded-xl {
    border-radius: 0.75rem !important;
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.p-6 {
    padding: 1.5rem !important;
}

.p-4 {
    padding: 1rem !important;
}

.p-3 {
    padding: 0.75rem !important;
}

.flex {
    display: flex !important;
}

.items-center {
    align-items: center !important;
}

.justify-center {
    justify-content: center !important;
}

.ml-4 {
    margin-left: 1rem !important;
}

.text-sm {
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
}

.text-2xl {
    font-size: 1.5rem !important;
    line-height: 2rem !important;
}

.text-xl {
    font-size: 1.25rem !important;
    line-height: 1.75rem !important;
}

.font-medium {
    font-weight: 500 !important;
}

.font-semibold {
    font-weight: 600 !important;
}

.rounded-full {
    border-radius: 9999px !important;
}

.h-64 {
    height: 16rem !important;
}

/* Responsive Grid */
@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
    
    .lg\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .app-container {
        margin-left: 0;
    }
    
    .menu-btn {
        display: block;
    }
}

/* Sections */
section {
    display: none;
}

section.active {
    display: block !important;
}

section.hidden {
    display: none !important;
}

/* Garantir que seções com classe hidden do Tailwind também funcionem */
.hidden {
    display: none !important;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: #27ae60;
    color: white;
}

.notification.error {
    background: #e74c3c;
    color: white;
}

.notification.warning {
    background: #f39c12;
    color: white;
}

.notification.info {
    background: #3498db;
    color: white;
}

/* Dashboard Cards - Forçar 5 cards em uma única linha */
#dashboardSection .grid.grid-cols-5 {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 1rem;
}

@media (max-width: 1024px) {
    #dashboardSection .grid.grid-cols-5 {
        grid-template-columns: repeat(5, minmax(180px, 1fr)) !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    #dashboardSection .grid.grid-cols-5 {
        grid-template-columns: repeat(5, minmax(150px, 1fr)) !important;
    }
}

/* Sistema de Notificações de Eventos */
#notificationsContainer {
    position: relative;
}

#notificationBadge {
    font-size: 10px;
    line-height: 1;
    min-width: 18px;
    padding: 2px 4px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

#notificationsDropdown {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

#notificationsList {
    max-height: 400px;
}

#notificationsList > div {
    transition: background-color 0.2s;
}

#notificationsList > div:hover {
    background-color: #f9fafb !important;
}

/* Botões de visualização da agenda */
.agenda-view-btn {
    transition: all 0.2s ease;
}

.agenda-view-btn.active {
    background-color: #001c28;
    color: white;
}

.agenda-view-btn:not(.active) {
    color: #6b7280;
}

.agenda-view-btn:not(.active):hover {
    background-color: #f3f4f6;
}
