/* Sistema Psicossocial - Estilos Principais */

:root {
    --primary-color: #a59d52;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --sidebar-width: 300px;
}

/* Custom Classes for Template Styles */
.password-help-list {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.progress-thin {
    height: 4px;
}

.progress-medium {
    height: 8px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Sidebar Layout */
body.sidebar-layout {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #0052cc  0%,  var(--primary-color) 100%);
    color: white;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h4 {
    margin: 0;
    color: white;
    font-weight: 600;
}

.sidebar-logo {
    max-width: 100%;     /* nunca ultrapassa a largura da sidebar */
    height: auto;        /* mantém a proporção original */
    display: block;      /* evita espaços indesejados */
    margin: 0 auto;      /* centraliza dentro da sidebar */
    scale: 1.1;
    filter: brightness(1.2) contrast(1.2);
    transition: all 0.3s ease;
}

.sidebar-logo:hover {
    transform: scale(1.1);
    filter: brightness(1.3) contrast(1.3);
}

.sidebar-content {
    padding: 1.5rem 1rem;
}

/* Sidebar Footer (Logout) */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-footer .btn {
    border-radius: 8px;
    font-weight: 600;
}


/* User Info */
.user-info {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 1.5rem 0;
    text-align: left;
    /* deixa tudo alinhado */
}

.user-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.user-name {
    color: white;
    word-break: break-word;
    /* quebra se for muito grande */
    font-size: 1rem;
}

.user-groups {
    font-size: 0.85rem;
    line-height: 1.2;
}

.avatar-circle {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

/* Sidebar Navigation */
.sidebar-nav {
    --bs-nav-pills-border-radius: 8px;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.sidebar-nav .nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.sidebar-nav .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
}

.nav-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
    border: none;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease-in-out;
}

/* Top Bar */
.topbar {
    background: white;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

/* Navegação de módulos na topbar */
.module-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.module-nav .btn {
    border-radius: 6px;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
}


/* Page Content */
.page-content {
    padding: 1.5rem;
}

/* Mobile Responsiveness */


/* Cards personalizados */
.card-metric {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.metric-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--dark-color);
}

.metric-label {
    font-size: 0.875rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status badges */
.status-pendente {
    background-color: var(--warning-color);
}

.status-atribuido {
    background-color: var(--info-color);
}

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

.status-concluido {
    background-color: var(--success-color);
}

.status-cancelado {
    background-color: var(--danger-color);
}

/* Progress bars */
.progress {
    height: 8px;
    border-radius: 4px;
}

/* Buttons */
.btn-floating {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Tables */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
}

/* Navigation */
.navbar-brand i {
    color: #ffd700;
}

/* Responsive utilities */
@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }


    .topbar {
        padding: 0.75rem 1rem;
    }

    .page-content {
        padding: 1rem;
    }

    .btn-floating {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Questionário público */
.question-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

.scale-option {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.scale-option:hover {
    border-color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.05);
}

.scale-option.selected {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

.progress-bar-survey {
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
}

.notification-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    /* escondido por padrão */
    width: 350px;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease-in-out;
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

.notification-sidebar.open {
    right: 0;
    /* aparece */
}

.notification-header {
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

/* Estilos para notificações no offcanvas */
#notificationSidebar .notification-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

#notificationSidebar .notification-item:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#notificationSidebar .notification-item.unread {
    border-left: 4px solid var(--primary-color);
    background: #f8f9fa;
}

#notificationSidebar .notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: #212529;
}

#notificationSidebar .notification-message {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 8px;
    line-height: 1.4;
}

#notificationSidebar .notification-meta {
    font-size: 0.75rem;
}

#notificationSidebar .badge {
    font-size: 0.7rem;
}

/* Badge de contagem no botão */
#notificationButton .badge {
    font-size: 0.6rem;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Offcanvas customizado */
.offcanvas-end {
    width: 380px !important;
}

@media (max-width: 768px) {
    .offcanvas-end {
        width: 100% !important;
    }
}

/* Loading spinner */
#notificationList .spinner-border-sm {
    width: 1rem;
    height: 1rem;
}