/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores principais */
    --primary: hsl(221, 83%, 53%);
    --primary-foreground: hsl(0, 0%, 100%);
    --secondary: hsl(210, 40%, 96%);
    --secondary-foreground: hsl(222, 47%, 11%);
    --muted: hsl(210, 40%, 96%);
    --muted-foreground: hsl(215, 16%, 47%);
    --accent: hsl(210, 40%, 96%);
    --accent-foreground: hsl(222, 47%, 11%);
    --destructive: hsl(0, 84%, 60%);
    --destructive-foreground: hsl(0, 0%, 100%);
    
    /* Backgrounds */
    --background: hsl(0, 0%, 100%);
    --foreground: hsl(222, 47%, 11%);
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(222, 47%, 11%);
    --border: hsl(214, 32%, 91%);
    --input: hsl(214, 32%, 91%);
    --ring: hsl(221, 83%, 53%);
    
    /* Sidebar */
    --sidebar-background: hsl(0, 0%, 100%);
    --sidebar-foreground: hsl(222, 47%, 11%);
    --sidebar-border: hsl(214, 32%, 91%);
    --sidebar-accent: hsl(210, 40%, 96%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Spacing */
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
}

/* Dark Mode - System Preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary: hsl(221, 83%, 60%);
        --primary-foreground: hsl(0, 0%, 100%);
        --secondary: hsl(217, 33%, 17%);
        --secondary-foreground: hsl(210, 40%, 98%);
        --muted: hsl(217, 33%, 17%);
        --muted-foreground: hsl(215, 20%, 65%);
        --accent: hsl(217, 33%, 17%);
        --accent-foreground: hsl(210, 40%, 98%);
        --destructive: hsl(0, 84%, 60%);
        --destructive-foreground: hsl(0, 0%, 100%);
        
        --background: hsl(222, 47%, 11%);
        --foreground: hsl(210, 40%, 98%);
        --card: hsl(222, 47%, 11%);
        --card-foreground: hsl(210, 40%, 98%);
        --border: hsl(217, 33%, 17%);
        --input: hsl(217, 33%, 17%);
        --ring: hsl(221, 83%, 60%);
        
        --sidebar-background: hsl(222, 47%, 11%);
        --sidebar-foreground: hsl(210, 40%, 98%);
        --sidebar-border: hsl(217, 33%, 17%);
        --sidebar-accent: hsl(217, 33%, 17%);
    }
}

/* Dark Mode - Manual Toggle */
body.dark {
    --primary: hsl(221, 83%, 60%);
    --primary-foreground: hsl(0, 0%, 100%);
    --secondary: hsl(217, 33%, 17%);
    --secondary-foreground: hsl(210, 40%, 98%);
    --muted: hsl(217, 33%, 17%);
    --muted-foreground: hsl(215, 20%, 65%);
    --accent: hsl(217, 33%, 17%);
    --accent-foreground: hsl(210, 40%, 98%);
    --destructive: hsl(0, 84%, 60%);
    --destructive-foreground: hsl(0, 0%, 100%);
    
    --background: hsl(222, 47%, 11%);
    --foreground: hsl(210, 40%, 98%);
    --card: hsl(222, 47%, 11%);
    --card-foreground: hsl(210, 40%, 98%);
    --border: hsl(217, 33%, 17%);
    --input: hsl(217, 33%, 17%);
    --ring: hsl(221, 83%, 60%);
    
    --sidebar-background: hsl(222, 47%, 11%);
    --sidebar-foreground: hsl(210, 40%, 98%);
    --sidebar-border: hsl(217, 33%, 17%);
    --sidebar-accent: hsl(217, 33%, 17%);
}

/* Light Mode - Manual Toggle */
body.light {
    --primary: hsl(221, 83%, 53%);
    --primary-foreground: hsl(0, 0%, 100%);
    --secondary: hsl(210, 40%, 96%);
    --secondary-foreground: hsl(222, 47%, 11%);
    --muted: hsl(210, 40%, 96%);
    --muted-foreground: hsl(215, 16%, 47%);
    --accent: hsl(210, 40%, 96%);
    --accent-foreground: hsl(222, 47%, 11%);
    --destructive: hsl(0, 84%, 60%);
    --destructive-foreground: hsl(0, 0%, 100%);
    
    --background: hsl(0, 0%, 100%);
    --foreground: hsl(222, 47%, 11%);
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(222, 47%, 11%);
    --border: hsl(214, 32%, 91%);
    --input: hsl(214, 32%, 91%);
    --ring: hsl(221, 83%, 53%);
    
    --sidebar-background: hsl(0, 0%, 100%);
    --sidebar-foreground: hsl(222, 47%, 11%);
    --sidebar-border: hsl(214, 32%, 91%);
    --sidebar-accent: hsl(210, 40%, 96%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--foreground);
    background: var(--background);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 2rem;
    width: auto;
    height: auto;
}

.loading-logo {
    max-width: 160px !important;
    width: 120px !important;
    height: auto !important;
    max-height: 80px !important;
    margin-bottom: 2rem;
    animation: pulse 2s ease-in-out infinite;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--muted);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pages */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, hsl(221, 83%, 53%) 0%, hsl(262, 83%, 58%) 100%);
}

.auth-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 153px;
    height: auto;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.auth-subtitle {
    color: var(--muted-foreground);
    font-size: 0.9rem;
    margin: 0;
}

.auth-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--foreground);
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: var(--background);
    color: var(--foreground);
}

.form-group input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px hsl(221, 83%, 53% / 0.1);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1.5;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background: hsl(221, 83%, 48%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--accent);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--sidebar-background);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.3s ease;
    user-select: none;
}

.sidebar.collapsed {
    width: 100px; /* 80px + 20px de espaço para o botão */
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
}

.sidebar.collapsed .sidebar-logo {
    max-width: 60px; /* Logo menor quando colapsado, com espaço para o botão */
    margin-bottom: 0.5rem;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.625rem;
}

.sidebar.collapsed .sidebar-header {
    padding: 1.5rem 0.5rem;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar.collapsed .sidebar-toggle {
    display: block;
}

.sidebar.collapsed .sidebar-nav {
    padding: 1rem 0.5rem;
}

.sidebar.collapsed .sidebar-footer {
    padding: 1rem 0.5rem;
}

.sidebar.collapsed .user-menu {
    justify-content: center;
}

.sidebar.collapsed .user-menu .user-name,
.sidebar.collapsed .user-menu .user-email {
    display: none;
}


.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sidebar-logo {
    max-width: 126px; /* Reduzido 30% de 180px */
    width: auto;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--sidebar-foreground);
}

.sidebar-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-foreground);
    padding: 0.5rem;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--sidebar-accent);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-section-bottom {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--sidebar-border);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.nav-item span {
    transition: opacity 0.2s ease;
}

.nav-item:hover {
    background: var(--sidebar-accent);
    color: var(--sidebar-foreground);
}

.nav-item.active {
    background: hsl(221, 83%, 53% / 0.1);
    color: var(--primary);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--sidebar-border);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-menu:hover {
    background: var(--sidebar-accent);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sidebar-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-btn {
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
}

.user-menu-btn:hover {
    background: var(--accent);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    background: var(--background);
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .main-content,
.sidebar.collapsed + * .main-content {
    margin-left: 80px;
}

.main-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: var(--card);
    position: sticky;
    top: 0;
    margin-bottom: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.25rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-blue {
    background: hsl(221, 83%, 53% / 0.1);
    color: var(--primary);
}

.stat-icon-green {
    background: hsl(142, 76%, 36% / 0.1);
    color: hsl(142, 76%, 36%);
}

.stat-icon-purple {
    background: hsl(262, 83%, 58% / 0.1);
    color: hsl(262, 83%, 58%);
}

.stat-icon-orange {
    background: hsl(24, 95%, 53% / 0.1);
    color: hsl(24, 95%, 53%);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.stat-trend svg {
    width: 14px;
    height: 14px;
}

.stat-trend-up {
    color: hsl(142, 76%, 36%);
}

.stat-trend-down {
    color: hsl(0, 84%, 60%);
}

.stat-trend-down svg {
    transform: rotate(180deg);
}

.stat-trend-neutral {
    color: var(--muted-foreground);
}

/* Section Header */
.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
}

/* Actions Grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.action-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.action-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.action-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: hsl(221, 83%, 53% / 0.1);
    color: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.action-card p {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Alerts */
.alert-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    animation: slideIn 0.3s ease;
    border: 1px solid var(--border);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background: hsl(142, 76%, 36%);
    color: white;
    border-color: hsl(142, 76%, 36%);
}

.alert-error {
    background: var(--destructive);
    color: white;
    border-color: var(--destructive);
}

.alert-warning {
    background: hsl(38, 92%, 50%);
    color: white;
    border-color: hsl(38, 92%, 50%);
}

.alert-info {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-header {
        padding: 1rem;
    }
    
    .dashboard-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 2rem;
    }
    
    .alert-container {
        right: 1rem;
        left: 1rem;
    }
    
    .alert {
        min-width: auto;
    }
}

/* Connections Page Styles */
.connections-content {
    padding: 0;
}

.page-subtitle {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 400;
}

/* Connections Header Actions */
.connections-header-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-link:hover {
    background: var(--muted);
    color: var(--foreground);
}

/* Status Summary */
.status-summary {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    padding-left: 4rem; /* Espaçamento de TAB */
    background: transparent;
    border: none;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot-green {
    background: hsl(142, 76%, 36%);
    box-shadow: 0 0 0 2px hsl(142, 76%, 36%, 0.2);
}

.status-dot-blue {
    background: var(--primary);
    box-shadow: 0 0 0 2px hsl(221, 83%, 53%, 0.2);
}

.status-dot-orange {
    background: hsl(38, 92%, 50%);
    box-shadow: 0 0 0 2px hsl(38, 92%, 50%, 0.2);
}

.status-dot-red {
    background: var(--destructive);
    box-shadow: 0 0 0 2px hsl(0, 84%, 60%, 0.2);
}

.status-count {
    font-weight: 600;
    font-size: 1rem;
    color: var(--foreground);
    margin-right: 0.25rem;
}

.status-label {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 400;
}

/* Connections List */
.connections-list {
    min-height: 500px;
}

.connections-list-unipile {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.connections-empty {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.empty-icon-wrapper {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.empty-icon {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, hsl(221, 83%, 53%, 0.1) 0%, hsl(221, 83%, 53%, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.empty-icon svg {
    width: 80px;
    height: 80px;
}

.empty-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--foreground);
}

.empty-description {
    color: var(--muted-foreground);
    margin-bottom: 2.5rem;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.empty-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--foreground);
}

.btn-outline:hover {
    background: var(--muted);
    border-color: var(--primary);
    color: var(--primary);
}

/* Connections Grid */
.connections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Connection Card - Estilo Unipile */
.connection-card-unipile {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.12), 0px 1px 2px rgba(0, 0, 0, 0.24);
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
    width: 100%;
}

.connection-card-unipile:hover {
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.12), 0px 2px 3px rgba(0, 0, 0, 0.24);
}

.connection-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #0077B5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.connection-icon-box svg {
    width: 22px;
    height: 22px;
}

.connection-info-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.connection-name-unipile {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--foreground);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.connection-status-stack {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot-unipile {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot-unipile.status-green {
    background: hsl(142, 76%, 36%);
}

.status-dot-unipile.status-green::before {
    display: none;
}

.status-dot-unipile.status-blue {
    background: var(--primary);
}

.status-dot-unipile.status-orange {
    background: hsl(38, 92%, 50%);
}

.status-dot-unipile.status-red {
    background: var(--destructive);
}

.status-dot-unipile.status-gray {
    background: var(--muted-foreground);
}

.status-text-unipile {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--muted-foreground);
    margin: 0;
}

.connection-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    flex-shrink: 0;
}

.connection-id-unipile {
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    opacity: 0.7;
    white-space: nowrap;
}

.connection-separator {
    color: var(--border);
    opacity: 0.5;
}

.connection-date-unipile {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin: 0;
    white-space: nowrap;
}

.btn-menu-unipile {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.btn-menu-unipile:hover {
    background: var(--accent);
    color: var(--foreground);
}

/* Legacy connection-card styles (mantido para compatibilidade) */
.connection-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.connection-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.connection-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary);
}

.connection-card:hover::before {
    opacity: 1;
}

.connection-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.connection-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary) 0%, hsl(221, 83%, 45%) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px hsl(221, 83%, 53%, 0.3);
}

.connection-info {
    flex: 1;
    min-width: 0;
}

.connection-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--foreground);
}

.connection-headline {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.5;
}

.connection-status {
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.status-green {
    background: hsl(142, 76%, 36%, 0.12);
    color: hsl(142, 76%, 36%);
    border: 1px solid hsl(142, 76%, 36%, 0.2);
}

/* Removido ::before para evitar dots duplicados - usando status-dot-unipile */
.status-green::before {
    display: none;
}

.status-blue {
    background: hsl(221, 83%, 53%, 0.12);
    color: var(--primary);
    border: 1px solid hsl(221, 83%, 53%, 0.2);
}

/* Removido ::before para evitar dots duplicados - usando status-dot-unipile */
.status-blue::before {
    display: none;
}

.status-orange {
    background: hsl(38, 92%, 50%, 0.12);
    color: hsl(38, 92%, 50%);
    border: 1px solid hsl(38, 92%, 50%, 0.2);
}

/* Removido ::before para evitar dots duplicados - usando status-dot-unipile */
.status-orange::before {
    display: none;
}

.status-red {
    background: hsl(0, 84%, 60%, 0.12);
    color: var(--destructive);
    border: 1px solid hsl(0, 84%, 60%, 0.2);
}

/* Removido ::before para evitar dots duplicados - usando status-dot-unipile */
.status-red::before {
    display: none;
}

.status-gray {
    background: var(--muted);
    color: var(--muted-foreground);
    border: 1px solid var(--border);
}

.connection-details {
    margin-bottom: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.625rem;
    font-size: 0.875rem;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-label {
    color: var(--muted-foreground);
    font-weight: 400;
}

.detail-value {
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-size: 0.8125rem;
    color: var(--foreground);
    background: var(--muted);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
}

.connection-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Info Banner */
.info-banner {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, hsl(221, 83%, 53%, 0.05) 0%, hsl(221, 83%, 53%, 0.02) 100%);
    border: 1px solid hsl(221, 83%, 53%, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    position: relative;
}

.banner-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-content {
    flex: 1;
}

.banner-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.banner-content p {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.5;
    margin: 0;
}

.banner-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.banner-close:hover {
    background: var(--muted);
    color: var(--foreground);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal[style*="flex"],
.modal.show {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 540px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal.show .modal-content,
.modal[style*="flex"] .modal-content {
    transform: translateY(0);
}

.modal-large {
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem;
    border-bottom: 1px solid var(--border);
    background: white;
}

.modal-header.linkedin-header {
    padding: 1.5rem 2rem;
    border-bottom: none;
}

.linkedin-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.linkedin-logo-img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.linkedin-logo-img svg {
    width: 100%;
    height: 100%;
}

.linkedin-logo {
    width: 40px;
    height: 40px;
    background: #0077B5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.linkedin-in {
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    letter-spacing: -0.5px;
}

.modal-header.linkedin-header h2 {
    font-size: 1.25rem;
    font-weight: 400;
    margin: 0;
    color: rgba(0, 0, 0, 0.9);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.modal-header-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary) 0%, hsl(221, 83%, 45%) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px hsl(221, 83%, 53%, 0.3);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    /* ✅ CORRIGIDO: Modal sempre tem fundo branco, então título sempre escuro */
    color: #1a1a1a !important; /* Preto/escuro fixo para melhor contraste no fundo branco */
}

/* ✅ FORÇA cor escura no título do modal de resultados especificamente */
#search-results-modal .modal-header h2,
#results-modal-title {
    color: #1a1a1a !important; /* Preto/escuro fixo */
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all 0.2s;
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--muted);
    color: var(--foreground);
}

.modal-body {
    padding: 1.5rem 2rem 2rem 2rem;
    overflow-y: auto; /* Enable scroll inside modal body */
    flex: 1; /* Take remaining space */
    max-height: calc(85vh - 100px); /* Account for header */
}

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body .form-group input[type="email"],
.modal-body .form-group input[type="password"],
.modal-body .form-group input[type="text"],
.modal-body .form-group textarea,
.modal-body .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 0.9375rem;
    background: white;
    color: rgba(0, 0, 0, 0.9);
    transition: border-color 0.2s;
}

.modal-body .form-group input:focus,
.modal-body .form-group textarea:focus,
.modal-body .form-group select:focus {
    outline: none;
    border-color: #0077B5;
    box-shadow: 0 0 0 2px rgba(0, 119, 181, 0.1);
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.75);
}

.modal-body .form-group small.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: rgba(0, 0, 0, 0.6);
}

.modal-subtitle {
    color: var(--muted-foreground);
    margin: 0;
    font-size: 0.875rem;
    font-weight: 400;
}

/* Method Tabs */
.method-tabs {
    display: flex;
    gap: 0;
    margin: 0 0 1.5rem 0;
    border-bottom: 1px solid #e0e0e0;
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.method-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.75rem 1rem;
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0;
    flex: 1;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.method-tab:hover {
    color: rgba(0, 0, 0, 0.9);
    background: rgba(0, 0, 0, 0.02);
}

.method-tab.active {
    color: #0077B5;
    background: transparent;
    border-bottom-color: #0077B5;
    font-weight: 600;
    box-shadow: none;
}

/* Connect Form */
/* ✅ NOVO: Estilos para OAuth Connection */
.oauth-connection-content {
    text-align: center;
    padding: 2rem 1rem;
}

.oauth-icon {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.oauth-connection-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--foreground);
}

.oauth-description {
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.oauth-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    text-align: left;
    display: inline-block;
    width: 100%;
    max-width: 400px;
}

.oauth-benefits li {
    padding: 0.75rem 0;
    color: var(--foreground);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    line-height: 1.5;
}

.oauth-benefits li:before {
    content: '';
    display: none; /* Remove o pseudo-elemento, usamos emoji direto no HTML */
}

.benefit-icon {
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
}

.benefit-text {
    flex: 1;
}

#btn-connect-oauth {
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#btn-connect-oauth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.connect-form {
    margin-top: 0;
}

.optional-settings {
    margin: 1.5rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

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

.settings-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.75);
}

.settings-toggle {
    background: none;
    border: none;
    padding: 0.25rem;
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, color 0.2s;
}

.settings-toggle:hover {
    color: rgba(0, 0, 0, 0.9);
}

.settings-toggle.expanded svg {
    transform: rotate(180deg);
}

.settings-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.75);
    margin-bottom: 0.75rem;
}

.checkbox-group,
.radio-group {
    margin-bottom: 0.75rem;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.9);
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0077B5;
}

/* Toggle de Método de Busca */
.search-method-toggle {
    display: flex;
    gap: 0;
    background: var(--muted);
    padding: 0;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

body.dark .search-method-toggle {
    background: var(--input);
}

.toggle-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    position: relative;
    background: transparent;
    min-height: 2.5rem;
    margin: 0;
}

.toggle-option:first-child {
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}

.toggle-option:last-child {
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.toggle-option:not(:last-child) {
    border-right: 1px solid var(--border);
}

.toggle-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.toggle-option span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: color 0.2s;
}

/* Estado ativo usando classe JavaScript */
.toggle-option.active {
    background: var(--primary);
}

.toggle-option.active span {
    color: var(--primary-foreground);
}

.toggle-option:hover:not(.active) {
    background: var(--accent);
}

.country-select-wrapper {
    margin-top: 0.5rem;
    margin-left: 1.5rem;
}

.country-select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 0.875rem;
    background: white;
    color: rgba(0, 0, 0, 0.9);
}

.country-select option {
    padding: 0.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.btn-linkedin {
    background: #0077B5;
    color: white;
    border: none;
    padding: 0.625rem 1.5rem;
    border-radius: 24px;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: background-color 0.2s;
}

.btn-linkedin:hover {
    background: #006399;
}

.btn-secondary {
    background: white;
    color: rgba(0, 0, 0, 0.75);
    border: 1px solid #d0d0d0;
    padding: 0.625rem 1.5rem;
    border-radius: 24px;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: #b0b0b0;
}

/* Connection Status */
.connection-status {
    text-align: center;
    padding: 3rem 2rem;
}

.connection-status.connection-2fa,
.connection-status.connection-success {
    padding: 4rem 2rem;
}

.status-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.status-icon-2fa {
    width: 80px;
    height: 80px;
    color: rgba(0, 0, 0, 0.4);
    margin-bottom: 1rem;
}

.status-icon-success {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.status-title-2fa,
.status-title-success {
    font-size: 1.25rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.9);
    margin: 0;
}

.status-message-2fa {
    font-size: 0.9375rem;
    color: rgba(0, 0, 0, 0.6);
    margin: 0;
}

.status-actions-2fa {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-link-2fa {
    background: none;
    border: none;
    color: #0077B5;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: text-decoration 0.2s;
}

.btn-link-2fa:hover {
    text-decoration: underline;
}

.separator {
    color: rgba(0, 0, 0, 0.3);
    font-size: 0.875rem;
}

.btn-success-close {
    margin-top: 1.5rem;
    min-width: 120px;
    gap: 1rem;
}

.status-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--muted);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.status-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.status-content p {
    color: var(--muted-foreground);
}

/* Responsive for Connections */
@media (max-width: 768px) {
    .connections-content {
        padding: 1rem;
    }
    
    .status-summary {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .connections-header-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .connections-grid {
        grid-template-columns: 1fr;
    }
    
    .empty-actions {
        flex-direction: column;
    }
    
    .empty-actions .btn {
        width: 100%;
    }
}

/* Connection Context Menu */
.connection-context-menu {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    min-width: 200px;
    z-index: 10000;
}

.connection-context-menu .menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--foreground);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    text-align: left;
}

.connection-context-menu .menu-item:hover {
    background: var(--muted);
}

.connection-context-menu .menu-item svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.connection-context-menu .menu-item-danger {
    color: var(--destructive);
}

.connection-context-menu .menu-item-danger:hover {
    background: hsl(0, 84%, 60%, 0.1);
}

/* Expiration Badge */
.connection-card-header {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.expiration-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: none;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.expiration-badge.expiration-critical {
    background: hsl(0, 84%, 60%);
    color: white;
}

.expiration-badge.expiration-warning {
    background: hsl(38, 92%, 50%);
    color: white;
}

.expiration-badge.expiration-ok {
    background: hsl(142, 76%, 36%);
    color: white;
}

/* ============================================
   SEARCHES PAGE STYLES
   ============================================ */

.searches-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Toolbar */
.searches-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
    pointer-events: none;
}

.search-filter-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--foreground);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--foreground);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--muted);
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

/* Stats Summary */
.searches-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-badge {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 120px;
}

.stat-badge-label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.stat-badge-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
}

/* Searches List */
.searches-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.search-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.search-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.search-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.search-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
    flex: 1;
}

.search-card-menu {
    position: relative;
}

.search-card-menu-btn {
    padding: 0.25rem;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-card-menu-btn:hover {
    background: var(--muted);
    color: var(--foreground);
}

.search-card-query {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-card-query svg {
    flex-shrink: 0;
}

.search-card-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.search-card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.search-card-meta-item svg {
    width: 16px;
    height: 16px;
}

.search-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.search-card-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-card-status.status-pending {
    background: hsl(38, 92%, 50%, 0.1);
    color: hsl(38, 92%, 50%);
}

.search-card-status.status-running {
    background: hsl(221, 83%, 53%, 0.1);
    color: hsl(221, 83%, 53%);
}

.search-card-status.status-completed {
    background: hsl(142, 76%, 36%, 0.1);
    color: hsl(142, 76%, 36%);
}

.search-card-status.status-failed {
    background: hsl(0, 84%, 60%, 0.1);
    color: hsl(0, 84%, 60%);
}

.search-card-actions {
    display: flex;
    gap: 0.5rem;
}

.search-card-action-btn {
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-card-action-btn:hover {
    background: var(--muted);
    color: var(--foreground);
}

.search-card-action-btn svg {
    width: 16px;
    height: 16px;
}

/* Empty State */
.searches-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon-wrapper {
    max-width: 400px;
    margin: 0 auto;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    color: var(--muted-foreground);
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.empty-description {
    color: var(--muted-foreground);
    margin-bottom: 2rem;
}

/* Loading State */
.searches-loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--muted-foreground);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal Large */
.modal-large {
    max-width: 600px;
}

.modal-extra-large {
    max-width: 900px;
}

/* Results Content */
.results-content {
    max-height: 600px;
    overflow-y: auto;
}

.results-loading {
    text-align: center;
    padding: 3rem;
    color: var(--muted-foreground);
}

.results-empty {
    text-align: center;
    padding: 3rem;
    color: var(--muted-foreground);
}

.result-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.result-item:hover {
    background: var(--muted);
    /* ✅ NOVO: Quando hover (fundo escuro), texto fica claro para melhor contraste */
}

/* ✅ CORRIGIDO: No modal, hover sempre usa cor escura (mesma do tema escuro) */
.modal-content .result-item:hover,
#search-results-modal .result-item:hover {
    background: hsl(217, 33%, 17%) !important; /* Cor escura fixa (mesma do tema escuro) */
}

/* ✅ NOVO: Cores claras no hover (quando fundo fica escuro) */
.result-item:hover .result-item-name,
.modal-content .result-item:hover .result-item-name,
#search-results-modal .result-item:hover .result-item-name {
    color: #ffffff !important; /* Branco no hover */
}

.result-item:hover .result-item-headline,
.modal-content .result-item:hover .result-item-headline,
#search-results-modal .result-item:hover .result-item-headline {
    color: #d0d0d0 !important; /* Cinza claro no hover */
}

.result-item:hover .result-item-meta,
.modal-content .result-item:hover .result-item-meta,
#search-results-modal .result-item:hover .result-item-meta {
    color: #b0b0b0 !important; /* Cinza médio claro no hover */
}

.result-item:hover .result-item-action-btn {
    color: #d0d0d0 !important; /* Cinza claro no hover */
}

.result-item:hover .result-item-action-btn:hover {
    color: #ffffff !important; /* Branco no hover do botão */
    background: rgba(255, 255, 255, 0.1); /* Fundo branco semi-transparente */
}

.result-item:last-child {
    border-bottom: none;
}

.result-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* ✅ NOVO: Foto de perfil dentro do avatar */
.result-item-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* ✅ NOVO: Fallback (inicial) quando não tem foto ou foto falha */
.result-item-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
    border-radius: 50%;
}

.result-item-content {
    flex: 1;
    min-width: 0;
    /* ✅ NOVO: Centraliza verticalmente o nome (já que não há mais headline/meta) */
    display: flex;
    align-items: center;
}

/* ✅ CORRIGIDO: Cores específicas para dentro do modal (fundo branco) */
.modal-content .result-item-name,
#search-results-modal .result-item-name {
    font-weight: 600;
    font-size: 1rem;
    /* Modal sempre tem fundo branco, então cor escura fixa */
    color: #1a1a1a !important; /* Preto/escuro para melhor contraste no fundo branco */
    /* ✅ REMOVIDO: margin-bottom (não há mais headline abaixo) */
    margin-bottom: 0;
}

/* Fallback para fora do modal (se usado em outros lugares) */
.result-item-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--foreground);
    /* ✅ REMOVIDO: margin-bottom (não há mais headline abaixo) */
    margin-bottom: 0;
}

.modal-content .result-item-headline,
#search-results-modal .result-item-headline {
    font-size: 0.875rem;
    /* Modal sempre tem fundo branco, então cinza escuro para legibilidade */
    color: #4a4a4a !important; /* Cinza escuro legível no fundo branco */
    margin-bottom: 0.5rem;
}

/* Fallback para fora do modal */
.result-item-headline {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}

/* Meta informações também precisam de contraste no modal */
.modal-content .result-item-meta,
#search-results-modal .result-item-meta {
    color: #666 !important; /* Cinza médio no fundo branco */
    font-size: 0.75rem;
}

.result-item-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.result-item-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.result-item-action-btn {
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.result-item-action-btn:hover {
    background: var(--accent);
    color: var(--foreground);
}

/* Search Context Menu */
.search-context-menu {
    position: absolute;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 180px;
    z-index: 10000;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--foreground);
    transition: background 0.2s;
}

.search-menu-item:hover {
    background: var(--muted);
}

.search-menu-item svg {
    width: 16px;
    height: 16px;
}

.search-menu-item.danger {
    color: var(--destructive);
}

.search-menu-item.danger:hover {
    background: hsl(0, 84%, 60%, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .searches-content {
        padding: 1rem;
    }
    
    .searches-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input-wrapper {
        max-width: 100%;
    }
    
    .filter-buttons {
        width: 100%;
        justify-content: stretch;
    }
    
    .filter-btn {
        flex: 1;
    }
    
    .searches-list {
        grid-template-columns: 1fr;
    }
    
    .searches-stats {
        flex-direction: column;
    }
    
    .stat-badge {
        width: 100%;
    }
}

/* ============================================
   LISTAS
   ============================================ */

.lists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 0 1rem;
}

.list-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.list-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.list-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.list-card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--foreground);
    font-weight: 600;
    flex: 1;
}

.list-card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    border-radius: var(--radius);
}

.btn-icon:hover {
    opacity: 1;
    background: var(--muted);
}

.list-description {
    color: var(--muted-foreground);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.list-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.list-card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* Perfis em Lista */
.profiles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
    margin-top: 1rem;
    padding: 0.5rem;
}

.profile-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.profile-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-info h4 {
    margin: 0 0 0.25rem 0;
    color: var(--foreground);
    font-size: 1rem;
    font-weight: 600;
}

.profile-headline {
    margin: 0 0 0.25rem 0;
    color: var(--muted-foreground);
    font-size: 0.9rem;
}

.profile-location {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.85rem;
}

.profile-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    min-width: 200px;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-width: 200px;
    justify-content: flex-end;
}

.tag {
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--foreground);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.status-select:hover {
    border-color: var(--primary);
}

.profile-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filters-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.filters-bar select,
.filters-bar input {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--foreground);
    font-size: 0.9rem;
}

.filters-bar input {
    flex: 1;
    min-width: 200px;
}

/* Modal grande para perfis */
.modal-large {
    max-width: 90%;
    max-height: 90vh;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--muted-foreground);
}

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

/* Responsive para listas */
@media (max-width: 768px) {
    .lists-grid {
        grid-template-columns: 1fr;
        padding: 0;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters-bar input,
    .filters-bar select {
        width: 100%;
    }
    
    .profile-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .profile-meta {
        width: 100%;
        align-items: flex-start;
    }
    
    .profile-tags {
        max-width: 100%;
    }
}
