/* ============================================================
   GUARUGEO - SIDEBAR STYLES
   ============================================================ */

#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.04);
}

.sidebar-logo-container {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
}

.sidebar-logo-container img {
    max-width: 85%;
    max-height: 120px;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
}

.sidebar-header {
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.header-top-row h2 {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.header-actions {
    display: flex;
    gap: 8px;
    /* Reduced from 16px to prevent overflow */
    align-items: center;
    flex-wrap: nowrap;
    /* Prevent wrapping */
}

.header-actions button {
    flex-shrink: 0;
    /* Prevent shrinking */
    padding: 0 4px;
}

.search-box {
    position: relative;
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.search-box input#searchInput {
    flex: 1;
    border-radius: 14px;
    height: 48px;
    padding: 14px 18px;
    border: 2px solid #f1f5f9;
    font-size: 14px;
    background: #f8fafc;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-main);
}

.search-box input#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

.google-suggestions-box {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    max-height: 300px;
    overflow-y: auto;
}

.google-suggestions-box.hidden {
    display: none;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f1f5f9;
}

.suggestion-item i {
    color: #94a3b8;
    font-size: 14px;
}

.suggestion-text {
    display: flex;
    flex-direction: column;
}

.suggestion-main {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.suggestion-sub {
    font-size: 11px;
    color: #64748b;
}

.search-clear-btn {
    position: absolute;
    right: 58px;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 22px;
    cursor: pointer;
    padding: 5px;
}

/* --- PREMIUM STRATEGY BAR & ACCOUNT ACTIONS --- */
.strategy-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.strategy-bar i {
    font-size: 16px;
    transition: all 0.2s;
}

.strategy-bar i:hover {
    transform: scale(1.2);
}

.header-account-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

#btnNotifications {
    transition: all 0.2s;
}

#btnNotifications:hover {
    background-color: #e2e8f0 !important;
}

/* Tabs */
.sidebar-tabs {
    display: flex;
    padding: 0 24px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 18px 25px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
    border-radius: 4px 4px 0 0;
}

.sidebar-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: none;
    flex-direction: column;
}

.sidebar-tab-content.active {
    display: flex !important;
}

/* Filter Section */
.filter-section {
    margin-bottom: 30px;
    padding: 24px;
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04);
}

.filter-title {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.filter-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    background: #fff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    border: 2px solid #f1f5f9;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--text-secondary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.filter-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1);
}

.filter-chip.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-color: transparent;
    color: white;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
}

.filter-chip.active:hover {
    transform: translateY(-4px) scale(1.04);
}

/* --- Filter Tooltips with Arrows --- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 1001;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    bottom: calc(100% + 10px);
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    white-space: nowrap;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    letter-spacing: normal;
}

[data-tooltip]::after {
    content: '';
    bottom: calc(100% + 4px);
    border: 6px solid transparent;
    border-top-color: #1e293b;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* --- Search Loading Styles --- */
.search-box.loading #searchBtn {
    position: relative;
    color: transparent !important;
}

.search-box.loading #searchBtn::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: sidebar-spin 0.6s linear infinite;
}

@keyframes sidebar-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Chip 'Todos' ocupava 2 colunas (apenas para masters) */
.filter-chip[data-search-type="all"] {
    grid-column: span 2;
}

/* Chip TRAVADO (visível mas bloqueado para não-masters) */
.filter-chip.locked {
    opacity: 0.55;
    cursor: not-allowed;
    border-style: dashed;
    background: #f8fafc;
    color: #94a3b8;
    pointer-events: auto; /* Permite o onClick de aviso */
    position: relative;
}

.filter-chip.locked::before {
    display: none !important; /* Remove tooltip de busca */
}

.filter-chip.locked .lock-icon {
    display: inline-block;
    font-size: 9px;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.7;
}

.search-item {
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.search-item:hover {
    background: #f8fafc;
    border-left-color: var(--primary-color);
    padding-left: 28px;
}

.search-item h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-main);
}

.search-item p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Radar Alert Animation */
@keyframes radarPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.radar-active {
    color: #ef4444 !important;
    animation: radarPulse 2s infinite;
}