@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap');

:root {
    /* Paleta Oficial - União Brasil */
    --primary: #002A7F; /* Azul Escuro Oficial */
    --primary-light: #EBF2FF; /* Azul bem claro para fundos */
    --secondary: #FFD500; /* Amarelo Vibrante Oficial */
    --tertiary: #0056CC; /* Azul intermediário para gradientes */
    
    /* Cores de Status UI */
    --success: #10b981;
    --danger: #f43f5e;
    --warning: #f59e0b;
    
    /* Estrutura */
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.90); /* Efeito Vidro base */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: rgba(226, 232, 240, 0.9);
    
    /* Gradientes Institucionais */
    --gradient-primary: linear-gradient(135deg, #002A7F, #0056CC);
    --gradient-login: linear-gradient(-45deg, #001B54, #002A7F, #0044A6, #002A7F);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* Scrollbar Customizada e Elegante */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Elementos de Decoração Coloridos no Fundo (Blobs) com as cores do partido */
body::before {
    content: '';
    position: fixed;
    top: -10%; right: -10%;
    width: 40vw; height: 40vw;
    background: var(--secondary); /* Blob Amarelo */
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}
body::after {
    content: '';
    position: fixed;
    bottom: -10%; left: -10%;
    width: 40vw; height: 40vw;
    background: var(--tertiary); /* Blob Azul */
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

/* =======================================
   TELA DE LOGIN
======================================= */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-bg { 
    background: var(--gradient-login);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    height: 100vh; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 20px; 
}

.login-container { 
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%; 
    max-width: 420px; 
    border-radius: 30px; 
    padding: 40px 25px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.3); 
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.logo-area { text-align: center; margin-bottom: 30px; }
.logo-area i { 
    font-size: 50px; 
    background: var(--gradient-primary); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    margin-bottom: 15px; 
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}
.logo-area h1 { font-size: 1.8rem; font-weight: 900; letter-spacing: -0.5px; color: #002A7F; }
.logo-area p { color: var(--text-muted); font-size: 0.95rem; margin-top: 5px; font-weight: 500; }

.tabs-login { 
    display: flex; 
    background: rgba(226, 232, 240, 0.6); 
    border-radius: 15px; 
    margin-bottom: 25px; 
    padding: 6px; 
}
.tabs-login .tab-btn { 
    flex: 1; 
    padding: 12px; 
    border: none; 
    background: transparent; 
    border-radius: 12px; 
    font-weight: 700; 
    color: var(--text-muted); 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    cursor: pointer;
}
.tabs-login .tab-btn.active { 
    background: #ffffff; 
    color: var(--primary); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.08); 
}

/* =======================================
   ESTRUTURA DO APP & HEADER/SIDEBAR
======================================= */
.app-header {
    background: var(--gradient-primary); 
    color: white; 
    padding: 15px 25px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    position: fixed; 
    top: 0; 
    width: 100%; 
    z-index: 100; 
    box-shadow: 0 4px 20px rgba(0,42,127,0.15);
}
.header-left { display: flex; align-items: center; gap: 18px; }
.hamburger-btn { 
    background: rgba(255,255,255,0.15); 
    border: none; 
    color: white; 
    font-size: 1.2rem; 
    cursor: pointer; 
    padding: 8px 12px; 
    border-radius: 10px;
    transition: background 0.3s;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.25); }
.btn-logout {
    background: rgba(255,255,255,0.15); 
    border: none; 
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}
.btn-logout:hover { background: rgba(255,255,255,0.25); }

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6); 
    backdrop-filter: blur(5px);
    z-index: 1000;
    visibility: hidden; opacity: 0; transition: all 0.3s ease;
}
.sidebar-overlay.show { visibility: visible; opacity: 1; }

/* Sidebar Menu */
.sidebar {
    position: fixed; top: 0; left: -300px; width: 290px; height: 100%;
    background: rgba(255, 255, 255, 0.95); 
    backdrop-filter: blur(20px);
    z-index: 1001; 
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    display: flex; flex-direction: column;
}
.sidebar.open { left: 0; }
.sidebar-header {
    background: var(--gradient-primary); 
    color: white; 
    padding: 30px 20px 20px 20px;
    display: flex; flex-direction: column; gap: 12px;
    border-bottom-right-radius: 30px;
}
.sidebar-header .avatar {
    background: rgba(255,255,255,0.2); 
    width: 60px; height: 60px; 
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center; 
    font-size: 1.6rem; margin-bottom: 5px;
    border: 2px solid rgba(255,255,255,0.4);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    color: var(--secondary); /* Ícone de usuário em amarelo */
}
.sidebar-header h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 2px; }
.sidebar-header p { font-size: 0.85rem; opacity: 0.9; font-weight: 500; }

.sidebar-nav { padding: 25px 0; flex: 1; overflow-y: auto; }
.sidebar-link {
    display: flex; align-items: center; gap: 15px; padding: 15px 25px;
    color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 1rem;
    transition: all 0.3s ease;
    margin: 0 15px 5px 15px;
    border-radius: 15px;
}
.sidebar-link i { 
    width: 24px; text-align: center; font-size: 1.2rem; 
    color: var(--text-muted); transition: all 0.3s ease;
}
.sidebar-link:hover, .sidebar-link.active { 
    background: var(--primary-light); 
    color: var(--primary); 
    box-shadow: 0 4px 10px rgba(0, 42, 127, 0.05);
}
.sidebar-link:hover i, .sidebar-link.active i { 
    color: var(--primary); 
    transform: scale(1.1);
}
.sidebar-link.text-danger { color: var(--danger); margin-top: 30px; }
.sidebar-link.text-danger i { color: var(--danger); }
.sidebar-link.text-danger:hover { background: #ffe4e6; }

.app-content { margin-top: 70px; padding: 25px 20px; min-height: calc(100vh - 70px); }
.section-title { 
    font-size: 1.4rem; 
    font-weight: 800; 
    margin-bottom: 20px; 
    color: var(--primary); 
    position: relative;
}
/* Sublinhado decorativo na seção usando o amarelo do partido */
.section-title::after {
    content: '';
    position: absolute;
    left: 0; bottom: -6px;
    width: 50px; height: 4px;
    background: var(--secondary);
    border-radius: 10px;
}
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Botões */
.btn-sm { 
    background: white; 
    border: 1px solid var(--border); 
    border-radius: 10px; 
    padding: 10px 14px; 
    color: var(--text-main); 
    font-weight: 600;
    cursor: pointer; 
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.btn-sm:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.05); }

.btn-primary { 
    background: var(--gradient-primary); 
    color: white; 
    border: none; 
    padding: 16px; 
    border-radius: 16px; 
    font-size: 1.1rem; 
    font-weight: 700; 
    cursor: pointer; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 10px; 
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 42, 127, 0.2);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0, 42, 127, 0.3); }
.btn-primary:active { transform: scale(0.97); }
.btn-block { width: 100%; }

/* =======================================
   FORMULÁRIOS & CARDS
======================================= */
.card-form { 
    background: var(--card-bg); 
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 24px; 
    padding: 25px; 
    box-shadow: 0 10px 30px -5px rgba(0,0,0,0.05); 
}

.input-group { margin-bottom: 20px; }
.input-group label { 
    display: flex; justify-content: space-between; align-items: center; 
    font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; color: #334155; 
}
.input-group input[type="text"], .input-group input[type="tel"], 
.input-group input[type="password"], .input-group input[type="search"], 
.input-group select, .input-group input[type="date"], .input-group input[type="number"] {
    width: 100%; padding: 15px; border: 2px solid var(--border); 
    border-radius: 14px; font-size: 1rem; font-weight: 500;
    background-color: rgba(255,255,255,0.7); appearance: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}
.input-group input:focus, .input-group select:focus { 
    outline: none; border-color: var(--primary); 
    background-color: #ffffff; box-shadow: 0 0 0 4px var(--primary-light); 
}
.password-container { position: relative; display: flex; align-items: center; }
.password-container input { padding-right: 45px !important; }
.toggle-password { position: absolute; right: 18px; cursor: pointer; color: var(--text-muted); font-size: 1.2rem; transition: color 0.3s; }
.toggle-password:hover { color: var(--primary); }

.checkbox-group { 
    display: flex; align-items: center; gap: 12px; 
    background: var(--primary-light); padding: 15px; 
    border-radius: 14px; border: 1px solid rgba(0,42,127,0.1);
}
.checkbox-group label { margin-bottom: 0; color: var(--primary); font-weight: 700; font-size: 0.95rem; }
.checkbox-group input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--primary); cursor: pointer; }

/* Badges e Search */
.badge-vaga { font-size: 0.75rem; padding: 4px 10px; border-radius: 12px; font-weight: 700; background: #e2e8f0; color: #475569; }
.badge-vaga.status-ok { background: #d1fae5; color: #059669; }
.badge-vaga.status-full { background: #fee2e2; color: #dc2626; }

.search-box { position: relative; margin-bottom: 20px; }
.search-box i { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--primary); font-size: 1.1rem; }
.search-box input[type="search"] { 
    width: 100%; padding: 16px 16px 16px 48px; border-radius: 16px; 
    border: 2px solid transparent; box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    font-size: 1rem; font-weight: 500; background: #ffffff; transition: all 0.3s;
    box-sizing: border-box;
}
.search-box input[type="search"]:focus { border-color: var(--primary); box-shadow: 0 4px 20px rgba(0,42,127,0.1); }

/* Listagem de Equipe (Cards Livres) */
.equipe-card { 
    background: var(--card-bg); backdrop-filter: blur(10px);
    border-radius: 20px; padding: 20px; margin-bottom: 15px; 
    box-shadow: 0 8px 20px -5px rgba(0,0,0,0.05); 
    border-left: 5px solid var(--secondary); /* Destaque amarelo na lateral dos cards */
    transition: transform 0.2s ease;
}
.equipe-card:hover { transform: translateY(-3px); }

.tag { font-size: 0.75rem; padding: 4px 12px; border-radius: 20px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.tag-pago { background: #d1fae5; color: #059669; border: 1px solid #34d399; }
.tag-vol { background: #fef3c7; color: #d97706; border: 1px solid #fbbf24; }
.status-full { border: 1px solid #f87171; }

/* TOAST E MODAIS */
.toast { 
    position: fixed; top: 30px; left: 50%; transform: translateX(-50%) translateY(-150px); 
    padding: 14px 28px; border-radius: 30px; color: white; font-size: 1rem; font-weight: 700; 
    z-index: 9999; transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); white-space: nowrap; display: flex; align-items: center; gap: 10px;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

.alert-error { 
    background: #fee2e2; color: #dc2626; padding: 12px; 
    border-radius: 12px; text-align: center; font-size: 0.9rem; font-weight: 600;
    margin-top: 15px; border: 1px solid #fca5a5; box-shadow: 0 4px 6px rgba(220, 38, 38, 0.1);
}

.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(8px); 
    z-index: 1000; display: flex; align-items: center; justify-content: center;
    padding: 15px;
}
.modal-overlay.hidden { display: none; }
.modal-content { 
    background: #ffffff; width: 100%; max-width: 420px; 
    max-height: 90vh; /* FIX: Restringe o modal ao tamanho da tela e evita sumir nos cantos */
    overflow-y: auto; /* FIX: Permite que o conteúdo interno do modal seja rolado */
    border-radius: 24px; padding: 25px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); 
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes modalPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* TABELAS */
.table-container { 
    background: var(--card-bg); backdrop-filter: blur(10px);
    border-radius: 20px; box-shadow: 0 10px 30px -5px rgba(0,0,0,0.05); 
    overflow-x: auto; border: 1px solid rgba(255,255,255,0.6); margin-bottom: 25px; 
}
.data-table { 
    width: 100%; 
    border-collapse: collapse; 
    word-break: break-word; /* FIX: Evita quebra de layout de nomes muito grandes e rolagem horizontal */
}
.data-table th { 
    background-color: var(--primary); color: white; 
    font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
    padding: 12px 10px; /* FIX: Reduzido espaçamento horizontal das tabelas */
    text-align: left; 
}
/* Arredondamento do cabeçalho da tabela */
.data-table thead tr th:first-child { border-top-left-radius: 18px; }
.data-table thead tr th:last-child { border-top-right-radius: 18px; }

.data-table td { 
    padding: 12px 10px; border-bottom: 1px solid var(--border); /* FIX: Reduzido espaçamento das células */
    font-size: 0.95rem; color: var(--text-main); vertical-align: middle; 
}
.data-table tr { transition: background 0.2s ease; }
.data-table tr:hover td { background-color: rgba(241, 245, 249, 0.8); }
.data-table tr:last-child td { border-bottom: none; }

/* =======================================
   SELECT2 CUSTOMIZATION
======================================= */
.select2-container--default .select2-selection--single {
    height: auto !important;
    padding: 13px 15px !important; 
    border: 2px solid var(--border) !important;
    border-radius: 14px !important;
    background-color: rgba(255,255,255,0.7) !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    display: flex;
    align-items: center;
    outline: none;
    transition: all 0.3s ease;
}
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--primary) !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 4px var(--primary-light) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-main) !important;
    line-height: normal !important;
    padding-left: 0 !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    right: 15px !important;
}
.select2-dropdown {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15) !important;
    overflow: hidden;
    z-index: 9999 !important; 
}
.select2-search__field {
    border-radius: 10px !important;
    border: 2px solid var(--border) !important;
    padding: 12px !important;
}
.select2-search__field:focus {
    outline: none !important;
    border-color: var(--primary) !important;
}
.select2-results__option {
    padding: 12px 15px !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    border-bottom: 1px solid #f1f5f9;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--gradient-primary) !important;
    color: white !important;
}

/* =======================================
   UTILITÁRIOS & CORES EXTRA
======================================= */
/* Gradiente especial para destaque nos paineis */
.highlight-panel {
    background: var(--gradient-primary);
    color: white;
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 25px rgba(0,42,127, 0.2);
}
.highlight-panel h2 { color: var(--secondary) !important; font-size: 1.4rem; font-weight: 800; margin-bottom: 10px; }
.highlight-panel p, .highlight-panel div { color: rgba(255,255,255,0.9) !important; }

/* =======================================
   SWITCH TOGGLE (CONTROLE ALOCAÇÃO)
======================================= */
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(24px); }


/* ANIMAÇÕES DA TARJA DE LANCHE (URGÊNCIA) */
@keyframes pulseLancheMedium {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    50% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes pulseLancheDanger {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
    50% { transform: scale(1.03); box-shadow: 0 0 0 15px rgba(220, 38, 38, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

@keyframes shakeAlert {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.tarja-lanche {
    background: var(--warning); 
    color: white; 
    padding: 20px; 
    border-radius: 12px; 
    margin-bottom: 20px; 
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.5s ease;
}

.tarja-lanche.medium-alert {
    animation: pulseLancheMedium 2s infinite;
    background: #f97316; /* Laranja */
}

.tarja-lanche.danger-alert {
    animation: pulseLancheDanger 1.5s infinite, shakeAlert 5s infinite;
    background: var(--danger); /* Vermelho */
}