/* ========================================================
   BaitaBric Studio - Estilos Globais & Interface Moderna
   Design System: Paleta Dark/Light Sofisticada + Vonsel Style
   ======================================================== */

:root {
    /* ========================================================
       TEMA ESCURO (PADRÃO PREFERIDO DO STUDIO)
       ======================================================== */
    --bg-page: #0a0f1d;
    --bg-surface: #11192e;
    --bg-surface-elevated: #17233f;
    --bg-sidebar: #070b14;
    --border-color: #1e293b;
    --border-subtle: #162035;
    
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --primary-light: rgba(56, 189, 248, 0.12);
    --primary-glow: rgba(56, 189, 248, 0.25);

    --accent: #60a5fa;
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info: #38bdf8;
    --info-bg: rgba(56, 189, 248, 0.15);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #64748b;

    --table-header-bg: #0d1526;
    --table-hover-bg: #15223c;
    --input-bg: #0d1527;
    --input-border: #26354f;
    --code-bg: #080d1a;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.6), 0 8px 10px -6px rgba(0,0,0,0.4);
}

[data-theme="light"] {
    /* ========================================================
       TEMA CLARO (ALTERNATIVA DISPONÍVEL)
       ======================================================== */
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-sidebar: #0b1120;
    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-glow: rgba(37, 99, 235, 0.15);

    --accent: #38bdf8;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --info: #0284c7;
    --info-bg: #e0f2fe;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --table-header-bg: #f8fafc;
    --table-hover-bg: #fbfcfe;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --code-bg: #0f172a;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-page);
}

/* Custom Scrollbars Globais Modernas & Adaptativas */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-page);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    display: flex;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Layout Estrutura */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Esquerda */
.sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    border-right: 1px solid #1e293b;
    z-index: 100;
    transition: width 0.25s ease;
    overflow: hidden;
}

.sidebar-header {
    height: 78px;
    min-height: 78px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
    flex-shrink: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.3);
}

.brand-text h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
    margin: 0;
    line-height: 1.1;
}

.brand-text span {
    font-size: 11px;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}
.sidebar-menu:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
}

.menu-category {
    font-size: 9.5px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 8px 10px 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.15s ease;
}

.nav-link i {
    font-size: 15px;
    width: 18px;
    text-align: center;
}

.nav-link:hover {
    color: #ffffff;
    background-color: #1e293b;
}

.nav-link.active {
    color: #ffffff;
    background-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.nav-link .badge {
    margin-left: auto;
    background: #334155;
    color: #f1f5f9;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.nav-link.active .badge {
    background: #ffffff;
    color: #2563eb;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #1e293b;
    border: 2px solid #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    font-weight: 700;
    font-size: 13px;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: #94a3b8;
    text-transform: capitalize;
}

.btn-logout {
    color: #ef4444;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
    text-decoration: none;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Área Principal de Conteúdo */
.main-wrapper {
    flex: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-page);
}

.main-wrapper::-webkit-scrollbar {
    width: 7px;
}
.main-wrapper::-webkit-scrollbar-track {
    background: var(--bg-page);
}
.main-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
.main-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Topbar Superior */
.topbar {
    height: 78px;
    min-height: 78px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    flex-shrink: 0;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18.5px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    line-height: 1.2;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-main);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.theme-toggle-btn i {
    font-size: 13px;
    color: #f59e0b;
}

.server-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--success-bg);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Conteúdo */
.content-body {
    padding: 28px 32px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Footer Global do Sistema */
.app-footer {
    padding: 16px 32px;
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    font-size: 12.5px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    flex-shrink: 0;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.app-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.app-footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.app-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.app-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Flash Messages */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 13.5px;
    animation: fadeIn 0.25s ease;
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Grid de Cards Estatísticos */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.stat-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

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

.stat-icon.blue { background: rgba(56, 189, 248, 0.15); color: var(--primary); }
.stat-icon.green { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.stat-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.stat-icon.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
    margin-bottom: 6px;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Cards e Painéis */
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
    overflow: hidden;
}

.panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-surface);
}

.panel-title {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-body {
    padding: 24px;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: #0b1120;
    font-weight: 700;
    box-shadow: 0 2px 8px var(--primary-glow);
}

[data-theme="light"] .btn-primary {
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
}

.btn-secondary {
    background-color: var(--bg-surface-elevated);
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--border-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #15803d;
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: 6px;
}

/* Formulários */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group.col-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.form-group label small {
    font-weight: 400;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--input-border);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text-main);
    background-color: var(--input-bg);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

/* Tabelas Elegantes */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

.custom-table th {
    background-color: var(--table-header-bg);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.custom-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13.5px;
    color: var(--text-main);
    vertical-align: middle;
}

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

.custom-table tr:hover td {
    background-color: var(--table-hover-bg);
}

/* Tabela Estilo Vonsel (Inspirada na imagem do usuário) */
.vonsel-toolbar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 16px 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.vonsel-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.vonsel-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 300px;
}

.vonsel-row-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.phone-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.vonsel-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.vonsel-status-bar::-webkit-scrollbar {
    height: 4px;
}
.vonsel-status-bar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.vonsel-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-elevated);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.vonsel-filter-pill:hover {
    background: var(--border-subtle);
    border-color: var(--primary);
    color: var(--text-main);
}

.vonsel-filter-pill.active {
    background: var(--primary);
    color: #0b1120;
    border-color: var(--primary);
    box-shadow: 0 2px 6px var(--primary-glow);
}

[data-theme="light"] .vonsel-filter-pill.active {
    color: #ffffff;
}

.vonsel-filter-pill.active i {
    color: inherit !important;
}

.vonsel-view-toggle {
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 3px;
    border-radius: 8px;
}

.vonsel-view-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.15s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vonsel-view-btn.active {
    background: var(--bg-surface);
    color: var(--primary);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.vonsel-search-box {
    position: relative;
    flex: 1;
    max-width: 450px;
}

.vonsel-search-input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border-radius: 20px;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-main);
    font-size: 13px;
    transition: all 0.2s;
}

.vonsel-search-input:focus {
    background-color: var(--bg-surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

.vonsel-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 13px;
}

.vonsel-table-header {
    background: #4f46e5;
    color: #ffffff;
}

.vonsel-table-header th {
    background: #4f46e5 !important;
    color: #ffffff !important;
    font-weight: 600;
    text-transform: none;
    font-size: 13px;
    border-bottom: none;
    padding: 12px 16px;
}

/* Status Badges & Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-online { 
    background: var(--success-bg); 
    color: var(--success); 
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.status-approval { 
    background: rgba(168, 85, 247, 0.15); 
    color: #c084fc; 
    border: 1px solid rgba(168, 85, 247, 0.35);
}
.status-offline { 
    background: var(--danger-bg); 
    color: var(--danger); 
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.status-dev { 
    background: var(--primary-light); 
    color: var(--primary); 
    border: 1px solid rgba(56, 189, 248, 0.3);
}
.status-maintenance { 
    background: var(--warning-bg); 
    color: var(--warning); 
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Dropdown de Status Interativo (Estilo Vonsel da foto) */
.status-dropdown {
    position: relative;
    display: inline-block;
}

.status-btn-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.status-btn-trigger:hover {
    background: var(--border-subtle);
    border-color: var(--primary);
}

.status-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    padding: 6px;
    min-width: 170px;
    z-index: 50;
    display: none;
    flex-direction: column;
    gap: 2px;
    animation: fadeIn 0.15s ease;
}

.status-menu.show {
    display: flex;
}

.status-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    transition: background 0.12s;
}

.status-menu-item:hover {
    background: var(--bg-surface-elevated);
}

.status-menu-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

/* Switch Online / Offline */
.switch-control {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch-control input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border-color);
    transition: .3s;
    border-radius: 24px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .switch-slider {
    background-color: #16a34a;
}

input:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* Kanban Board para CRM Leads */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 20px;
    min-height: 550px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.kanban-column {
    flex: 0 0 290px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.kanban-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.kanban-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.kanban-cards {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 6px 4px 14px 4px;
    margin: -6px -4px 0 -4px;
    min-height: 180px;
    border-radius: var(--radius-sm);
    border: 2px dashed transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.kanban-cards.drag-over {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--primary);
}

.kanban-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    user-select: none;
    position: relative;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--primary-glow);
    border-color: var(--primary);
    z-index: 2;
}

.kanban-card.dragging {
    opacity: 0.45;
    border: 2px dashed var(--primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transform: scale(0.97);
}

.kanban-card-title {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-main);
    margin-bottom: 6px;
}

.kanban-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}

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

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: scaleUp 0.2s ease;
    color: var(--text-main);
}

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

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
}

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

.modal-body {
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface-elevated);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Código Snippet Box */
.code-box {
    background: var(--code-bg);
    color: #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12.5px;
    overflow-x: auto;
    position: relative;
    margin: 10px 0;
    border: 1px solid var(--border-color);
}

.btn-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}

.btn-copy:hover {
    background: var(--primary);
    color: #0b1120;
    border-color: var(--primary);
}

/* ========================================================
   ESTILOS DEDICADOS DA TABELA DE EQUIPE & PROJETOS
   ======================================================== */
.team-table {
    width: 100%;
}

.team-user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.team-avatar-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.team-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.team-user-name {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.team-user-handle {
    font-size: 11.5px;
    color: var(--text-muted);
    font-family: monospace;
}

.badge-root {
    font-size: 9.5px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.google-connected-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    margin-top: 4px;
    width: fit-content;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
}

.role-pill.role-admin {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.role-pill.role-developer {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.role-pill.role-seller {
    background: rgba(236, 72, 153, 0.18);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.35);
}

.team-projects-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.team-project-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px 9px;
    font-size: 12px;
    transition: all 0.15s ease;
}

.team-project-chip:hover {
    border-color: var(--primary);
    background: var(--table-hover-bg);
}

.team-project-name {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.team-project-name i {
    color: var(--primary);
    font-size: 11px;
    flex-shrink: 0;
}

.team-project-name:hover {
    color: var(--primary);
}

.team-split-badge {
    background: var(--success-bg);
    color: var(--success);
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10.5px;
    white-space: nowrap;
    border: 1px solid rgba(34, 197, 94, 0.3);
    flex-shrink: 0;
}

.btn-link-project {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    width: fit-content;
    transition: all 0.15s ease;
    margin-top: 2px;
}

.btn-link-project:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.pix-box {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pix-key-val {
    font-family: 'Consolas', monospace;
    font-size: 11.5px;
    color: var(--text-main);
    background: var(--bg-surface-elevated);
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    word-break: break-all;
}

.pix-type-tag {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.badge-blindado {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    padding: 4px 9px;
    border-radius: 12px;
    border: 1px solid rgba(34, 197, 94, 0.25);
    font-weight: 700;
    white-space: nowrap;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsividade */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: -260px;
        transition: left 0.25s ease;
    }
    .sidebar.open {
        left: 0;
    }
    .topbar {
        padding: 0 16px;
    }
    .content-body {
        padding: 20px 16px;
    }
}
