/* ============================================
   SISTEMA DE GESTÃO DE IGREJA
   Stylesheet Customizado
   ============================================ */

/* Variáveis de Cores */
:root {
    /* Cores Principais */
    --primary-color: #5B8DBE;
    --primary-dark: #4A7BA7;
    --primary-light: #7BA8D1;
    --secondary-color: #E8F1F8;
    
    /* Cores de Texto */
    --text-dark: #2C3E50;
    --text-medium: #546E7A;
    --text-light: #78909C;
    
    /* Cores de Fundo */
    --bg-light: #E8ECEF;
    --bg-white: #FFFFFF;
    --bg-content: #F5F7FA;
    --bg-sidebar: #2C3E50;
    --bg-sidebar-hover: #34495E;
    
    /* Cores de Status */
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #F44336;
    --info-color: #2196F3;
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Transições */
    --transition: all 0.3s ease;
}

/* Reset e Configurações Globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-content);
    color: var(--text-dark);
    line-height: 1.6;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background: var(--bg-sidebar);
    padding: 0;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-sidebar-hover) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--bg-sidebar-hover);
    border-radius: var(--radius-sm);
}

.sidebar .logo {
    padding: 0.75rem 1.5rem;
    background: var(--primary-dark);
    color: white;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
    border-bottom: 3px solid var(--primary-color);
}

.sidebar .logo i {
    margin-right: 0.5rem;
    font-size: 1.6rem;
}

.sidebar .logo figure {
    margin: 0;
    padding: 0;
}

.sidebar .logo .logo-img {
    max-width: 140px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.sidebar-nav {
    padding: 1rem 0;
    list-style: none;
}

.sidebar-nav .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.5rem;
    color: #B0BEC5;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: white;
    border-left-color: var(--primary-color);
}

.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,0.08);
    color: white;
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.sidebar-nav .nav-link i {
    margin-right: 0.75rem;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 1rem 1.5rem;
}

.sidebar-heading {
    padding: 0.5rem 1.5rem;
    color: #78909C;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 1rem;
}

.sidebar-submenu {
    background: rgba(0,0,0,0.15);
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav .nav-link[data-bs-toggle="collapse"] {
    cursor: pointer;
}

.sidebar-submenu .nav-link-sub {
    display: flex;
    align-items: center;
    padding: 0.65rem 1.5rem 0.65rem 2.75rem;
    color: #90A4AE;
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.sidebar-submenu .nav-link-sub:hover {
    background: var(--bg-sidebar-hover);
    color: white;
    border-left-color: var(--primary-light);
}

.sidebar-submenu .nav-link-sub.active {
    background: var(--bg-sidebar-hover);
    color: white;
    border-left-color: var(--primary-light);
    font-weight: 500;
}

.sidebar-submenu .nav-link-sub i {
    margin-right: 0.6rem;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-chevron {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.nav-link[aria-expanded="true"] .sidebar-chevron {
    transform: rotate(-180deg);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: var(--transition);
}

.top-navbar {
    background: white;
    padding: 1rem 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.content-wrapper {
    padding: 2rem;
}

/* ============================================
   CARDS E COMPONENTES
   ============================================ */
.card {
    border: 1px solid #D5DCE3;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: var(--transition);
    background: white;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    border-color: #B8C4D0;
}

.card-header {
    background: #F8FAFB;
    border-bottom: 2px solid #E1E8ED;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.card-body {
    padding: 1.5rem;
}

/* Cards de Estatísticas */
.stat-card {
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.stat-card.success {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

.stat-card.warning {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}

.stat-card.info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

/* ============================================
   FORMULÁRIOS
   ============================================ */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid #C5D0DC;
    padding: 0.65rem 1rem;
    transition: var(--transition);
    background-color: #FFFFFF;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 0.25rem rgba(91, 141, 190, 0.15);
}

.form-label {
    font-weight: 600;
    color: #3D4F5C;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-text {
    color: #6B7C8C;
    font-size: 0.85rem;
}

.form-section {
    background: #F8FAFB;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid #E1E8ED;
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid white;
}

/* ============================================
   BOTÕES
   ============================================ */
.btn {
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #388E3C;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 0px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   TABELAS
   ============================================ */
.table-wrapper {
    background: white;
    border-radius: var(--radius-md);
    overflow: visible;
    box-shadow: var(--shadow-sm);
}

/* Garantir que dropdowns apareçam acima da tabela */
.table-wrapper .dropdown-menu {
    z-index: 1050;
    position: absolute;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #F0F4F7;
    color: #3D4F5C;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border: none;
    padding: 1rem;
    border-bottom: 2px solid #D5DCE3;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    color: var(--text-dark);
    border-bottom: 1px solid #E8ECEF;
}

.table tbody tr:hover {
    background: rgba(91, 141, 190, 0.08);
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-table {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* ============================================
   BADGES E STATUS
   ============================================ */
.badge {
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.8rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.badge.bg-success {
    background-color: #4CAF50 !important;
}

.badge.bg-warning {
    background-color: #FF9800 !important;
}

.badge.bg-danger {
    background-color: #F44336 !important;
}

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

/* Variante "soft" (bg-opacity-10 + text-*) usada nas tags de status.
   Sobrescreve o fundo solido acima e garante contraste legivel no texto,
   em qualquer pagina que use esse padrao. */
.badge.bg-success.bg-opacity-10 {
    background-color: rgba(76, 175, 80, 0.12) !important;
    color: #2e7d32 !important;
}

.badge.bg-warning.bg-opacity-10 {
    background-color: rgba(255, 152, 0, 0.12) !important;
    color: #b26a00 !important;
}

.badge.bg-danger.bg-opacity-10 {
    background-color: rgba(244, 67, 54, 0.12) !important;
    color: #c62828 !important;
}

.badge.bg-secondary.bg-opacity-10 {
    background-color: rgba(108, 117, 125, 0.12) !important;
    color: #5a6268 !important;
}

.badge.bg-primary.bg-opacity-10 {
    background-color: rgba(91, 141, 190, 0.12) !important;
    color: var(--primary-color) !important;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.status-badge i {
    font-size: 0.7rem;
}

/* ============================================
   MODAIS
   ============================================ */
.modal-content {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    background: var(--bg-light);
    border-bottom: 2px solid #E0E0E0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 2px solid var(--bg-light);
    padding: 1rem 1.5rem;
}

/* ============================================
   PÁGINA DE LOGIN
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    max-width: 450px;
    width: 100%;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-logo h1 {
    font-size: 1.8rem;
    color: var(--text-dark);
    font-weight: 600;
}

.login-logo p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    background: white;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid #E1E8ED;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.breadcrumb-item a {
    color: var(--text-medium);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-dark);
    font-weight: 500;
}

/* ============================================
   ALERTAS
   ============================================ */
.alert {
    border-radius: var(--radius-sm);
    border: none;
    padding: 1rem 1.25rem;
}

.alert i {
    margin-right: 0.5rem;
}

/* ============================================
   FILTROS E BUSCA
   ============================================ */
.search-filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.search-box {
    position: relative;
}

.search-box input {
    padding-left: 2.5rem;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* ============================================
   DETALHES DE MEMBRO
   ============================================ */
.member-header {
    background: white;
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 2rem;
}

.member-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 600;
    flex-shrink: 0;
}

.member-info h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.info-row {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .top-navbar {
        padding: 1rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .member-header {
        flex-direction: column;
        text-align: center;
    }
    
    .info-row {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ============================================
   UTILITÁRIOS
   ============================================ */
.text-muted {
    color: var(--text-light) !important;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2C3E50;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.divider {
    height: 1px;
    background: var(--bg-light);
    margin: 2rem 0;
}

.mt-custom {
    margin-top: 2rem;
}

.mb-custom {
    margin-bottom: 2rem;
}

/* ============================================
   TABS / ABAS
   ============================================ */
.nav-tabs {
    border-bottom: 2px solid #D5DCE3;
}

.nav-tabs .nav-link {
    color: var(--text-medium);
    border: 1px solid transparent;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    border-color: #E1E8ED #E1E8ED #D5DCE3;
    color: var(--text-dark);
    background-color: #F8FAFB;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: white;
    border-color: #D5DCE3 #D5DCE3 white;
    font-weight: 600;
}

.nav-tabs .nav-link i {
    opacity: 0.7;
}

.nav-tabs .nav-link.active i {
    opacity: 1;
}
