/* ==========================================================================
   1. VARIÁVEIS GLOBAIS & THEME
   ========================================================================== */
:root {
    --primary: #059669;
    --primary-dark: #047857;
    --text: #1E293B;
    --white: #ffffff;

    /* Cores de Fundo (Background) */
    --bg-gradient: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 50%, #e0f2fe 100%);

    /* Variáveis Glassmorphism (Padrão Axis) */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    --glass-blur: blur(12px);
}

/* ==========================================================================
   2. ESTILOS BASE
   ========================================================================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    /* Mantém o gradiente fixo na rolagem */
    color: var(--text);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

h1 {
    color: var(--primary);
    margin-bottom: 20px;
}

h2 {
    font-size: 1.2rem;
    color: #64748B;
    margin-bottom: 15px;
}

/* ==========================================================================
   3. LAYOUT GERAL E CONTAINERS (GLASS)
   ========================================================================== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    border-radius: 12px;
    /* Cantos um pouco mais arredondados para o vidro */

    /* Aplicação do Glassmorphism */
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.container-sm {
    max-width: 600px;
}

.container-md {
    max-width: 800px;
}

.container-lg {
    max-width: 1100px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* ==========================================================================
   4. BOTÕES & FORMULÁRIOS
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    /* Pequeno efeito de elevação */
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-secondary {
    background-color: #94A3B8;
}

.btn-secondary:hover {
    background-color: #64748B;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(255, 255, 255, 0.9);
    /* Inputs levemente transparentes */
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

textarea {
    height: 100px;
    resize: vertical;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Botões Outline Padronizados (Pílula) */
.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 8px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
    transform: translateY(-2px);
}

.btn-outline-primary i {
    margin-right: 8px;
    /* Espaçamento padrão para os ícones */
}

/* ==========================================================================
   5. UTILITÁRIOS
   ========================================================================== */
.text-muted {
    color: #64748B;
}

/* ==========================================================================
   6. HEADER COMPARTILHADO (PÚBLICO E ADMIN)
   ========================================================================== */
.shared-header {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);

    position: sticky;
    top: 20px;
    z-index: 1000;
    padding: 10px 30px;
    margin: 20px auto 40px auto;
    width: calc(100% - 40px);
    /* Garante que fique "comprido" com margem nas laterais */
    max-width: 1400px;
    /* Limite para monitores muito gigantes */
    border-radius: 50px;
    /* Mantém o formato arredondado Oval */

    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.shared-header-left,
.shared-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 64px;
    width: auto;
}

.admin-header-divider {
    color: #6b7280;
    font-size: 1rem;
    padding-left: 15px;
    border-left: 1px solid #cbd5e1;
}

/* Overlay de Logout */
.logout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.logout-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.logout-content {
    background: rgba(255, 255, 255, 0.8);
    padding: 30px 50px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* ==========================================================================
   7. MENU DROPDOWN DO USUÁRIO (PADRÃO GLOBAL)
   ========================================================================== */
.profile-dropdown-wrapper {
    position: relative;
    display: inline-block;
    margin-left: 10px;
    padding-left: 15px;
    border-left: 1px solid var(--glass-border);
}

.profile-trigger {
    background: rgba(255, 255, 255, 0.6);
    /* Borda de 1px, usando o verde primário mas com 30% de opacidade para ficar suave */
    border: 1px solid rgba(5, 150, 105, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 5px 12px 5px 15px;
    border-radius: 50px;
    /* 'all 0.3s ease' garante que a cor, sombra e o movimento sejam animados juntos */
    transition: all 0.3s ease;
    text-align: right;
    font-family: inherit;
}

.profile-trigger:hover {
    background: #ffffff;
    /* Fica 100% sólido/branco para destacar do vidro do fundo */
    border-color: rgba(5, 150, 105, 0.6);
    /* Borda ganha um pouco mais de cor */
    transform: translateY(-2px);
    /* Efeito tátil: o botão "levanta" em direção ao mouse */
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.25);
    /* Sombra mais ampla e visível */
}

.profile-info-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.profile-name {
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 600;
}

.profile-company {
    font-size: 0.75rem;
    color: #64748b;
}

/* Estilo para a Foto do Google */
.profile-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    background-color: #f1f5f9;
}

/* O Menu Flutuante - SEM TRANSPARÊNCIA */
.profile-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 115%;
    background: #ffffff;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    /* Sombra mais destacada */
    border-radius: 8px;
    min-width: 220px;
    z-index: 1000;
    animation: fadeInDown 0.2s ease-out;
}

.profile-dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    background-color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: #64748b;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

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

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

.dropdown-item.text-danger {
    color: #ef4444;
}

.dropdown-item.text-danger i {
    color: #ef4444;
}

.dropdown-item.text-danger:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

/* ==========================================================================
   8. MENU DE NAVEGAÇÃO CONTEXTUAL (NAV MENU)
   ========================================================================== */

/* ── Wrapper e Trigger ── */
.nav-menu-wrapper {
    position: relative;
    display: inline-block;
}

.nav-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 8px 18px;
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-menu-trigger:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
    transform: translateY(-2px);
}

/* Chevron rotaciona ao abrir */
.nav-chevron {
    font-size: 0.7rem;
    transition: transform 0.25s ease;
}

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

/* Cor do ícone de hambúrguer herda do botão */
.nav-menu-trigger i:first-child {
    font-size: 0.95rem;
}

/* ── Dropdown do Menu ── */
.nav-menu-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    min-width: 230px;
    z-index: 1001;
    padding: 6px 0;
    animation: navMenuFadeIn 0.18s ease-out;
    overflow: hidden;
}

.nav-menu-dropdown.show {
    display: block;
}

@keyframes navMenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Label de Seção dentro do Menu ── */
.nav-menu-section-label {
    display: block;
    padding: 8px 16px 4px 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    pointer-events: none;
    user-select: none;
}

/* ── Item Ativo (página atual) ── */
.nav-menu-dropdown .dropdown-item.active {
    color: var(--primary);
    background-color: #f0fdf4;
    font-weight: 600;
}

.nav-menu-dropdown .dropdown-item.active i {
    color: var(--primary);
}

/* ── Garante que o dropdown de perfil não seja coberto ── */
.profile-dropdown-wrapper {
    z-index: 1000;
}

/* ==========================================================================
   TOAST NOTIFICATION (GLASS)
   ========================================================================== */
.glass-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--primary);
    box-shadow: 0 10px 40px rgba(5, 150, 105, 0.25);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 9999;
    max-width: 380px;
    animation: slideInToast 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast-icon {
    background: var(--primary);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
}

.toast-content strong {
    display: block;
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 4px;
}

.toast-content p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: auto;
    padding: 5px;
    transition: all 0.2s;
    border-radius: 50%;
}

.toast-close:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

@keyframes slideInToast {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOutToast {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(120%);
    }
}