/* ==========================================================================
   HANDLE - QUALIFICAÇÃO DE EVENTOS | MAIN CSS
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIÁVEIS E BASE
   -------------------------------------------------------------------------- */
:root {
    --primary: #1f3554;
    --primary-dark: #142338;
    --highlight: #ed0a42;
    --bg-body: #f3f4f6;
    --white: #ffffff;
    --text-main: #1f2937;
    --text-sec: #6b7280;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --sidebar-width: 280px;
    --event-bg: #1f3554;
    --event-light: #e0e7ff;
}

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

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #ffffff;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* --------------------------------------------------------------------------
   2. TIPOGRAFIA E FORMULÁRIOS
   -------------------------------------------------------------------------- */
h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    font-weight: 700;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: var(--text-main);
    font-weight: 600;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    background: #f9fafb;
    transition: 0.2s;
    margin-bottom: 1rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(31, 53, 84, 0.1);
}

/* --------------------------------------------------------------------------
   3. LAYOUT GERAL (HEADER, SIDEBAR E SCREENS)
   -------------------------------------------------------------------------- */
header {
    background: var(--white);
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.logo {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.logo img {
    height: 20px;
    width: auto;
    display: block;
}

.server-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    margin-right: 10px;
    transition: background 0.3s;
}

.server-status.online {
    background: var(--success);
    box-shadow: 0 0 5px var(--success);
}

.server-status.syncing {
    background: var(--warning);
    animation: pulse 1s infinite;
}

.screen {
    display: none;
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding-bottom: 90px;
}

.screen.active {
    display: block;
    animation: fadeUp 0.3s ease-out;
}

.main-content {
    padding: 20px;
    flex: 1;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
    display: none;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.open {
    display: block;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: var(--sidebar-width);
    height: 100%;
    background: var(--white);
    z-index: 99;
    transition: 0.3s ease;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.sidebar-title {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.2rem;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
}

.nav-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.nav-item:hover {
    background: #f0f9ff;
    color: var(--primary);
}

.nav-item i {
    width: 24px;
    text-align: center;
}

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

.nav-item.danger:hover {
    background: #fef2f2;
}

/* --------------------------------------------------------------------------
   4. BOTÕES E COMPONENTES GERAIS
   -------------------------------------------------------------------------- */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

.btn-outline {
    background: transparent;
    border: 1px solid #ccc;
    color: var(--text-sec);
    margin-top: 10px;
}

.btn-outline:hover {
    background-color: #f3f4f6;
    color: var(--text-main);
    border-color: #9ca3af;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background-color: #dc2626;
}

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

.btn-green:hover {
    background-color: #059669;
}

.hamburger-btn {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    color: var(--text-main);
    cursor: pointer;
    padding: 5px;
}

.btn-sm-action {
    background: transparent;
    border: none;
    color: var(--text-sec);
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: 0.2s;
    padding: 5px;
}

.btn-sm-action:hover {
    opacity: 1;
    color: var(--primary);
}

.card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
}

/* --------------------------------------------------------------------------
   5. BADGES E TAGS
   -------------------------------------------------------------------------- */
.user-badge {
    font-size: 0.75rem;
    background: #e0f2fe;
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    float: right;
    margin-left: 10px;
}

.badge-pending {
    background: #fffbeb;
    color: #b45309;
}

.badge-done {
    background: #d1fae5;
    color: #065f46;
}

.category-chip {
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 10px;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: inline-block;
}

.event-chip {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.role-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
    margin-left: 5px;
}

.role-admin {
    background: #fce7f3;
    color: #be185d;
}

.role-manager {
    background: #e0e7ff;
    color: #4338ca;
}

.role-consultant {
    background: #f3f4f6;
    color: #374151;
}

.role-diretor {
    background: #000000;
    color: #ffffff;
}

.count-badge {
    background: #d1fae5;
    color: #065f46;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* --------------------------------------------------------------------------
   6. MÓDULOS ESPECÍFICOS
   -------------------------------------------------------------------------- */

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.home-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
}

.home-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.home-card i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.home-card h3 {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 5px;
}

.user-list-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 10px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #f0f0f0;
}

.event-filter-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    margin-bottom: 1rem;
}

.event-banner {
    background: linear-gradient(135deg, var(--primary) 0%, #142338 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(31, 53, 84, 0.3);
}

.event-card {
    border-left: 5px solid var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}

.event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.event-info-row {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
    flex-wrap: wrap;
}

.event-status-label {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-finished {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

/* --------------------------------------------------------------------------
   ACCORDION - EVENTOS
   -------------------------------------------------------------------------- */
.events-accordion {
    margin-top: 1.5rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.events-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-sec);
    transition: all 0.25s ease;
    font-family: inherit;
}

.events-accordion-header:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #cbd5e1;
    color: var(--text-main);
}

.events-accordion-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.events-accordion-title i {
    font-size: 1rem;
    color: #94a3b8;
}

.events-count-badge {
    background: #e2e8f0;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.events-accordion-chevron {
    font-size: 0.85rem;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.events-accordion.open .events-accordion-chevron {
    transform: rotate(180deg);
}

.events-accordion.open .events-accordion-header {
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom-color: transparent;
}

.events-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 4px;
}

.events-accordion.open .events-accordion-body {
    max-height: 5000px;
    padding: 12px 4px 4px 4px;
}

.doctor-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-left: 5px solid #ccc;
    position: relative;
}

.doctor-card.status-pending {
    border-left-color: var(--warning);
}

.doctor-card.status-done {
    border-left-color: var(--success);
}

.meta-info-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #475569;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.7rem;
    text-transform: uppercase;
    width: 65px;
}

.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
    margin-bottom: 1rem;
}

.radio-option {
    position: relative;
}

.radio-option input {
    position: absolute;
    opacity: 0;
}

.radio-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    height: 100%;
}

.radio-option input:checked+.radio-tile {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
    font-weight: 700;
    box-shadow: 0 0 0 1px var(--primary);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    background: var(--white);
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.calendar-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--primary);
    text-transform: uppercase;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    text-align: center;
}

.calendar-day-name {
    font-weight: bold;
    padding: 5px;
    color: var(--text-sec);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.calendar-day {
    background: white;
    padding: 8px 5px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    position: relative;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: 0.2s;
    overflow: hidden;
    word-wrap: break-word;
}

.calendar-day:hover {
    border-color: var(--primary);
    background: #f0f9ff;
}

.calendar-day.other-month {
    opacity: 0.4;
    background: #f3f4f6;
    cursor: default;
}

.calendar-day.other-month:hover {
    border-color: #e5e7eb;
    background: #f3f4f6;
}

.calendar-day.today {
    border: 2px solid var(--primary);
}

.calendar-day.holiday {
    color: var(--danger);
    font-weight: bold;
}

.calendar-event-pill {
    font-size: 0.65rem;
    color: white;
    padding: 3px 4px;
    border-radius: 4px;
    margin-top: 3px;
    max-width: 100%;
    display: block;
    text-align: left;
    white-space: normal;
    word-break: break-word;
}

.month-list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.month-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: var(--shadow);
}

.month-card:hover {
    border-color: var(--primary);
    background: #f9fafb;
    transform: translateY(-2px);
}

.month-card.current-month {
    border-left: 5px solid var(--primary);
}

.contatos-section {
    margin: 0 auto 30px auto;
    max-width: 1080px;
    text-align: center;
}

.contatos-title {
    color: var(--primary);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 15px;
}

.contatos-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 15px 20px;
}

.contato-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
}

.contato-divider {
    width: 1px;
    background-color: #e5e7eb;
    margin: 10px 15px;
}

.contato-tipo {
    color: var(--highlight);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.contato-nome {
    color: var(--primary);
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px;
}

.contato-email,
.contato-tel {
    color: var(--text-sec);
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
}

.contato-email a,
.contato-tel a,
.regiao-info a,
.contato-email,
.contato-tel {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.contato-email a:hover,
.contato-tel a:hover,
.regiao-info a:hover,
.contato-email:hover,
.contato-tel:hover {
    color: var(--highlight);
}

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1080px;
    margin: 0 auto;
}

.mapa-box {
    padding: 10px;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

.mapa-box:active {
    cursor: grabbing;
}

.zoom-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
    background-color: #f9fafb;
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    position: relative;
    z-index: 10;
}

.zoom-container label {
    font-weight: 800;
    color: var(--highlight);
    font-size: 14px;
    text-transform: uppercase;
}

.zoom-slider {
    flex: 1;
    max-width: 250px;
    cursor: pointer;
    accent-color: var(--highlight);
}

#mapa_brasil {
    width: 100%;
    height: 500px;
    transform-origin: center center;
    position: relative;
    z-index: 1;
}

#mapa_brasil svg path {
    stroke: #ffffff !important;
    stroke-width: 1.5px !important;
    cursor: pointer !important;
}

.botoes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 40px;
}

.btn-regiao {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-radius: var(--radius);
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.btn-regiao:hover {
    transform: translateY(-2px);
    opacity: 0.95;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-regiao .dot {
    width: 12px;
    height: 12px;
    background-color: var(--white);
    border-radius: 50%;
    display: inline-block;
}

.regiao-card {
    background: var(--white);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
}

.regiao-titulo {
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 12px;
}

.regiao-info p {
    margin: 6px 0;
    font-size: 14px;
    color: var(--text-main);
}

.reps-box {
    margin-top: 15px;
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-sec);
    border: 1px solid #e5e7eb;
}

.finance-card {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.finance-card.highlight {
    background: #1f3554;
    color: white;
    border: none;
}

.finance-val {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 5px 0;
}

.finance-lbl {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.expense-item {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid #ccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    position: relative;
}

.expense-row-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.expense-desc {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.expense-category-tag {
    font-size: 0.7rem;
    background: #e0e7ff;
    color: #4338ca;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
    margin-right: 5px;
}

.expense-date {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

.expense-amount {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1rem;
}

.impact-bar-container {
    margin-top: 8px;
}

.impact-label {
    font-size: 0.7rem;
    color: #666;
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.impact-track {
    width: 100%;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}

.impact-fill {
    height: 100%;
    background: var(--warning);
    border-radius: 3px;
}

.budget-container {
    margin-top: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px;
    border-radius: 8px;
}

.budget-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-sec);
}

.progress-track {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    width: 0%;
    transition: width 0.5s ease;
}

.progress-fill.warning {
    background: var(--warning);
}

.progress-fill.danger {
    background: var(--danger);
}

.fin-perf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.fin-perf-card {
    background: #f9fafb;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.fin-perf-val {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.fin-perf-lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #666;
}

.report-result-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: 0.2s;
}

.report-result-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.report-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.analytics-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: #fff;
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

.full-width {
    grid-column: span 2;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.kpi-card {
    background: #fff;
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    border-bottom: 4px solid var(--primary);
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 5px 0;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-sec);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eval-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.eval-summary-table td {
    padding: 6px;
    border-bottom: 1px solid #eee;
}

.eval-summary-table td:first-child {
    color: #666;
    font-weight: 500;
    width: 40%;
}

.eval-summary-table td:last-child {
    font-weight: 700;
    color: #333;
}

/* --------------------------------------------------------------------------
   7. MODAIS E MENUS DE AÇÃO
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-overlay.open {
    display: flex;
}

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 700px;
    max-height: 95vh;
    overflow-y: auto;
    border-radius: 20px;
    padding: 1.5rem;
    animation: zoomIn 0.2s;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-sec);
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--danger);
}

#modal-info h2 {
    margin-top: 0;
    font-size: 22px;
    color: var(--primary);
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.action-menu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    padding: 15px;
    text-align: left;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 600;
    color: var(--text-main);
}

.action-btn:hover {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
}

.action-btn i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   8. ANIMAÇÕES
   -------------------------------------------------------------------------- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulseGreen {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
        border-left-color: var(--success);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
        border-left-color: var(--success);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
        border-left-color: var(--success);
    }
}

.pulse-green {
    animation: pulseGreen 2s infinite !important;
    border-left-color: var(--success) !important;
}

/* --------------------------------------------------------------------------
   9. IMPRESSÃO E RESPONSIVIDADE
   -------------------------------------------------------------------------- */
@media print {
    body * {
        visibility: hidden !important;
    }

    #manager-report-modal.open,
    #manager-report-modal.open * {
        visibility: visible !important;
    }

    #manager-report-modal.open {
        position: absolute;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        margin: 0;
        padding: 0;
        background: white;
        box-shadow: none;
    }

    .close-modal,
    button {
        display: none !important;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 22px;
    }

    .contatos-title {
        font-size: 20px;
    }

    .botoes-grid {
        grid-template-columns: 1fr;
    }

    .contatos-container {
        flex-direction: column;
        gap: 15px;
    }

    .contato-divider {
        width: 100%;
        height: 1px;
        margin: 10px 0;
    }

    #mapa_brasil {
        height: 450px;
    }

    .btn-regiao {
        font-size: 13px;
        padding: 12px 20px;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .event-filter-container {
        grid-template-columns: 1fr;
    }
}

@keyframes pulseOrange {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
        border-left-color: var(--warning);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(245, 158, 11, 0);
        border-left-color: var(--warning);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
        border-left-color: var(--warning);
    }
}

.pulse-orange {
    animation: pulseOrange 2s infinite !important;
    border-left-color: var(--warning) !important;
}

/* ==========================================================================
   MODAIS DE AVISO (CUSTOM ALERTS & CONFIRMS)
   ========================================================================== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.custom-modal-box {
    background: #ffffff;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    padding: 30px 24px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9) translateY(10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal-overlay.open .custom-modal-box {
    transform: scale(1) translateY(0);
}

.custom-modal-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin: 0 auto 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.custom-modal-icon.error {
    background: #fef2f2;
    color: #ef4444;
    border: 4px solid #fee2e2;
}

.custom-modal-icon.success {
    background: #ecfdf5;
    color: #10b981;
    border: 4px solid #d1fae5;
}

.custom-modal-icon.warning {
    background: #fffbeb;
    color: #f59e0b;
    border: 4px solid #fef3c7;
}

.custom-modal-icon.info {
    background: #eff6ff;
    color: #3b82f6;
    border: 4px solid #dbeafe;
}

.custom-modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 12px;
}

.custom-modal-msg {
    font-size: 1rem;
    color: #4b5563;
    margin-bottom: 28px;
    line-height: 1.6;
}

.custom-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-modal-btn {
    flex: 1;
    padding: 12px 0;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.custom-modal-btn.confirm {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(31, 53, 84, 0.2);
}

.custom-modal-btn.confirm:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px -1px rgba(31, 53, 84, 0.3);
}

.custom-modal-btn.cancel {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.custom-modal-btn.cancel:hover {
    background: #e5e7eb;
    color: #1f2937;
    transform: translateY(-2px);
}

/* ==========================================================================
   MODAL COLETOR
   ========================================================================== */
.collector-option-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.collector-option-btn {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.collector-option-btn:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.collector-option-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.collector-option-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.collector-option-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.collector-option-name, .collector-option-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 2px;
}

.collector-consultant-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.collector-consultant-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.collector-consultant-item:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.collector-consultant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.collector-consultant-details {
    flex: 1;
}

.collector-consultant-name {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.collector-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.collector-back-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

/* ==========================================================================
   LIXEIRA DE EVENTOS
   ========================================================================== */

/* --- Danger Modal (Confirmação de Exclusão Vermelha) --- */
.custom-modal-icon.danger {
    background: #fef2f2;
    color: #dc2626;
    border: 4px solid #fecaca;
}

.custom-modal-overlay.danger-mode .custom-modal-box {
    border-top: 4px solid #dc2626;
}

.custom-modal-overlay.danger-mode .custom-modal-btn.confirm {
    background: #dc2626;
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.3);
}

.custom-modal-overlay.danger-mode .custom-modal-btn.confirm:hover {
    background: #b91c1c;
    box-shadow: 0 6px 8px -1px rgba(220, 38, 38, 0.4);
}

.custom-modal-overlay.danger-mode .custom-modal-title {
    color: #dc2626;
}

/* --- Botão Lixeira no header da lista --- */
.btn-trash-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-trash-toggle:hover {
    background: #fee2e2;
    border-color: #f87171;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.trash-badge {
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 50px;
    min-width: 18px;
    text-align: center;
    line-height: 1.3;
}

.trash-badge.empty {
    background: #9ca3af;
}

/* --- Tela da Lixeira --- */
.trash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 10px;
}

.trash-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-back-trash {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-sec);
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-back-trash:hover {
    background: #f3f4f6;
    color: var(--text-main);
}

.btn-empty-trash {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-empty-trash:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.trash-info-banner {
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #92400e;
}

.trash-info-banner i {
    font-size: 1.1rem;
    color: #f59e0b;
}

/* --- Cards da Lixeira --- */
.trash-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #dc2626;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    transition: all 0.2s;
    opacity: 0.85;
}

.trash-card:hover {
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.trash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.trash-card-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
}

.trash-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-sec);
    margin-bottom: 12px;
}

.trash-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.trash-days-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.trash-days-badge.urgent {
    background: #fef2f2;
    color: #dc2626;
}

.trash-days-badge.normal {
    background: #fffbeb;
    color: #d97706;
}

.trash-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-restore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-restore:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.15);
}

.btn-delete-permanent {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-delete-permanent:hover {
    background: #fee2e2;
    border-color: #f87171;
    transform: translateY(-1px);
}

.trash-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.trash-empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.trash-empty-state p {
    font-size: 1rem;
    margin: 0;
}

.trash-docs-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
/* Toggle Switch Styling */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e70c0c;
    transition: .3s;
    border-radius: 24px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
    background-color: var(--success);
}
.toggle-switch input:focus-visible + .toggle-slider {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* ==========================================================================
   GESTÃO DE LEADS
   ========================================================================== */
.leads-filter-card {
    transition: all 0.3s ease;
}

.leads-filter-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
}

.leads-table th {
    background: #f8fafc;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.leads-table td {
    vertical-align: middle;
}

.pagination-controls button {
    height: 32px;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#lead-detalhes-conteudo > div {
    background: #f8fafc;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
