/* ========================================
   HEY VET - Dashboard CSS
======================================== */

:root {
    --vivid-blue: #4f46e5;
    --vivid-blue-dark: #4338ca;
    --emerald: #10b981;
    --bg-main: #f8fafc;
    --bg-sidebar: #4f46e5;
    --white: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius-lg: 32px;
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Outfit', sans-serif; background-color: var(--bg-main); color: var(--text-main); overflow: hidden; }

/* ===================== LAYOUT ===================== */
.dashboard-container { display: flex; height: 100vh; width: 100vw; overflow: hidden; }

/* ===================== SIDEBAR ===================== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--white);
    display: flex;
    flex-direction: column;
    padding: 30px 0;
    height: 100vh;
    overflow: hidden;
}
.logo { padding: 0 30px; margin-bottom: 40px; font-size: 1.5rem; font-weight: 800; }
.logo-icon { margin-right: 8px; }
.logo .highlight { color: var(--emerald); }

.nav-label {
    padding: 0 30px;
    margin: 24px 0 10px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    font-weight: 700;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
}
/* Custom Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

.sidebar-footer {
    padding: 20px 0 0;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.15);
}
.sidebar-nav ul, .sidebar-footer ul { list-style: none; }
.sidebar-nav li, .sidebar-footer li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 30px;
    cursor: pointer;
    border-radius: 0 30px 30px 0;
    margin-right: 20px;
    transition: all 0.2s;
    font-weight: 500;
    opacity: 0.8;
    font-size: 0.9rem;
}
.sidebar-nav li a, .sidebar-footer li a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}
.sidebar-nav li:hover, .sidebar-nav li.active, .sidebar-footer li:hover { background: rgba(255,255,255,0.18); opacity: 1; }
.sidebar-nav li i, .sidebar-footer li i { width: 18px; text-align: center; }

/* Submenus Colapsáveis */
.nav-submenu {
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}
.nav-submenu.collapsed {
    max-height: 0;
}
.nav-label.collapsible {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 28px;
    transition: opacity 0.2s;
}
.nav-label.collapsible:hover { opacity: 1; }
.nav-label.collapsible i { transition: transform 0.3s ease; }
.nav-label.collapsible.collapsed i { transform: rotate(-90deg); }

/* ===================== MAIN CONTENT ===================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ===================== TOP BAR ===================== */
.top-bar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    background: white;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    flex-shrink: 0;
}
.search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-main);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 8px 16px;
    flex: 1;
    max-width: 360px;
}
.search-wrapper i { color: var(--text-muted); font-size: 0.9rem; }
.search-wrapper input {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
    width: 100%;
}
.top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
.icon-btn {
    position: relative;
    background: var(--bg-main);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    transition: 0.2s;
}
.icon-btn:hover { border-color: var(--vivid-blue); color: var(--vivid-blue); }
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: cover;
}
.user-meta { display: flex; flex-direction: column; }
.user-meta .name { font-weight: 700; font-size: 0.85rem; color: var(--text-main); }
.user-meta .role { font-size: 0.72rem; color: var(--text-muted); }

/* ===================== CONTENT WRAPPER ===================== */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 36px 16px;
    border-bottom: 1px solid var(--border);
    background: white;
    flex-shrink: 0;
}
.section-header h1 { font-size: 1.4rem; font-weight: 800; }
.header-tools { display: flex; align-items: center; gap: 10px; }

#content-area {
    flex: 1;
    overflow-y: auto;
    padding: 28px 36px;
}

/* ===================== CARDS ===================== */
.card-ref {
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 0;
}
.card-ref h3 { font-size: 1rem; font-weight: 700; color: var(--text-main); }
.card-ref h3 i { margin-right: 8px; }

/* Stats mini grid */
.stats-grid-mini {
    display: grid;
    gap: 16px;
}
.stat-item {
    background: var(--bg-main);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat-val { font-size: 1.8rem; font-weight: 800; }
.stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 700; }
.trend { font-size: 0.8rem; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.trend.up { background: #d1fae5; color: #065f46; }
.trend.down { background: #fee2e2; color: #991b1b; }

/* ===================== TABLE ===================== */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    font-weight: 700;
    white-space: nowrap;
}
.data-table td { padding: 12px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(79,70,229,0.02); }
.reminder-row td { background: rgba(245,158,11,0.05) !important; }

/* ===================== STATUS BADGES ===================== */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.status-badge.enviado        { background: #fef9c3; color: #ca8a04; }
.status-badge.respondido     { background: #d1fae5; color: #065f46; }
.status-badge.sem-interesse  { background: #fee2e2; color: #991b1b; }
.status-badge.testing        { background: #fef3c7; color: #92400e; }
.status-badge.afiliado       { background: #dbeafe; color: #1e40af; }
.status-badge.influenciador  { background: #ede9fe; color: #5b21b6; }
.status-badge.cancelled      { background: #fee2e2; color: #dc2626; }
.status-badge.concluido      { background: #d1fae5; color: #065f46; }
.status-badge.active         { background: #d1fae5; color: #065f46; }
.status-badge.encerrado      { background: #f3f4f6; color: #374151; }
.days-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(79,70,229,0.08);
    color: var(--vivid-blue);
}
.days-badge.warning { background: rgba(245,158,11,0.12); color: #d97706; }

/* ===================== ACTION BUTTONS ===================== */
.action-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: 0.2s;
    flex-shrink: 0;
    margin-right: 6px;
}
.action-btn:last-child {
    margin-right: 0;
}
.action-btn:hover { border-color: var(--vivid-blue); color: var(--vivid-blue); background: rgba(79,70,229,0.05); }

/* Evita que a coluna de ações quebre linha */
.data-table td:has(.action-btn) {
    white-space: nowrap;
}

/* ===================== MODAL ===================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.active { display: flex; }
.modal-content {
    width: 520px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.close-modal { color: var(--text-muted); }
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.edit-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: var(--bg-main);
}
.edit-input:focus { border-color: var(--vivid-blue); background: white; }
.btn-primary { cursor: pointer; font-family: inherit; }

/* ===================== SETTINGS ===================== */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-main);
    margin-top: 10px;
    font-weight: 600;
}
.locked-badge {
    font-size: 0.7rem;
    background: #ede9fe;
    color: #5b21b6;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 700;
}

/* ===================== PAGINATION ===================== */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}
.pagination-info { font-size: 0.8rem; color: var(--text-muted); }
.pagination-controls { display: flex; align-items: center; gap: 12px; }
.limit-select {
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-main);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}
.page-btn {
    background: white;
    border: 1px solid var(--border);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.page-btn:not(:disabled):hover { border-color: var(--vivid-blue); color: var(--vivid-blue); background: rgba(79,70,229,0.05); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-indicator { min-width: 40px; text-align: center; font-weight: 700; font-size: 0.9rem; }

/* ===================== TOAST ===================== */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    background: white;
    color: var(--text-main);
    padding: 14px 22px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease forwards;
    border-left: 4px solid var(--vivid-blue);
}
.toast.error   { border-left-color: #ef4444; }
.toast.success { border-left-color: #10b981; }
@keyframes slideInRight { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes fadeIn  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.active-section { animation: fadeIn 0.3s ease; }

/* ===================== KPI CARDS (Analytics Dashboard) ===================== */
.kpi-card {
    background: white;
    border-radius: 20px;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    border-left: 5px solid var(--kpi-color, #6366f1);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.kpi-card > i { font-size: 1.2rem; color: var(--kpi-color, #6366f1); margin-bottom: 2px; }
.kpi-val { font-size: 2rem; font-weight: 800; color: var(--text-main); line-height: 1; }
.kpi-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* ===================== SETTINGS TABS & ENHANCEMENTS ===================== */
.settings-container {
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease;
}

.settings-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-top: 20px;
    background: rgba(0,0,0,0.02);
}

.settings-tab {
    padding: 14px 28px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-tab:hover {
    color: var(--vivid-blue);
    background: rgba(79, 70, 229, 0.03);
}

.settings-tab.active {
    color: var(--vivid-blue);
    border-bottom-color: var(--vivid-blue);
    background: white;
}

.form-group input::placeholder {
    opacity: 0.4;
}

.card-ref input.edit-input {
    margin-top: 5px;
}
