/* ========================================
   MONITOO ORCHESTRATOR - DESIGN SYSTEM
   Professional UI inspired by N8N
   ======================================== */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors */
    --primary-blue: #0047BB;
    --primary-purple: #7B2CBF;
    --primary-gradient: linear-gradient(135deg, #0047BB 0%, #7B2CBF 100%);
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Semantic Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --error: #ef4444;
    --error-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Background */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --hover-bg: #f3f4f6;
    --badge-bg: rgba(123, 44, 191, 0.1);
    --info-bg: rgba(59, 130, 246, 0.1);
    
    /* Table */
    --table-header-bg: #eef2ff;
    --table-stripe-bg: #f8fafc;
    
    /* Text */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --text-inverse: #ffffff;
    
    /* Border */
    --border-color: #e5e7eb;
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 14px;
    --border-radius-xl: 20px;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.25rem;  /* 20px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-10: 2.5rem;  /* 40px */
    --space-12: 3rem;    /* 48px */
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 64px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* API Test Palette */
    --api-hero-gradient: radial-gradient(circle at 10% 20%, rgba(102, 126, 234, 0.25) 0%, rgba(255, 255, 255, 0) 45%), radial-gradient(circle at 90% 10%, rgba(118, 75, 191, 0.3) 0%, rgba(255, 255, 255, 0) 40%), #f6f5ff;
    --api-card-glass: rgba(255, 255, 255, 0.75);
    --api-card-border: rgba(99, 102, 241, 0.2);
}

/* === TYPOGRAPHY === */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.menu-open {
    overflow: hidden;
    touch-action: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

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

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-8);
    background: var(--bg-secondary);
}

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

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-slow);
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: var(--header-height);
    background: linear-gradient(135deg, rgba(0, 71, 187, 0.02) 0%, rgba(123, 44, 191, 0.02) 100%);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    overflow: hidden;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 71, 187, 0.25);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    transition: opacity var(--transition-base);
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

/* === MENU === */
.menu {
    flex: 1;
    padding: var(--space-4) var(--space-3);
    overflow-y: auto;
    overflow-x: hidden;
}

.menu::-webkit-scrollbar {
    width: 6px;
}

.menu::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.menu-section {
    margin-bottom: var(--space-6);
}

.menu-section-title {
    padding: var(--space-2) var(--space-4);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    transition: all var(--transition-base);
}

.sidebar.collapsed .menu-section-title {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
}

.menu-item {
    padding: var(--space-2) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--border-radius-md);
    margin-bottom: var(--space-1);
    position: relative;
    white-space: nowrap;
}

.menu-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-item-icon svg {
    width: 20px;
    height: 20px;
}

.menu-item-text {
    flex: 1;
    transition: opacity var(--transition-base);
}

.sidebar.collapsed .menu-item-text {
    opacity: 0;
    width: 0;
}

.menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.menu-item.active {
    background: linear-gradient(135deg, rgba(0, 71, 187, 0.08) 0%, rgba(123, 44, 191, 0.08) 100%);
    color: var(--primary-blue);
    font-weight: 600;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary-gradient);
    border-radius: 0 2px 2px 0;
}

.menu-badge {
    background: var(--primary-blue);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    transition: all var(--transition-base);
}

.sidebar.collapsed .menu-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

/* Tooltip para sidebar colapsado */
.sidebar.collapsed .menu-item::after {
    content: attr(data-title);
    position: absolute;
    left: calc(100% + 12px);
    padding: var(--space-2) var(--space-3);
    background: var(--gray-900);
    color: white;
    font-size: 13px;
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    z-index: 1000;
}

.sidebar.collapsed .menu-item:hover::after {
    opacity: 1;
}

/* === SIDEBAR FOOTER === */
.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.user-info:hover {
    background: var(--bg-primary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
    position: relative;
}

.user-avatar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: var(--success);
    border: 2px solid var(--bg-secondary);
    border-radius: 50%;
}

.user-details {
    flex: 1;
    overflow: hidden;
    transition: opacity var(--transition-base);
}

.sidebar.collapsed .user-details {
    opacity: 0;
    width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === HEADER === */
.header {
    background: var(--bg-primary);
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--header-height);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.header-breadcrumb {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 400;
}

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

body.dark-mode .header {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* === BUTTONS === */
.btn {
    padding: 11px 20px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.btn:hover svg {
    transform: scale(1.1);
}

.btn-primary {
    background: linear-gradient(135deg, #0047BB 0%, #7B2CBF 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(0, 71, 187, 0.3);
    border: 2px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 71, 187, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 71, 187, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background: white;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(0, 71, 187, 0.15);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

body.dark-mode .btn-secondary {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-mode .btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: rgba(0, 71, 187, 0.05);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: var(--error);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon:hover {
    background: white;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(0, 71, 187, 0.15);
    transform: translateY(-2px);
}

.btn-icon:active {
    transform: translateY(0);
}

body.dark-mode .btn-icon {
    background: var(--bg-tertiary);
}

body.dark-mode .btn-icon:hover {
    background: var(--bg-primary);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Loader animation for buttons */
.btn.loading {
    pointer-events: none;
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

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

/* === CARDS === */
.card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
    overflow: visible;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    margin-bottom: var(--space-4);
    overflow: visible;
}

.card-footer {
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-color);
}

/* === STAT CARDS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

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

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
}

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

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.blue { background: rgba(0, 71, 187, 0.1); color: var(--primary-blue); }
.stat-icon.purple { background: rgba(123, 44, 191, 0.1); color: var(--primary-purple); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--error-light); color: var(--error); }

.stat-trend {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 12px;
    font-weight: 600;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--border-radius-sm);
}

.stat-trend.up { background: var(--success-light); color: var(--success); }
.stat-trend.down { background: var(--error-light); color: var(--error); }

.stat-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.stat-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* === FORMS === */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background: var(--bg-primary);
    transition: all var(--transition-base);
    font-family: inherit;
    color: var(--text-primary);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 71, 187, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-tertiary);
}

.form-error {
    color: var(--error);
    font-size: 13px;
    margin-top: var(--space-1);
}

.form-help {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: var(--space-1);
}

/* === TABLES === */
.table-container {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--bg-secondary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
}

.badge-primary { background: rgba(0, 71, 187, 0.1); color: var(--primary-blue); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-error { background: var(--error-light); color: var(--error); }
.badge-info { background: var(--info-light); color: var(--info); }

/* === FLOWS GRID (MODERN CARDS) === */
.flows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
    padding: 0;
}

@media (max-width: 768px) {
    .flows-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.flow-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.flow-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.flow-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
    border-color: rgba(102, 126, 234, 0.3);
}

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

.flow-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color);
}

.flow-card-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flow-card-type svg {
    width: 18px;
    height: 18px;
}

.flow-card-type.visual {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.flow-card-type.python {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.flow-card-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: capitalize;
}

.flow-card-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.flow-card-status.status-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.flow-card-status.status-success .status-dot {
    background: #10b981;
}

.flow-card-status.status-draft {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.flow-card-status.status-draft .status-dot {
    background: #f59e0b;
}

.flow-card-status.status-inactive {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.flow-card-status.status-inactive .status-dot {
    background: #6b7280;
}

.flow-card-body {
    padding: 20px 24px;
    flex: 1;
}

.flow-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flow-card-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.flow-card-description.text-muted {
    color: var(--text-tertiary);
    font-style: italic;
}

.flow-card-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.flow-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.meta-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.meta-item.version {
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    color: var(--text-secondary);
}

.flow-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-action:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: rgba(0, 71, 187, 0.05);
    transform: translateY(-1px);
}

.btn-action:active {
    transform: translateY(0);
}

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

.btn-action.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-action.primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3fa0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* === DARK MODE ADJUSTMENTS FOR FLOW CARDS === */
body.dark-mode .flow-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .flow-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.4);
}

body.dark-mode .flow-card-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .flow-card-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .meta-item.version {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .btn-action {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

body.dark-mode .btn-action:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
    color: #a5b4fc;
}

/* === CONNECTIONS GRID (MODERN CARDS) === */
.connections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .connections-grid {
        grid-template-columns: 1fr;
    }
}

.connection-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.connection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    border-color: rgba(102, 126, 234, 0.3);
}

.connection-card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
}

.connection-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.connection-icon-wrapper svg {
    width: 26px;
    height: 26px;
    color: white;
}

.connection-icon-wrapper.icon-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

.connection-icon-wrapper.icon-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

.connection-icon-wrapper.icon-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
}

.connection-icon-wrapper.icon-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}

.connection-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.connection-status-badge .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.connection-status-badge.status-active {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.connection-status-badge.status-active .status-dot {
    background: #10b981;
}

.connection-status-badge.status-inactive {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.connection-status-badge.status-inactive .status-dot {
    background: #ef4444;
}

.connection-card-body {
    padding: 18px 20px;
    flex: 1;
}

.connection-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.connection-type-label {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0 0 14px 0;
}

.connection-details {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.detail-label {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.detail-value {
    font-size: 13px;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    text-align: right;
}

.detail-value.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.connection-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 6px;
    background: var(--bg-secondary);
}

.connection-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.connection-btn:hover {
    transform: translateY(-1px);
}

.connection-btn svg {
    width: 16px;
    height: 16px;
}

.connection-btn.btn-test {
    flex: 1;
}

.connection-btn.btn-test:hover {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.connection-btn.btn-explore {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.connection-btn.btn-explore:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3fa0 100%);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.connection-btn.btn-icon-only {
    padding: 8px;
}

.connection-btn.btn-icon-only:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: rgba(0, 71, 187, 0.05);
}

.connection-btn.btn-danger:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* Dark Mode */
body.dark-mode .connection-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .connection-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(102, 126, 234, 0.4);
}

body.dark-mode .connection-card-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
}

body.dark-mode .connection-card-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

body.dark-mode .connection-details {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-mode .connection-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

body.dark-mode .connection-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* === MODERN TABLE STYLES === */
.modern-table-container {
    background: var(--bg-primary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.modern-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.modern-table thead th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: none;
}

.modern-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.modern-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.modern-table tbody tr:last-child {
    border-bottom: none;
}

.modern-table tbody td {
    padding: 16px 20px;
    vertical-align: middle;
}

.modern-table tbody td.col-actions {
    position: relative;
    overflow: visible;
}

/* Column Specific Styles */
.col-name { min-width: 280px; }
.col-type { min-width: 120px; }
.col-status { min-width: 120px; }
.col-version { min-width: 80px; text-align: center; }
.col-date { min-width: 140px; }
.col-actions { min-width: 240px; }

/* Flow Name Cell */
.flow-name-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.flow-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.flow-desc {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* Type Badge */
.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.type-badge svg {
    width: 14px;
    height: 14px;
}

.type-badge.visual {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
}

.type-badge.python {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
}

.status-badge .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.status-badge.status-success {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.status-badge.status-success .status-dot {
    background: #10b981;
}

.status-badge.status-draft {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.status-badge.status-draft .status-dot {
    background: #f59e0b;
}

.status-badge.status-inactive {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
}

.status-badge.status-inactive .status-dot {
    background: #6b7280;
}

/* Version Badge */
.version-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Date Column */
.time-text {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.action-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: rgba(0, 71, 187, 0.05);
    transform: translateY(-1px);
}

.action-btn svg {
    width: 14px;
    height: 14px;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3fa0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

/* Menu Dropdown de Ações */
.actions-menu-container {
    position: relative;
    display: inline-block;
}

.actions-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.actions-menu-btn:hover {
    background: rgba(0, 71, 187, 0.05);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: scale(1.05);
}

.actions-menu-btn svg {
    width: 16px;
    height: 16px;
}

.actions-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 9999;
    overflow: visible;
}

.actions-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.actions-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.actions-dropdown-item:hover {
    background: rgba(0, 71, 187, 0.05);
}

.actions-dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.actions-dropdown-item.danger {
    color: #ef4444;
}

.actions-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.08);
}

.actions-dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 4px 0;
}

/* Dark Mode */
body.dark-mode .modern-table-container {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .modern-table tbody tr {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .modern-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1);
}

body.dark-mode .version-badge {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .action-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

body.dark-mode .action-btn:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.4);
    color: #a5b4fc;
}

/* === ALERTS === */
.alert {
    padding: var(--space-4);
    border-radius: var(--border-radius-md);
    border: 1px solid;
    margin-bottom: var(--space-4);
}

.alert-success {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success);
}

.alert-warning {
    background: var(--warning-light);
    border-color: var(--warning);
    color: var(--warning);
}

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

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

/* === EMPTY STATES === */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-5);
    color: var(--text-secondary);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    color: var(--text-tertiary);
}

.empty-state-icon svg {
    width: 100%;
    height: 100%;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* === Marketing Insights Progress === */
.marketing-progress-card {
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(14,165,233,0.08));
    padding: 16px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transition: var(--transition-base);
}
/* Garantir que o painel esteja completamente oculto quando não visível */
#marketing-insights-progress[style*="display: none"],
#marketing-insights-progress:not([style*="display: block"]) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    margin-top: 0 !important;
    border: none !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Garantir que quando o painel está oculto, não ocupe espaço */
#marketing-insights-progress[style*="display: none"] {
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
}
.marketing-progress-card.is-success {
    border-color: rgba(16,185,129,0.3);
    background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(5,150,105,0.08));
}
.marketing-progress-card.is-error {
    border-color: rgba(239,68,68,0.35);
    background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(248,113,113,0.08));
}
.marketing-progress-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.marketing-progress-head strong {
    font-size: 1rem;
    color: var(--text-primary);
}
.marketing-progress-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 10px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}
.marketing-progress-close {
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    line-height: 1;
}
.marketing-progress-close:hover {
    color: var(--text-primary);
}
.marketing-progress-steps {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.marketing-progress-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px dashed rgba(99,102,241,0.2);
}
.marketing-progress-step.is-running {
    border-style: solid;
    border-color: rgba(99,102,241,0.4);
    background: rgba(99,102,241,0.08);
}
.marketing-progress-step.is-success {
    border-color: rgba(16,185,129,0.4);
    background: rgba(16,185,129,0.08);
}
.marketing-progress-step.is-error {
    border-color: rgba(239,68,68,0.4);
    background: rgba(239,68,68,0.08);
}
.marketing-progress-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.marketing-progress-icon.is-running {
    animation: pulse 1.2s ease-in-out infinite;
    background: rgba(99,102,241,0.15);
    color: #4f46e5;
}
.marketing-progress-step small {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}
.marketing-progress-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.85); opacity: 0.65; }
    100% { transform: scale(1); opacity: 1; }
}

/* === UTILITIES === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.text-center { text-align: center; }
.text-right { text-align: right; }

/* === MODAL === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0;
    background: var(--bg-primary);
}

/* Connection Type Cards */
.connection-type-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.connection-type-card:hover {
    border-color: var(--primary-blue);
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 71, 187, 0.15);
}

body.dark-mode .connection-type-card {
    border-color: var(--border-color);
}

body.dark-mode .connection-type-card:hover {
    border-color: var(--primary-blue);
    background: var(--bg-tertiary);
}

/* === BUTTON SIZE VARIANTS === */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 12px;
}

.btn-lg svg {
    width: 20px;
    height: 20px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* === DARK MODE === */
body.dark-mode {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #374151;
    --card-bg: #1f2937;
    --input-bg: #111827;
    --hover-bg: #374151;
    --badge-bg: rgba(167, 139, 250, 0.15);
    --info-bg: rgba(96, 165, 250, 0.15);
    
    /* Table */
    --table-header-bg: #374151;
    --table-stripe-bg: rgba(255, 255, 255, 0.02);
    
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --text-tertiary: #9ca3af;
    
    --border-color: #374151;
    
    --gray-50: #111827;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;
}

body.dark-mode .card,
body.dark-mode .stat-card,
body.dark-mode .sidebar,
body.dark-mode .header {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .form-input:focus,
body.dark-mode .form-textarea:focus,
body.dark-mode .form-select:focus {
    box-shadow: 0 0 0 3px rgba(0, 71, 187, 0.2);
}

body.dark-mode code {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

body.dark-mode .table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Cards no modo escuro - aumentar contraste */
body.dark-mode .stat-card {
    background: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .stat-icon {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

body.dark-mode .stat-icon svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

body.dark-mode .stat-value {
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.dark-mode .stat-title {
    color: var(--text-secondary) !important;
}

body.dark-mode .stat-subtitle {
    color: var(--text-tertiary) !important;
}

body.dark-mode .trend-badge {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
}

/* === TOAST NOTIFICATIONS === */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #10b981;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    max-width: 400px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }
.toast.warning { background: #f59e0b; }
.toast.info { background: #3b82f6; }

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

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 1000;
        height: 100vh;
    }

    .sidebar.open {
        left: 0;
    }

    .content {
        padding: var(--space-5);
    }

    .header {
        padding: var(--space-4) var(--space-5);
    }

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

/* ========================================
   SISTEMA DE MODAIS E NOTIFICAÇÕES
   ======================================== */

/* === TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 480px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.toast-success {
    border-color: var(--success);
}

.toast-success .toast-icon {
    background: var(--success-light);
    color: var(--success);
}

.toast-error {
    border-color: var(--error);
}

.toast-error .toast-icon {
    background: var(--error-light);
    color: var(--error);
}

.toast-warning {
    border-color: var(--warning);
}

.toast-warning .toast-icon {
    background: var(--warning-light);
    color: var(--warning);
}

.toast-info {
    border-color: var(--info);
}

.toast-info .toast-icon {
    background: var(--info-light);
    color: var(--info);
}

.toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* === MODAL OVERLAY === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay-show {
    opacity: 1;
}

/* === MODAL DIALOG === */
.modal {
    background: var(--bg-primary);
    border-radius: var(--border-radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-show {
    transform: scale(1);
    opacity: 1;
}

.modal-content {
    padding: 32px;
    text-align: center;
    position: relative;
}

.modal.modal-wide {
    max-width: min(920px, 95vw);
    width: 95vw;
}

.modal.modal-wide .modal-content {
    text-align: left;
}

.modal.modal-wide .modal-icon {
    margin-left: 0;
}

.modal.modal-wide .modal-message {
    text-align: left;
    max-height: 60vh;
    overflow-y: auto;
}

.modal.modal-wide .modal-buttons {
    justify-content: flex-end;
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon-success {
    background: var(--success-light);
    color: var(--success);
}

.modal-icon-error {
    background: var(--error-light);
    color: var(--error);
}

.modal-icon-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.modal-icon-info,
.modal-icon-confirm {
    background: var(--info-light);
    color: var(--info);
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.modal-message {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 28px;
    white-space: pre-line;
}

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

.modal-buttons .btn {
    min-width: 120px;
}

.modal .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 6px;
    line-height: 0;
    border-radius: var(--border-radius-sm);
    transition: background 0.2s ease, color 0.2s ease;
}

.modal .modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* === LOADING SPINNER === */
.modal-loading {
    background: var(--bg-primary);
    border-radius: var(--border-radius-xl);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

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

.loading-message {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

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

/* === DARK MODE === */
body.dark-mode .toast {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

body.dark-mode .modal,
body.dark-mode .modal-loading {
    background: var(--bg-secondary);
}

body.dark-mode .modal-icon-success {
    background: rgba(16, 185, 129, 0.2);
}

body.dark-mode .modal-icon-error {
    background: rgba(239, 68, 68, 0.2);
}

body.dark-mode .modal-icon-warning {
    background: rgba(245, 158, 11, 0.2);
}

body.dark-mode .modal-icon-info,
body.dark-mode .modal-icon-confirm {
    background: rgba(59, 130, 246, 0.2);
}

body.dark-mode .toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.2);
}

body.dark-mode .toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.2);
}

body.dark-mode .toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.2);
}

body.dark-mode .toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.2);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
}

.setting-row:last-child {
    border-bottom: none;
}

.settings-label {
    font-weight: 600;
    color: var(--text-primary);
}

.settings-help {
    font-size: 12px;
    color: var(--text-tertiary);
}

.settings-account-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.settings-account-summary .settings-label {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

.settings-account-summary .settings-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.settings-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
    align-items: flex-end;
}

.filters-grid .form-group {
    margin: 0;
}

/* ========================================
   MOBILE-FIRST RESPONSIVE DESIGN
   100% Otimizado para dispositivos móveis
   ======================================== */

/* === MOBILE MENU TOGGLE === */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.35);
    z-index: 999;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.show {
    opacity: 1;
    display: block;
    pointer-events: auto;
}

/* === TABLET (768px - 1024px) === */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
        --header-height: 60px;
    }
    
    .content {
        padding: var(--space-5);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .connections-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .modern-table-container {
        overflow-x: auto;
    }
}

/* === MOBILE (max-width: 768px) === */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
        --header-height: 56px;
        --space-4: 0.875rem;
        --space-5: 1rem;
        --space-6: 1.25rem;
    }
    
    body {
        font-size: 15px;
    }
    
    /* === LAYOUT === */
    .app-container {
        display: block;
    }
    
    /* === SIDEBAR === */
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(320px, 85vw);
        max-width: 360px;
        transform: translateX(-110%);
        z-index: 1000;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        border-right: none;
        border-radius: 0 20px 20px 0;
        background: var(--bg-primary);
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(15, 15, 15, 0.35);
    }
    
    .sidebar-header {
        padding: 16px 20px;
        position: sticky;
        top: 0;
        background: var(--bg-primary);
        z-index: 1;
    }
    
    .menu {
        padding: 12px 18px 80px;
    }
    
    .menu-section {
        margin-bottom: 18px;
    }
    
    .menu-section-title {
        font-size: 10px;
        letter-spacing: 0.4px;
    }
    
    .menu-item {
        padding: 14px 18px;
        font-size: 15px;
        border-radius: 14px;
    }
    
    .menu-item svg {
        width: 22px;
        height: 22px;
    }
    
    /* === HEADER === */
    .header {
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        padding: 14px 16px 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        height: auto;
        border-bottom: 1px solid var(--border-color);
    }
    
    .header-left {
        width: 100%;
    }
    
    .header-title {
        font-size: 22px;
    }
    
    .header-breadcrumb {
        font-size: 12px;
    }
    
    .header-right {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .header-right .btn-icon {
        order: 0;
        flex: 0 0 44px;
        height: 44px;
    }
    
    .header-right .btn {
        order: 1;
        flex: 1 1 100%;
    }
    
    /* === CONTENT === */
    .content {
        margin-left: 0;
        padding: 16px;
        min-height: calc(100vh - var(--header-height));
    }
    
    /* === CARDS === */
    .card {
        border-radius: 12px;
        margin-bottom: 16px;
    }
    
    .card-header {
        padding: 16px;
    }
    
    .card-title {
        font-size: 17px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    /* === STATS GRID === */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    /* === BUTTONS === */
    .btn {
        padding: 12px 20px;
        font-size: 15px;
        min-height: 44px; /* Touch-friendly */
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* === FORMS === */
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px; /* Evita zoom no iOS */
        padding: 12px 14px;
        min-height: 44px;
    }
    
    .form-label {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    /* === TABLES === */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: -16px;
        padding: 16px;
    }
    
    .modern-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .modern-table {
        min-width: 600px;
        font-size: 13px;
    }
    
    .modern-table thead th {
        padding: 12px 14px;
        font-size: 11px;
        position: sticky;
        top: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        z-index: 10;
    }
    
    .modern-table tbody td {
        padding: 12px 14px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .action-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }
    
    /* === CONNECTIONS GRID === */
    .connections-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .connection-card {
        border-radius: 12px;
    }
    
    .connection-card-header {
        padding: 14px 16px;
    }
    
    .connection-icon-wrapper {
        width: 48px;
        height: 48px;
    }
    
    .connection-icon-wrapper svg {
        width: 24px;
        height: 24px;
    }
    
    .connection-name {
        font-size: 16px;
    }
    
    .connection-card-body {
        padding: 14px 16px;
    }
    
    .connection-card-footer {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .connection-btn {
        flex: 1;
        min-width: calc(50% - 4px);
        justify-content: center;
        min-height: 40px;
    }
    
    .connection-btn.btn-icon-only {
        flex: 0;
        min-width: 40px;
    }
    
    /* === FLOWS GRID === */
    .flows-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* === MODALS === */
    .modal-content {
        width: 95%;
        max-width: 500px;
        margin: 20px;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 16px;
        flex-direction: column-reverse;
        gap: 8px;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* === TOAST === */
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
        padding: 14px 16px;
    }
    
    /* === AI CONSOLE === */
    #ai-console-container {
        padding: 16px;
    }
    
    #ai-query-input {
        font-size: 16px;
        padding: 14px;
        min-height: 100px;
    }
    
    #ai-results {
        margin-top: 16px;
    }
    
    /* === FILTERS === */
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* === MOBILE MENU TOGGLE === */
    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 16px;
        font-weight: 600;
        width: 54px;
        height: 54px;
        right: 16px;
        bottom: 24px;
        border-radius: 16px;
    }
    
    .mobile-overlay.show {
        display: block;
    }
    
    /* === HIDE DESKTOP ELEMENTS === */
    .desktop-only {
        display: none !important;
    }
    
    /* === TOUCH IMPROVEMENTS === */
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    button, a, .clickable {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* === SCROLL IMPROVEMENTS === */
    .card-body,
    .modal-body,
    .table-container {
        -webkit-overflow-scrolling: touch;
    }
}

/* === API TEST PAGE === */
.api-test-hero-card {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    margin-bottom: 32px;
    padding: 48px 40px;
    border-radius: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.api-test-hero-content {
    flex: 1 1 360px;
}

.api-test-hero-content h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.api-test-hero-selector {
    flex: 0 0 380px;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.api-test-hero-selector label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: block;
}

.api-test-flow-select {
    border-radius: 12px;
    border: 2px solid var(--border-color);
    padding: 14px 16px;
    font-weight: 500;
    font-size: 15px;
    background: var(--card-bg);
    color: var(--text-primary);
    width: 100%;
    margin-top: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.api-test-flow-select:hover {
    border-color: var(--primary-purple);
}

.api-test-flow-select:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(123, 44, 191, 0.1);
}

.api-test-eyebrow {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary-purple);
    margin-bottom: 12px;
    font-weight: 600;
}

.api-test-description {
    color: var(--text-secondary);
    max-width: 640px;
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.6;
}

.api-test-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.api-test-hero-tags .badge,
.api-test-status-pill {
    background: var(--badge-bg);
    color: var(--primary-purple);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    display: inline-block;
    margin-top: 12px;
}

.api-test-layout {
    display: grid;
    grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
    gap: 28px;
}

.api-test-left-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: calc(var(--header-height) + 20px);
    align-self: flex-start;
    border-radius: 20px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 28px;
}

.api-test-right-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.api-test-flow-summary {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
    border: 2px solid var(--border-color);
    font-size: 14px;
}

.api-test-samples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.api-test-samples button {
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.api-test-samples button:hover {
    border-color: var(--primary-purple);
    color: var(--primary-purple);
    box-shadow: var(--shadow-md);
    background: var(--hover-bg);
    transform: translateY(-1px);
}

.api-test-form .form-group {
    margin-bottom: 18px;
}

.api-test-form textarea {
    resize: vertical;
    min-height: 120px;
}

.api-test-form label {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: inline-block;
}

.api-test-form-help {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

.api-test-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.api-test-chat-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: 20px;
    padding: 32px;
    min-height: 400px;
}

.api-test-empty-state {
    padding: 60px 20px;
    text-align: center;
}

.api-test-data-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border-radius: 12px;
    overflow: hidden;
}

.api-test-data-table th {
    text-align: left;
    padding: 14px 16px;
    background: var(--table-header-bg);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

.api-test-data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.api-test-data-table tr:nth-child(even) {
    background: var(--table-stripe-bg);
}

.api-test-data-table tr:hover {
    background: var(--hover-bg);
}

.api-test-right-panel pre {
    max-height: 300px;
    overflow: auto;
    border-radius: 12px;
    background: var(--bg-secondary);
    padding: 16px;
    border: 2px solid var(--border-color);
}

.api-test-analysis-block {
    background: var(--info-bg);
    border-left: 4px solid var(--primary-purple);
    padding: 20px;
    border-radius: 12px;
    line-height: 1.7;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    font-size: 15px;
}

.api-test-analysis-block p {
    margin-bottom: 12px;
}

.api-test-analysis-block p:last-child {
    margin-bottom: 0;
}

@media (max-width: 1100px) {
    .api-test-layout {
        grid-template-columns: 1fr;
    }

    .api-test-left-panel {
        position: relative;
        top: auto;
    }
}

/* === SMALL MOBILE (max-width: 480px) === */
@media (max-width: 480px) {
    :root {
        --space-4: 0.75rem;
        --space-5: 0.875rem;
        --space-6: 1rem;
    }
    
    body {
        font-size: 14px;
    }
    
    .content {
        padding: 12px;
    }
    
    .card {
        border-radius: 10px;
    }
    
    .card-header,
    .card-body {
        padding: 12px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 10px 12px;
    }
    
    .connection-btn {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .action-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .modal-content {
        width: 100%;
        margin: 10px;
        max-height: calc(100vh - 20px);
        border-radius: 12px;
    }
    
    .toast {
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* === LANDSCAPE MODE === */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 240px;
        left: -240px;
    }
    
    .modal-content {
        max-height: 90vh;
    }
}

/* === PRINT === */
@media print {
    .sidebar,
    .header-actions,
    .mobile-menu-toggle,
    .btn,
    .action-buttons {
        display: none !important;
    }
    
    .content {
        margin-left: 0;
        padding: 0;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* === Garantir que páginas não ativas fiquem ocultas === */
#page-settings[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
}
