/* Estilos globais para o sistema DeMolay - Tema Cinza Puro */
:root {
    --color-background: #0a0a0a;
    --color-foreground: #fafafa;
    --color-card: #1a1a1a;
    --color-card-foreground: #fafafa;
    --color-primary: #4b5563;
    --color-primary-foreground: #ffffff;
    --color-secondary: #2a2a2a;
    --color-secondary-foreground: #fafafa;
    --color-muted: #2a2a2a;
    --color-muted-foreground: #a3a3a3;
    --color-accent: #9ca3af;
    --color-accent-foreground: #ffffff;
    --color-destructive: #dc2626;
    --color-destructive-foreground: #fafafa;
    --color-border: #3a3a3a;
    --color-input: #2a2a2a;
    --color-ring: #d1d5db;
    --radius: 1.5rem;
}

/* ============================================
   TEMA CAPÍTULO - Tons de Vinho DeMolay
   ============================================ */
body.tema-capitulo {
    --color-primary: #4c090b;
    --color-primary-foreground: #ffffff;
    --color-accent: #a31d45;
    --color-accent-foreground: #ffffff;
    --color-ring: #4c090b;
}

body.tema-capitulo .btn-primary:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

body.tema-capitulo .btn-secondary:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

body.tema-capitulo .page-title {
    background: linear-gradient(to right, #4c090b, #a31d45) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

body.tema-capitulo .btn-icon:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

body.tema-capitulo .tab-trigger.active {
    background-color: #4c090b !important;
}

/* ============================================
   TEMA PRIORADO - Tons de Verde Escuro
   ============================================ */
body.tema-priorado {
    --color-primary: #0f5132;
    --color-primary-foreground: #ffffff;
    --color-accent: #198754;
    --color-accent-foreground: #ffffff;
    --color-ring: #0f5132;
}

body.tema-priorado .btn-primary:hover {
    background-color: #198754 !important;
}

body.tema-priorado .btn-secondary:hover {
    background-color: #198754 !important;
}

body.tema-priorado .page-title {
    background: linear-gradient(to right, #0f5132, #198754) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

body.tema-priorado .btn-icon:hover {
    background-color: #0f5132 !important;
}

body.tema-priorado .tab-trigger.active {
    background-color: #0f5132 !important;
}

/* ============================================
   TEMA BETHEL - Tons de Roxo
   ============================================ */
body.tema-bethel {
    --color-primary: #5a2d82;
    --color-primary-foreground: #ffffff;
    --color-accent: #8b5cb5;
    --color-accent-foreground: #ffffff;
    --color-ring: #5a2d82;
}

body.tema-bethel .btn-primary:hover {
    background-color: #8b5cb5 !important;
}

body.tema-bethel .btn-secondary:hover {
    background-color: #8b5cb5 !important;
}

body.tema-bethel .page-title {
    background: linear-gradient(to right, #5a2d82, #8b5cb5) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

body.tema-bethel .btn-icon:hover {
    background-color: #5a2d82 !important;
}

body.tema-bethel .tab-trigger.active {
    background-color: #5a2d82 !important;
}

/* ============================================
   TEMA CASTELO - Tons de Azul
   ============================================ */
body.tema-castelo {
    --color-primary: #0b3d91;
    --color-primary-foreground: #ffffff;
    --color-accent: #1e6bb8;
    --color-accent-foreground: #ffffff;
    --color-ring: #0b3d91;
}

body.tema-castelo .btn-primary:hover {
    background-color: #1e6bb8 !important;
}

body.tema-castelo .btn-secondary:hover {
    background-color: #1e6bb8 !important;
}

body.tema-castelo .page-title {
    background: linear-gradient(to right, #0b3d91, #1e6bb8) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

body.tema-castelo .btn-icon:hover {
    background-color: #0b3d91 !important;
}

body.tema-castelo .tab-trigger.active {
    background-color: #0b3d91 !important;
}

/* ============================================
   TEMA ASSEMBLEIA - Tons de Dourado
   ============================================ */
body.tema-assembleia {
    --color-primary: #8b6914;
    --color-primary-foreground: #ffffff;
    --color-accent: #d4af37;
    --color-accent-foreground: #000000;
    --color-ring: #8b6914;
}

body.tema-assembleia .btn-primary:hover {
    background-color: #d4af37 !important;
    color: #000000 !important;
}

body.tema-assembleia .btn-secondary:hover {
    background-color: #d4af37 !important;
    color: #000000 !important;
}

body.tema-assembleia .page-title {
    background: linear-gradient(to right, #8b6914, #d4af37) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

body.tema-assembleia .btn-icon:hover {
    background-color: #8b6914 !important;
    color: #ffffff !important;
}

body.tema-assembleia .tab-trigger.active {
    background-color: #8b6914 !important;
}

/* ============================================
   TEMA CLARO - Fundo cinza quase branco
   ============================================ */
html.tema-claro {
    --color-background: #f5f4f2;
    --color-foreground: #1a1a1a;
    --color-card: #ffffff;
    --color-card-foreground: #1a1a1a;
    --color-secondary: #eeecea;
    --color-secondary-foreground: #1a1a1a;
    --color-muted: #e8e6e3;
    --color-muted-foreground: #444444;
    --color-accent: #9ca3af;
    --color-accent-foreground: #1a1a1a;
    --color-border: #dddbd8;
    --color-input: #f0eeeb;
    --color-ring: #c0a23d;
}

html.tema-claro .stacked-card.card-1 { background-color: #e8e6e3; }
html.tema-claro .stacked-card.card-2 { background-color: #f0eeeb; }
html.tema-claro .form-input[type="date"] { color-scheme: light; }
html.tema-claro .user-dropdown-menu {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--color-background);
    color: var(--color-foreground);
    line-height: 1.6;
}

.container {
    margin-left: auto;
    margin-right: auto;
    max-width: 1400px;
    width: 100%;
    padding: 0 1.5rem;
}

/* Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.page-title {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(to right, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--color-muted-foreground);
    font-size: 1.125rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1;
    box-sizing: border-box;
}

/* Garante que <button class="btn"> tenha a mesma altura que <a class="btn"> */
button.btn {
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
}

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

    .btn-primary:hover {
        background-color: #e5e7eb;
        color: #1f2937;
    }

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-secondary-foreground);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

.btn-icon {
    padding: 0.5rem;
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

.btn-icon:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

/* Cards */
.card {
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.card.overflow-visible {
    overflow: visible;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-card-foreground);
}

.card-description {
    color: var(--color-muted-foreground);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.card-content {
    padding: 1.5rem;
}

/* Tabs */
.tabs {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.icon-header {
    width: 5rem;
    padding-top: 0.5rem;
    padding-bottom: 1rem;
}

.icon-inline {
    width: 1.5em;
    height: 1.5em;
    vertical-align: -0.15em;
}

.tabs-list {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem;
    list-style: none;
    background-color: var(--color-secondary);
    border-radius: var(--radius);
    width: fit-content;
}

.tab-trigger {
    padding: 0.5rem 1.25rem;
    background-color: transparent;
    border: none;
    color: var(--color-muted-foreground);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    border-bottom: none;
}

.tab-trigger:hover {
    color: #1f2937;
    background-color: #d1d5db;
}

.tab-trigger.active {
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
    box-shadow: 0 2px 10px rgba(75, 85, 99, 0.3);
    border-bottom-color: transparent;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    border-bottom: 1px solid var(--color-border);
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.table tbody tr:hover {
    background-color: var(--color-muted);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
}

.badge-gold {
    background-color: #fbbf24;
    color: #000;
}

.badge-silver {
    background-color: #d1d5db;
    color: #000;
}

.badge-bronze {
    background-color: #cd7f32;
    color: #fff;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-foreground);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background-color: var(--color-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-foreground);
    font-size: 0.875rem;
    transition: all 0.2s;
}
.form-select option {
    background-color: var(--color-card); /* Fundo escuro */
    color: var(--color-foreground); /* Texto claro */
    padding: 0.5rem 1rem;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.1);
}

.form-input::placeholder {
    color: var(--color-muted-foreground);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-muted-foreground);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
}

    .modal-close:hover {
        background-color: var(--color-muted);
        color: var(--color-foreground);
    }

.progress-container {
    margin-bottom: 1rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.progress-label {
    color: var(--color-foreground);
}

.progress-value {
    color: var(--color-muted-foreground);
}

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background-color: var(--color-secondary);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--color-primary), var(--color-accent));
    transition: width 0.3s ease;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.stat-card {
    background-color: var(--color-secondary);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-primary);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

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

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .table-container {
        font-size: 0.875rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
.btn-destructive {
    background-color: var(--color-destructive);
    color: var(--color-destructive-foreground);
}

.btn-destructive:hover {
    background-color: #b91c1c;
}

/* Botão de perfil no header */
.btn-profile {
    background-color: var(--color-secondary);
    border: 1px solid var(--color-accent) !important;
    border-radius: 50% !important;
    padding: 0.35rem !important;
    color: var(--color-accent);
    width: 2.1rem;
    height: 2.1rem;
}

.btn-profile:hover {
    background-color: var(--color-accent) !important;
    color: var(--color-accent-foreground) !important;
    border-color: var(--color-accent) !important;
}

.btn-profile .icon-inline {
    filter: brightness(1.4);
}

/* ============================================
   CUSTOM SELECT COM BUSCA
   ============================================ */
.custom-select-wrapper {
    position: relative;
    z-index: 100;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    background-color: var(--color-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-foreground);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.custom-select-trigger:hover,
.custom-select-trigger.active {
    border-color: var(--color-primary);
}

.custom-select-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-arrow {
    margin-left: 0.75rem;
    font-size: 0.7rem;
    opacity: 0.6;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.custom-select-trigger.active .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    max-height: 260px;
    overflow-y: auto;
    display: none;
    z-index: 10001;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.custom-select-dropdown.active {
    display: block;
}

.custom-select-search {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: none;
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-secondary);
    color: var(--color-foreground);
    font-size: 0.875rem;
    outline: none;
    border-radius: var(--radius) var(--radius) 0 0;
}

.custom-select-search:focus {
    background-color: var(--color-muted);
}

.custom-select-options {
    padding: 0.25rem 0;
}

.custom-select-option {
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.15s;
}

.custom-select-option:hover {
    background-color: var(--color-muted);
}

.custom-select-option.selected {
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
    font-weight: 600;
}

.custom-select-option.hidden {
    display: none;
}

.main-header {
    padding: 0 0;
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-card);
}

.logo-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-foreground);
    text-decoration: none;
}

.logo-title:hover {
    color: var(--color-primary);
}

.main-nav {
    display: flex;
    gap: 0.5rem;
}

.main-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
    color: var(--color-muted-foreground);
    text-align: center;
    margin-top: 3rem;
}

.text-danger {
    color: var(--color-destructive);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}
.welcome-message {
    color: var(--color-muted-foreground);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ========================================
   USER PROFILE DROPDOWN
   ======================================== */

.user-profile-dropdown {
    position: relative;
    display: inline-block;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--color-foreground);
}

.user-profile-trigger:hover {
    background: var(--color-muted);
    border-color: var(--color-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-border);
}

.user-name-desktop {
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    color: var(--color-muted-foreground);
}

.user-profile-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 280px;
    max-width: 320px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    animation: dropdownSlideIn 0.2s ease;
    overflow: hidden;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--color-muted) 0%, var(--color-card) 100%);
}

.dropdown-header-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
    border-radius: var(--radius) var(--radius) 0 0;
}

.dropdown-header-link:hover {
    background: linear-gradient(135deg, var(--color-muted) 0%, rgba(192, 162, 61, 0.12) 100%);
    color: inherit;
}

.dropdown-header-link .dropdown-user-subtitle {
    color: var(--color-primary);
    font-size: 0.78rem;
}

.dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dropdown-user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-foreground);
}

.dropdown-user-subtitle {
    font-size: 0.8rem;
    color: var(--color-muted-foreground);
}

.dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0.5rem 0;
}

.dropdown-section {
    padding: 0.5rem 0;
}

.dropdown-section-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-muted-foreground);
    letter-spacing: 0.05em;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--color-foreground);
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--color-muted);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--color-muted-foreground);
    font-size: 1rem;
}

.dropdown-item-accent {
    color: var(--color-accent);
    font-weight: 500;
}

.dropdown-item-accent i {
    color: var(--color-accent);
}

.dropdown-item-danger {
    color: var(--color-destructive);
}

.dropdown-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.dropdown-item-danger i {
    color: var(--color-destructive);
}

.dropdown-form {
    margin: 0;
}

/* Responsivo */
@media (max-width: 768px) {
    .user-name-desktop {
        display: none;
    }

    .user-dropdown-menu {
        min-width: 260px;
    }
}

@media (max-width: 480px) {
    .user-dropdown-menu {
        position: fixed;
        top: auto;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        min-width: 0;
    }
}

/* ======================================== */


.stacked-cards-container {
    position: relative;
    width: 100%;
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.stacked-card {
    position: absolute;
    width: 85%;
    max-width: 350px;
    padding: 1.5rem;
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-out;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.stacked-card.card-1 {
    z-index: 1; /* Fica atr�s das outras */
    transform: translate(-55%, -55%) rotate(-6deg); /* Desloca e rotaciona */
    background-color: #111; /* Opcional: Fundo um pouco mais escuro */
}
W
.stacked-card.card-2 {
    z-index: 2; /* Fica acima da card-1 */
    transform: translate(-48%, -52%) rotate(3deg); /* Desloca e rotaciona diferente */
    background-color: #161616; /* Opcional: Fundo intermedi�rio */
}

.stacked-card.card-3 {
    z-index: 3; /* Fica na frente de todas */
    /* N�o precisa de transform adicional, j� est� centralizada por padr�o */
}

.stacked-cards-container:hover .stacked-card.card-3 {
    transform: translate(-50%, -55%) scale(1.02); /* Sobe um pouco e aumenta levemente */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.stacked-cards-container:hover .stacked-card.card-1 {
    transform: translate(-57%, -57%) rotate(-8deg); /* Exagera o efeito no fundo */
}

.stacked-cards-container:hover .stacked-card.card-2 {
    transform: translate(-46%, -50%) rotate(5deg); /* Exagera o efeito no meio */
}

/* Estilos para o conte�do dentro da caixa (Exemplo) */
.stacked-card h3 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.stacked-card p {
    color: var(--color-muted-foreground);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.checkbox-wrapper-44 input[type="checkbox"] {
    display: none;
    visibility: hidden;
}

.checkbox-wrapper-44 *,
.checkbox-wrapper-44 *::before,
.checkbox-wrapper-44 *::after {
    box-sizing: border-box;
}

.checkbox-wrapper-44 .toggleButton {
    cursor: pointer;
    display: block;
    transform-origin: 50% 50%;
    transform-style: preserve-3d;
    transition: transform 0.14s ease;
}

    .checkbox-wrapper-44 .toggleButton:active {
        transform: rotateX(30deg);
    }

    .checkbox-wrapper-44 .toggleButton input + div {
        border: 3px solid rgba(0, 0, 0, 0.2);
        background-color: white;
        border-radius: 60%;
        position: relative;
        width: 42px;
        height: 42px;
    }

        .checkbox-wrapper-44 .toggleButton input + div svg {
            fill: none;
            stroke-width: 3.6;
            stroke: #000;
            stroke-linecap: round;
            stroke-linejoin: round;
            width: 44px;
            height: 44px;
            display: block;
            position: absolute;
            left: -3px;
            top: -3px;
            right: -3px;
            bottom: -3px;
            z-index: 1;
            stroke-dashoffset: 124.6;
            stroke-dasharray: 0 162.6 133 29.6;
            transition: all 0.4s ease 0s;
        }

        .checkbox-wrapper-44 .toggleButton input + div:before,
        .checkbox-wrapper-44 .toggleButton input + div:after {
            content: "";
            width: 3px;
            height: 16px;
            background: #000;
            position: absolute;
            left: 50%;
            top: 50%;
            border-radius: 5px;
        }

        .checkbox-wrapper-44 .toggleButton input + div:before {
            opacity: 0;
            transform: scale(0.3) translate(-50%, -50%) rotate(45deg);
            -webkit-animation: bounceInBefore-44 0.3s linear forwards 0.3s;
            animation: bounceInBefore-44 0.3s linear forwards 0.3s;
        }

        .checkbox-wrapper-44 .toggleButton input + div:after {
            opacity: 0;
            transform: scale(0.3) translate(-50%, -50%) rotate(-45deg);
            -webkit-animation: bounceInAfter-44 0.3s linear forwards 0.3s;
            animation: bounceInAfter-44 0.3s linear forwards 0.3s;
        }

    .checkbox-wrapper-44 .toggleButton input:checked + div svg {
        stroke-dashoffset: 162.6;
        stroke-dasharray: 0 162.6 28 134.6;
        transition: all 0.4s ease 0.2s;
    }

    .checkbox-wrapper-44 .toggleButton input:checked + div:before {
        opacity: 0;
        transform: scale(0.3) translate(-50%, -50%) rotate(45deg);
        -webkit-animation: bounceInBeforeDont-44 0.3s linear forwards 0s;
        animation: bounceInBeforeDont-44 0.3s linear forwards 0s;
    }

    .checkbox-wrapper-44 .toggleButton input:checked + div:after {
        opacity: 0;
        transform: scale(0.3) translate(-50%, -50%) rotate(-45deg);
        -webkit-animation: bounceInAfterDont-44 0.3s linear forwards 0s;
        animation: bounceInAfterDont-44 0.3s linear forwards 0s;
    }

@-webkit-keyframes bounceInBefore-44 {
    0% {
        opacity: 0;
        transform: scale(0.3) translate(-50%, -50%) rotate(45deg);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.1) translate(-50%, -50%) rotate(45deg);
    }

    80% {
        opacity: 1;
        transform: scale(0.89) translate(-50%, -50%) rotate(45deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) translate(-50%, -50%) rotate(45deg);
    }
}

@keyframes bounceInBefore-44 {
    0% {
        opacity: 0;
        transform: scale(0.3) translate(-50%, -50%) rotate(45deg);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.1) translate(-50%, -50%) rotate(45deg);
    }

    80% {
        opacity: 1;
        transform: scale(0.89) translate(-50%, -50%) rotate(45deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) translate(-50%, -50%) rotate(45deg);
    }
}

@-webkit-keyframes bounceInAfter-44 {
    0% {
        opacity: 0;
        transform: scale(0.3) translate(-50%, -50%) rotate(-45deg);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.1) translate(-50%, -50%) rotate(-45deg);
    }

    80% {
        opacity: 1;
        transform: scale(0.89) translate(-50%, -50%) rotate(-45deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) translate(-50%, -50%) rotate(-45deg);
    }
}

@keyframes bounceInAfter-44 {
    0% {
        opacity: 0;
        transform: scale(0.3) translate(-50%, -50%) rotate(-45deg);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.1) translate(-50%, -50%) rotate(-45deg);
    }

    80% {
        opacity: 1;
        transform: scale(0.89) translate(-50%, -50%) rotate(-45deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) translate(-50%, -50%) rotate(-45deg);
    }
}

@-webkit-keyframes bounceInBeforeDont-44 {
    0% {
        opacity: 1;
        transform: scale(1) translate(-50%, -50%) rotate(45deg);
    }

    100% {
        opacity: 0;
        transform: scale(0.3) translate(-50%, -50%) rotate(45deg);
    }
}

@keyframes bounceInBeforeDont-44 {
    0% {
        opacity: 1;
        transform: scale(1) translate(-50%, -50%) rotate(45deg);
    }

    100% {
        opacity: 0;
        transform: scale(0.3) translate(-50%, -50%) rotate(45deg);
    }
}

@-webkit-keyframes bounceInAfterDont-44 {
    0% {
        opacity: 1;
        transform: scale(1) translate(-50%, -50%) rotate(-45deg);
    }

    100% {
        opacity: 0;
        transform: scale(0.3) translate(-50%, -50%) rotate(-45deg);
    }
}

@keyframes bounceInAfterDont-44 {
    0% {
        opacity: 1;
        transform: scale(1) translate(-50%, -50%) rotate(-45deg);
    }

    100% {
        opacity: 0;
        transform: scale(0.3) translate(-50%, -50%) rotate(-45deg);
    }
}

.btn-text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-muted-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.4rem 1rem;
    transition: all 0.2s;
}

    .btn-text-link:hover {
        color: var(--color-foreground);
        text-decoration: underline;
    }

.form-input[type="date"] {
    color-scheme: dark;
}

.form-input[type="date"],
.form-input[type="date"]::placeholder {
    color: var(--color-foreground);
    opacity: 1;
}

.form-input[type="date"]::-webkit-input-placeholder {
    color: var(--color-muted-foreground);
}

.form-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.form-input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.profile-page-container {
  min-height: 100vh;
  background: var(--color-background);
  padding: 2rem 1rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-foreground);
  margin: 0;
  max-width: 100%;
}

/* Profile Card */
.profile-card {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* Profile Header */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
  padding-bottom: 3rem;
  margin-bottom: 3rem;
  border-bottom: 2px solid var(--color-border);
}

@media (min-width: 640px) {
  .profile-header {
    flex-direction: row;
    align-items: center;
  }
}

/* Avatar with accent color border */
.avatar-container {
  flex-shrink: 0;
}

.avatar-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
}

.avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.3;
}

.avatar-content {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--color-secondary);
  border-radius: 50%;
  border: 4px solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(163, 29, 69, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.avatar-content:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(163, 29, 69, 0.6);
}

.avatar-initials {
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-foreground);
  letter-spacing: 0.05em;
}

/* Profile name and status with accent color */
.profile-info {
  flex-grow: 1;
}

.profile-name {
  font-size: 3rem;
  font-weight: 800;
  color: var(--color-accent);
  line-height: 1.2;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

.profile-status {
  font-size: 1.25rem;
  color: var(--color-accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-label {
  opacity: 0.9;
}

.status-value {
  padding: 0.25rem 0.75rem;
  background: rgba(163, 29, 69, 0.15);
  border-radius: 0.5rem;
  border: 1px solid var(--color-accent);
}

/* Section Header */
.section-header {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-foreground);
  margin: 0 0 1rem 0;
}

.section-divider {
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), transparent);
  border-radius: 2px;
}

/* Data Grid */
.data-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .data-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .data-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Data Field */
.data-field {
  padding: 1.5rem;
  background: var(--color-input);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 0.6);
  transition: all 0.3s ease;
}

.data-field:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  border-color: var(--color-muted-foreground);
}

.editable-field:hover {
  border-color: var(--color-accent);
  background: rgba(163, 29, 69, 0.05);
}

.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-muted-foreground);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Field input with foreground color instead of accent */
.field-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-foreground);
  font-size: 1rem;
  font-weight: 500;
  padding: 0;
  outline: none;
}

.field-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.locked-icon {
  color: var(--color-muted-foreground);
  background: rgba(163, 163, 163, 0.1);
}

.edit-icon {
  color: var(--color-accent);
  background: rgba(163, 29, 69, 0.1);
  cursor: pointer;
}

.edit-icon:hover {
  background: rgba(163, 29, 69, 0.2);
  transform: scale(1.1);
}

.field-description {
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-style: italic;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

/* Responsive Design */
@media (max-width: 640px) {
  .profile-card {
    padding: 2rem 1.5rem;
  }

  .profile-name {
    font-size: 2rem;
  }

  .avatar-wrapper {
    width: 120px;
    height: 120px;
  }

  .avatar-initials {
    font-size: 2.5rem;
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

.funcoes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.funcao-label {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-foreground);
    margin-bottom: 0.75rem;
}

/* ============================================
   FOOTER STICKY - Sempre no Final da Página
   ============================================ */
html, body {
    height: 100%;
    margin: 0;
}

.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1 0 auto;
}

.site-content main {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* ============================================
   FOOTER STYLING
   ============================================ */
.main-footer {
    flex-shrink: 0;
    background-color: var(--color-card);
    border-top: 1px solid var(--color-border);
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 1.5rem;
    align-items: start;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    align-items: center;
}

.footer-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-foreground);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.footer-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-foreground);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.footer-text {
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
    margin: 0.2rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}

.footer-disclaimer {
    font-size: 0.8rem;
    color: var(--color-muted-foreground);
    font-style: italic;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.footer-icon {
    flex-shrink: 0;
}

.footer-link {
    color: var(--color-muted-foreground);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--color-foreground);
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--color-muted-foreground);
    margin: 0;
}

/* Responsividade do Footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .main-footer {
        padding: 1.5rem 0 0.75rem;
        margin-top: 2rem;
    }
}
    display: block;
}

.funcao-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--color-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: visible;
}

.funcao-select-wrapper .icon {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-foreground);
    padding: 0 1.25rem;
    border-right: 1px solid var(--color-border);
}

.funcao-select-wrapper .form-select {
    flex: 1;
    border: none;
    background-color: transparent;
    padding-left: 1.25rem;
    font-size: 1rem;
    font-weight: 500;
}

.funcao-select-wrapper .custom-select-wrapper {
    position: relative;
}

.funcao-select-wrapper .form-select:focus {
    box-shadow: none;
    border-color: transparent;
}

.ts-control {
    background-color: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

.ts-control.focus {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.ts-dropdown {
    background-color: #ffffff !important;
    border: 1px solid #ced4da !important;
    color: #212529 !important;
    z-index: 1050 !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.ts-dropdown .active {
    background-color: #e9ecef !important;
    color: #1e2125 !important;
}

.ts-dropdown .optgroup-header {
    color: #6c757d;
    background-color: #f8f9fa;
}

.ts-control > .item {
    color: #212529 !important; /* Preto/Cinza escuro padrão do Bootstrap */
}

.select2-container--default .select2-selection--single {
    height: auto;
    min-height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal;
    padding-left: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 8px;
}

.select2-dropdown {
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #3b82f6;
}

/* Limita a altura do dropdown */
.select2-results__options {
    max-height: 300px;
    overflow-y: auto;
}

/* Estilo para o campo de pesquisa */
.select2-search--dropdown .select2-search__field {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background-color: var(--color-input);
    color: var(--color-foreground);
    cursor: pointer;
    min-height: 38px;
    transition: all 0.2s;
}

    .custom-select-trigger:hover {
        border-color: var(--color-muted-foreground);
    }

    .custom-select-trigger.active {
        border-color: var(--color-primary);
        box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.1);
    }

.custom-select-value {
    flex: 1;
    color: var(--color-foreground);
    font-size: 0.875rem;
}

.custom-select-arrow {
    margin-left: 0.5rem;
    color: var(--color-muted-foreground);
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.custom-select-trigger.active .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: none;
}

    .custom-select-dropdown.active {
        display: block;
    }

.custom-select-search {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: none;
    border-bottom: 1px solid var(--color-border);
    outline: none;
    font-size: 0.875rem;
    background-color: var(--color-input);
    color: var(--color-foreground);
    transition: all 0.2s;
}

    .custom-select-search::placeholder {
        color: var(--color-muted-foreground);
    }

    .custom-select-search:focus {
        border-bottom-color: var(--color-primary);
        background-color: var(--color-input);
    }

.custom-select-options {
    max-height: 300px;
    overflow-y: auto;
}

.custom-select-option {
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s;
    color: var(--color-foreground);
    font-size: 0.875rem;
}

    .custom-select-option:hover {
        background-color: var(--color-secondary);
    }

    .custom-select-option.selected {
        background-color: var(--color-primary);
        color: var(--color-primary-foreground);
        font-weight: 500;
    }

    .custom-select-option.hidden {
        display: none;
    }

/* Scrollbar customizada para o tema DeMolay */
.custom-select-options::-webkit-scrollbar {
    width: 8px;
}

.custom-select-options::-webkit-scrollbar-track {
    background: var(--color-background);
}

.custom-select-options::-webkit-scrollbar-thumb {
    background: var(--color-muted-foreground);
    border-radius: 4px;
}

    .custom-select-options::-webkit-scrollbar-thumb:hover {
        background: var(--color-primary);
    }

/* ============================================
   SIDEBAR LATERAL ANIMADO
   ============================================ */
.admin-layout-container {
    display: flex;
    min-height: calc(100vh - 200px);
    position: relative;
}

.admin-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background-color: var(--color-card);
    border-left: 1px solid var(--color-border);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.3);
}

.admin-sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background-color: var(--color-card);
    z-index: 10;
}

/* ============================================
   DROPDOWN SELETOR DE ENTIDADE
   ============================================ */
.entity-selector-dropdown {
    padding: 1rem;
    border-bottom: 2px solid var(--color-border);
    background-color: var(--color-card);
}

.entity-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background-color: var(--color-input);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.entity-selector-header:hover {
    background-color: var(--color-secondary);
    border-color: var(--color-primary);
}

.entity-selector-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--color-foreground);
    flex: 1;
    overflow: hidden;
}

.entity-selector-label i {
    color: var(--color-primary);
    font-size: 1rem;
    flex-shrink: 0;
}

.entity-selector-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-selector-arrow {
    color: var(--color-muted-foreground);
    font-size: 0.875rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.entity-selector-arrow.open {
    transform: rotate(180deg);
}

.entity-selector-panel {
    margin-top: 0.5rem;
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.entity-search-container {
    position: relative;
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.entity-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    background-color: var(--color-input);
    border: 1px solid var(--color-border);
    border-radius: 0.375rem;
    color: var(--color-foreground);
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.entity-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: var(--color-secondary);
}

.entity-search-input::placeholder {
    color: var(--color-muted-foreground);
}

.entity-search-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted-foreground);
    font-size: 0.875rem;
    pointer-events: none;
}

.entity-list-container {
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
}

.entity-list-container::-webkit-scrollbar {
    width: 8px;
}

.entity-list-container::-webkit-scrollbar-track {
    background: var(--color-input);
}

.entity-list-container::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.entity-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-muted-foreground);
}

.entity-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.entity-item:hover {
    background-color: var(--color-secondary);
}

.entity-item.active {
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
}

.entity-item-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.entity-item-info {
    flex: 1;
    overflow: hidden;
}

.entity-item-name {
    font-weight: 500;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-item-type {
    font-size: 0.75rem;
    color: var(--color-muted-foreground);
    margin-top: 0.125rem;
}

.entity-item.active .entity-item-type {
    color: var(--color-primary-foreground);
    opacity: 0.9;
}

.entity-item-badge {
    background-color: var(--color-accent);
    color: var(--color-accent-foreground);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.entity-loading,
.entity-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--color-muted-foreground);
}

.entity-loading i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.entity-empty {
    font-size: 0.875rem;
}

/* Oculta o resumo de validação quando não há erros */
.validation-summary-valid {
    display: none !important;
}
    z-index: 10;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-foreground);
    margin: 0;
}

.sidebar-close-btn {
    background: transparent;
    border: none;
    color: var(--color-muted-foreground);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: all 0.2s;
    font-size: 1.5rem;
    line-height: 1;
}

.sidebar-close-btn:hover {
    background-color: var(--color-secondary);
    color: var(--color-foreground);
}

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

/* ── Busca no sidebar ── */
.sidebar-search-wrapper {
    padding: 0 1rem 0.75rem;
}

.sidebar-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.sidebar-search-input {
    width: 100%;
    background: var(--color-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.45rem 2rem 0.45rem 2rem;
    font-size: 0.82rem;
    color: var(--color-foreground);
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
}

.sidebar-search-input::placeholder {
    color: var(--color-muted-foreground);
}

.sidebar-search-input:focus {
    border-color: var(--color-accent);
    background: var(--color-card);
}

.sidebar-search-icon {
    position: absolute;
    left: 0.65rem;
    color: var(--color-muted-foreground);
    font-size: 0.72rem;
    pointer-events: none;
}

.sidebar-search-clear {
    position: absolute;
    right: 0.55rem;
    background: none;
    border: none;
    color: var(--color-muted-foreground);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 0.2rem;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
}

.sidebar-search-clear:hover {
    color: var(--color-foreground);
    background: var(--color-border);
}

.sidebar-no-results {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.5rem 1rem;
    color: var(--color-muted-foreground);
    font-size: 0.82rem;
    text-align: center;
}

.sidebar-no-results i {
    font-size: 1.2rem;
    opacity: 0.5;
}

/* Quando filtragem está ativa: força seções abertas */
.sidebar-content.sidebar-searching .sidebar-menu {
    max-height: none !important;
    overflow: visible !important;
}

/* Destaque no texto encontrado na busca */
.sidebar-menu-text mark {
    background: rgba(156, 163, 175, 0.35);
    color: var(--color-foreground);
    border-radius: 2px;
    padding: 0 1px;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section-title {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-muted-foreground);
    letter-spacing: 0.05em;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.sidebar-section-title:hover {
    color: var(--color-foreground);
}

.section-title-content {
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.section-chevron {
    font-size: 0.65rem;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.sidebar-section.open .section-chevron {
    transform: rotate(180deg);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-section.open .sidebar-menu {
    max-height: 600px;
}

.sidebar-menu-item {
    margin: 0;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: var(--color-foreground);
    text-decoration: none;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
    font-weight: 500;
    font-size: 0.9rem;
}

.sidebar-menu-link:hover {
    background-color: var(--color-secondary);
    border-right-color: var(--color-primary);
    padding-right: 1.75rem;
}

.sidebar-menu-link.active {
    background-color: rgba(75, 85, 99, 0.2);
    border-right-color: var(--color-primary);
    color: var(--color-primary);
}

.sidebar-menu-icon {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
    color: var(--color-muted-foreground);
    transition: color 0.2s;
}

.sidebar-menu-link:hover .sidebar-menu-icon,
.sidebar-menu-link.active .sidebar-menu-icon {
    color: var(--color-primary);
}

.sidebar-menu-text {
    flex: 1;
}

/* Botão de toggle do sidebar */
.sidebar-toggle-btn {
    position: fixed;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 998;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.5rem;
}

.sidebar-toggle-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.sidebar-toggle-btn.hidden {
    transform: translateY(-50%) translateX(100px);
    opacity: 0;
    pointer-events: none;
}

/* Overlay quando sidebar está aberto */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Ajuste do conteúdo principal */
.admin-content {
    flex: 1;
    padding: 2rem;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar customizada para sidebar */
.admin-sidebar::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: var(--color-background);
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: var(--color-muted-foreground);
    border-radius: 3px;
}

.admin-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Tema do sidebar - Cores específicas por tipo de entidade */
body.tema-capitulo .sidebar-menu-link:hover,
body.tema-capitulo .sidebar-menu-link.active {
    border-right-color: #4c090b;
    color: #4c090b;
}

body.tema-capitulo .sidebar-menu-link:hover .sidebar-menu-icon,
body.tema-capitulo .sidebar-menu-link.active .sidebar-menu-icon {
    color: #4c090b;
}

body.tema-priorado .sidebar-menu-link:hover,
body.tema-priorado .sidebar-menu-link.active {
    border-right-color: #0f5132;
    color: #0f5132;
}

body.tema-priorado .sidebar-menu-link:hover .sidebar-menu-icon,
body.tema-priorado .sidebar-menu-link.active .sidebar-menu-icon {
    color: #0f5132;
}

body.tema-bethel .sidebar-menu-link:hover,
body.tema-bethel .sidebar-menu-link.active {
    border-right-color: #5a2d82;
    color: #5a2d82;
}

body.tema-bethel .sidebar-menu-link:hover .sidebar-menu-icon,
body.tema-bethel .sidebar-menu-link.active .sidebar-menu-icon {
    color: #5a2d82;
}

body.tema-castelo .sidebar-menu-link:hover,
body.tema-castelo .sidebar-menu-link.active {
    border-right-color: #0b3d91;
    color: #0b3d91;
}

body.tema-castelo .sidebar-menu-link:hover .sidebar-menu-icon,
body.tema-castelo .sidebar-menu-link.active .sidebar-menu-icon {
    color: #0b3d91;
}

body.tema-assembleia .sidebar-menu-link:hover,
body.tema-assembleia .sidebar-menu-link.active {
    border-right-color: #8b6914;
    color: #8b6914;
}

body.tema-assembleia .sidebar-menu-link:hover .sidebar-menu-icon,
body.tema-assembleia .sidebar-menu-link.active .sidebar-menu-icon {
    color: #8b6914;
}

/* Badge de contadores no sidebar */
.sidebar-badge {
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    background-color: var(--color-accent);
    color: var(--color-accent-foreground);
}

/* Animação de pulsação para o botão toggle */
@keyframes pulse-sidebar {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 12px rgba(75, 85, 99, 0.6), 0 0 20px rgba(75, 85, 99, 0.4);
    }
}

.sidebar-toggle-btn {
    animation: pulse-sidebar 2s ease-in-out infinite;
}

.sidebar-toggle-btn:hover {
    animation: none;
}

/* Animação suave para os ícones do sidebar */
.sidebar-menu-icon i {
    transition: transform 0.2s ease;
}

.sidebar-menu-link:hover .sidebar-menu-icon i {
    transform: scale(1.2);
}

/* Efeito de slide para os itens do menu */
.admin-sidebar.open .sidebar-menu-item {
    animation: slideInRight 0.3s ease-out forwards;
    opacity: 0;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Aplica delay escalonado aos itens do menu */
.admin-sidebar.open .sidebar-menu-item:nth-child(1) { animation-delay: 0.05s; }
.admin-sidebar.open .sidebar-menu-item:nth-child(2) { animation-delay: 0.1s; }
.admin-sidebar.open .sidebar-menu-item:nth-child(3) { animation-delay: 0.15s; }
.admin-sidebar.open .sidebar-menu-item:nth-child(4) { animation-delay: 0.2s; }
.admin-sidebar.open .sidebar-menu-item:nth-child(5) { animation-delay: 0.25s; }
.admin-sidebar.open .sidebar-menu-item:nth-child(6) { animation-delay: 0.3s; }
.admin-sidebar.open .sidebar-menu-item:nth-child(7) { animation-delay: 0.35s; }
.admin-sidebar.open .sidebar-menu-item:nth-child(8) { animation-delay: 0.4s; }
.admin-sidebar.open .sidebar-menu-item:nth-child(9) { animation-delay: 0.45s; }

/* Responsividade */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        max-width: 320px;
    }

    .sidebar-toggle-btn {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
}