@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('super-features.css');
:root {
    --bg-dark: #0f1115;
    --bg-card: rgba(25, 28, 35, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --primary: #4f46e5;
    --primary-hover: #6366f1;
    --secondary: #10b981;
    --danger: #ef4444;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.3);
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Efeito de ruído super sutil misturado no fundo escuro */
    background-image: radial-gradient(circle at 15% 50%, rgba(79, 70, 229, 0.15), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1), transparent 25%);
    background-attachment: fixed;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
}

/* Layout Centered for Auth */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    animation: revealUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Forms */
.input-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.input-glass {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-glass:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.5);
    opacity: 1;
    cursor: pointer;
    font-size: 1.2rem;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Form Grid (Auth) */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
}

.form-grid .input-group {
    margin-bottom: 0;
}

.form-grid .col-span-2 {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-grid .col-span-2 {
        grid-column: span 1;
    }
}

.auth-logo {
    width: 80px;
    height: auto;
    margin: 0 auto 1rem;
    display: block;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Auth Social */
.btn-google {
    background: #fff;
    color: #3f3f46;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.btn-google:hover {
    background: #f4f4f5;
    box-shadow: 0 4px 12px rgba(255,255,255,0.1);
}

.btn-google img {
    width: 20px;
    height: 20px;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-glass);
}

.auth-divider span {
    padding: 0 10px;
}

/* Wizard */
.wizard-step {
    display: none;
    animation: revealUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.wizard-step.active {
    display: block;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.wizard-nav .btn-secondary,
.wizard-nav .btn-primary {
    flex: 1;
}

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

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

.auth-footer a:hover {
    color: #818cf8;
}

/* Loader Spin */
.spinner {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    width: 1rem;
    height: 1rem;
    animation: spin 1s linear infinite;
}

/* Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-left: 4px solid var(--primary);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

/* Animations */
@keyframes revealUp {
    0% { opacity: 0; transform: translateY(20px); filter: blur(5px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

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

@keyframes slideInRight {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* ------------------- DASHBOARD LAYOUT ------------------- */
.dashboard-body {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-glass);
    border-radius: 0;
    height: 100%;
}

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

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.icon-btn:hover {
    color: #fff;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.nav-item.active {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary-hover);
    border-left: 3px solid var(--primary);
}

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

.text-danger {
    color: var(--danger);
}
.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-header {
    height: 70px;
    border-radius: 0;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    width: 300px;
}

.header-search input {
    border: none;
    background: transparent;
    color: #fff;
    outline: none;
    width: 100%;
}

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

.user-badge {
    background: rgba(255,255,255,0.1);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.content-area {
    padding: 2rem;
}

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

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

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

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2.5rem;
    background: rgba(255,255,255,0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-info h2 {
    font-size: 1.8rem;
    margin-top: 0.2rem;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.panel {
    display: flex;
    flex-direction: column;
}

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

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.panel-body {
    padding: 1.5rem;
    flex: 1;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Modais */
.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: 1000;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 0;
    animation: revealUp 0.3s forwards;
}

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

.modal-content form {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-weight: 500;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
}

.text-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}
.text-link:hover {
    text-decoration: underline;
}

/* Projects & Agents Grid */
.projects-grid, .agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card, .agent-card {
    padding: 1.5rem;
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover, .agent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.project-card-body h3 {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
}

/* Agent Cards */
.agent-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.agent-avatar {
    width: 48px;
    height: 48px;
    background: rgba(79, 70, 229, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary);
}

.agent-card-header h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.agent-status {
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-weight: 600;
}

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

.status-inactive {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.agent-prompt-preview {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
    min-height: 40px;
}

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

.agent-model {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-delete-agent {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.4rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-delete-agent:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Text Muted */
.text-muted {
    color: var(--text-muted);
}

/* Todo Form */
.todo-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.todo-form input {
    flex: 1;
}

.btn-primary-small {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary-small:hover {
    background: var(--primary-hover);
}

.icon-btn-small {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.icon-btn-small:hover {
    color: #fff;
}

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

/* Textarea / Select styling */
textarea.input-glass, select.input-glass {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

textarea.input-glass:focus, select.input-glass:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

select.input-glass option {
    background: #1a1d25;
    color: #fff;
}

/* Range Input */
.input-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    outline: none;
    margin-top: 0.5rem;
}

.input-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(79, 70, 229, 0.4);
}

/* ------------------- INSTANCE TABLE ------------------- */
.instance-table-wrapper {
    overflow-x: auto;
}

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

.instance-table thead {
    background: rgba(0,0,0,0.2);
}

.instance-table th {
    padding: 0.9rem 1.25rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-glass);
}

.instance-table td {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}

.instance-table tbody tr {
    transition: background 0.15s;
}

.instance-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

.instance-table code {
    background: rgba(255,255,255,0.06);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Instance status badges */
.instance-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.status-connected {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-disconnected {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.status-connecting {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.status-unknown {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

/* Action buttons in table */
.actions-cell {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid transparent;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.action-btn:hover {
    color: #fff;
    border-color: var(--border-glass);
}

.action-connect:hover { color: #25D366; background: rgba(37, 211, 102, 0.1); }
.action-restart:hover { color: #fbbf24; background: rgba(251, 191, 36, 0.1); }
.action-status:hover { color: #60a5fa; background: rgba(96, 165, 250, 0.1); }
.action-send:hover { color: #818cf8; background: rgba(129, 140, 248, 0.1); }
.action-logout:hover { color: #f97316; background: rgba(249, 115, 22, 0.1); }
.action-delete:hover { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

/* ================= CHAT MONITOR ================= */
.chat-sidebar {
    width: 320px;
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    background: rgba(0,0,0,0.15);
}

.chat-sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-sidebar-header h3 {
    font-size: 1.1rem;
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.conversation-item:hover {
    background: rgba(255,255,255,0.05);
}

.conversation-item.conv-active {
    background: rgba(79, 70, 229, 0.12);
    border-left: 3px solid var(--primary);
}

.conv-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
    flex-shrink: 0;
}

.conv-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.conv-info strong {
    font-size: 0.95rem;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-main-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(0,0,0,0.1);
}

.chat-main-header h3 {
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-bubble {
    max-width: 75%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    animation: revealUp 0.2s ease;
}

.bubble-user {
    align-self: flex-start;
    background: rgba(255,255,255,0.06);
    border-bottom-left-radius: 2px;
}

.bubble-agent {
    align-self: flex-end;
    background: rgba(79, 70, 229, 0.15);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-bottom-right-radius: 2px;
}

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

.bubble-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.bubble-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.bubble-content {
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-legend {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    gap: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}

.legend-user { background: rgba(255,255,255,0.2); }
.legend-agent { background: rgba(79, 70, 229, 0.5); }

/* ================= WIZARD / AGENTE FÁCIL ================= */
.wizard-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 2rem auto;
    max-width: 600px;
}

.wizard-stepper .step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.3s;
    white-space: nowrap;
}

.wizard-stepper .step.active {
    color: #fff;
    background: rgba(79, 70, 229, 0.2);
}

.wizard-stepper .step.completed {
    color: #34d399;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    font-size: 0.75rem;
    font-weight: 700;
}

.step.active .step-num {
    background: var(--primary);
    color: #fff;
}

.step.completed .step-num {
    background: #10b981;
    color: #fff;
}

.step-line {
    width: 30px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.wizard-step.hidden {
    display: none;
}

.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 1rem;
}

.wizard-nav .btn-secondary,
.wizard-nav .btn-primary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Template buttons */
.template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.template-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.template-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-color: rgba(255,255,255,0.15);
}

.template-btn.template-active {
    background: rgba(79, 70, 229, 0.15);
    border-color: var(--primary);
    color: #fff;
}

.template-btn i {
    font-size: 1.1rem;
}

/* Tone selector */
.tone-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.tone-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 0.5rem 0.9rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tone-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.tone-btn.active {
    background: rgba(79, 70, 229, 0.2);
    border-color: var(--primary);
    color: #fff;
}

/* Review card */
.review-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.9rem;
}

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

.review-row strong {
    min-width: 140px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Info box */
.info-box {
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* ========== IFRAME MODE (embutido dentro do Chatwoot) ========== */
/* Ativado por auth.js e app.js quando a URL contém ?iframe=true */
body.inovare-iframe-mode .sidebar,
body.inovare-iframe-mode aside.sidebar,
body.inovare-iframe-mode .top-header,
body.inovare-iframe-mode header.top-header,
body.inovare-iframe-mode .topbar,                 /* campanhas.html usa .topbar */
body.inovare-iframe-mode header.topbar,
body.inovare-iframe-mode > header,                /* qualquer header filho direto do body */
body.inovare-iframe-mode > nav.sidebar-nav,
body.inovare-iframe-mode .sidebar-footer,
body.inovare-iframe-mode #sidebar-toggle {
    display: none !important;
}

body.inovare-iframe-mode .main-content,
body.inovare-iframe-mode main.main-content,
body.inovare-iframe-mode main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

body.inovare-iframe-mode .content-area {
    padding-top: 1.5rem !important;
}

body.inovare-iframe-mode {
    background: var(--bg-dark, #0f1115) !important;
    overflow-x: hidden !important;
}

/* Esconde botão de logout/notificações duplicados que vivem fora da sidebar */
body.inovare-iframe-mode .user-profile,
body.inovare-iframe-mode .breadcrumb,
body.inovare-iframe-mode .header-actions,
body.inovare-iframe-mode .header-search {
    display: none !important;
}

/* ========== PALETA INOVARE OFICIAL (override só no iframe-mode) ==========
   Sobrescreve as cores da plataforma antiga pra casar com Chatwoot/Inovare brand.
   Valores vindos de assets/scss/inovare_theme.css (paleta oficial site Inovare).
   Sem !important nas vars (CSS variables não precisam): os componentes que já usam
   var(--primary) etc herdam automaticamente. */
body.inovare-iframe-mode {
    --bg-dark: #0A0A1A;            /* fundo principal (era #0f1115) */
    --bg-card: #1A1730;            /* card background (era rgba 25,28,35,.6 — invisível) */
    --bg-glass: #1E1B3A;           /* glass panel */
    --border-glass: rgba(139, 92, 246, 0.15);

    --primary: #6C3CE1;            /* violet Inovare (era #4f46e5) */
    --primary-hover: #8B5CF6;
    --secondary: #06D6A0;          /* verde-menta (era #10b981) */
    --danger: #EF4444;

    --text-main: #E2E8F0;
    --text-muted: #94A3B8;

    --shadow-glow: 0 0 20px rgba(108, 60, 225, 0.3), 0 0 60px rgba(108, 60, 225, 0.1);
    --shadow-card: 0 8px 32px 0 rgba(10, 10, 26, 0.4);
}

/* Boost de contraste em elementos que usavam rgba super-transparente
   (causavam o "preto demais, cards invisíveis" da screenshot anterior) */
body.inovare-iframe-mode .glass-panel,
body.inovare-iframe-mode .panel,
body.inovare-iframe-mode .card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-glass) !important;
    backdrop-filter: none !important;
}

/* Inputs e botões alinhados à brand */
body.inovare-iframe-mode .input-glass,
body.inovare-iframe-mode input,
body.inovare-iframe-mode textarea,
body.inovare-iframe-mode select {
    background: var(--bg-glass) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-main) !important;
}

body.inovare-iframe-mode .btn-primary,
body.inovare-iframe-mode button.btn-primary {
    background: var(--primary) !important;
    color: white !important;
    border: none !important;
}
body.inovare-iframe-mode .btn-primary:hover {
    background: var(--primary-hover) !important;
}

/* Modal de "Bem-vindo" e outros overlays — fundo legível */
body.inovare-iframe-mode .modal-overlay {
    background: rgba(10, 10, 26, 0.85) !important;
}
body.inovare-iframe-mode .modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-glass) !important;
}

/* Textos de header com contraste forte (estavam herdando cor muito escura) */
body.inovare-iframe-mode .page-header h1,
body.inovare-iframe-mode .content-area h1,
body.inovare-iframe-mode h1,
body.inovare-iframe-mode h2,
body.inovare-iframe-mode h3 {
    color: var(--text-main) !important;
}
body.inovare-iframe-mode .text-muted,
body.inovare-iframe-mode .page-header p {
    color: var(--text-muted) !important;
}

/* Tabelas com contraste */
body.inovare-iframe-mode table,
body.inovare-iframe-mode .instance-table {
    color: var(--text-main) !important;
    background: transparent !important;
}
body.inovare-iframe-mode table th {
    background: var(--bg-glass) !important;
    color: var(--text-main) !important;
    border-bottom: 1px solid var(--border-glass) !important;
}
body.inovare-iframe-mode table td {
    border-bottom: 1px solid var(--border-glass) !important;
}
