/* ==========================================================================
   Orion Pipeline — Design System v3 (dark sólido em camadas)
   Baseado em padrões validados por Linear, Attio, Stripe, Vercel e Pipedrive:
   superfícies sólidas em camadas, bordas 1px, um acento contido, Inter,
   raios consistentes (6/8/10px) e transições de 150ms.
   ========================================================================== */

:root {
    /* Superfícies em camadas: profundidade = luminosidade, nunca blur */
    --bg-main: #0a0b0f;
    --bg-sidebar: #0c0e13;
    --bg-glass: #12141b;
    --bg-card: #161922;
    --bg-elevated: #1b1f29;
    --bg-hover: #1f232e;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.13);
    --border-hover: rgba(255, 255, 255, 0.18);

    --text-primary: #edeff5;
    --text-secondary: #9ba3b5;
    --text-muted: #6b7384;

    --primary: #8b5cf6;
    --primary-hover: #a78bfa;
    --primary-glow: rgba(139, 92, 246, 0.14);
    --accent: #22d3ee;
    --accent-soft: rgba(34, 211, 238, 0.1);
    --accent-glow: rgba(34, 211, 238, 0.12);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --font-heading: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;

    --shadow-premium: 0 16px 40px rgba(0, 0, 0, 0.4);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.3);
    --transition-smooth: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(155, 163, 181, 0.3) transparent;
}

body {
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Painel padrão: superfície sólida + borda 1px (a classe manteve o nome
   "glass-panel" por compatibilidade com o HTML/JS; o vidro foi aposentado) */
.glass-panel {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: none;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(155, 163, 181, 0.25);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(155, 163, 181, 0.45);
    background-clip: padding-box;
}

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

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    z-index: 10;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 4px 8px;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-glow);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(139, 92, 246, 0.32);
}

.brand-info h1 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-info span {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.nav-item {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.nav-item svg {
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.12);
}

.nav-item.active svg {
    color: var(--primary-hover);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.version-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
}

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

/* Header Styling */
.app-header {
    height: 60px;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
}

.search-input-wrapper {
    position: relative;
    width: 300px;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.lead-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lead-toolbar select,
.lead-toolbar input[type="date"] {
    width: auto;
    min-width: 136px;
    height: 34px;
    padding: 6px 10px;
    font-size: 0.78rem;
}

.lead-toolbar .date-filter {
    min-width: 128px;
}

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

#global-search {
    width: 100%;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 14px 8px 36px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.82rem;
    outline: none;
    transition: var(--transition-smooth);
}

#global-search::placeholder {
    color: var(--text-muted);
}

#global-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.pipeline-values {
    display: flex;
    gap: 16px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.metric-item.border-left {
    border-left: 1px solid var(--border-color);
    padding-left: 16px;
}

.metric-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-val {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* Content Body */
.content-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.content-section {
    display: none;
    width: 100%;
    height: 100%;
    padding: 20px 24px;
    overflow-y: auto;
}

.content-section.active-section {
    display: block;
}

.commercial-command-strip {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.command-card {
    padding: 16px 18px;
    border-color: var(--border-color);
}

.command-card span,
.offer-stack span {
    display: block;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.command-card strong,
.offer-stack strong {
    display: block;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

.command-card p,
.offer-stack div span {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.5;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* Buttons Styles */
.btn {
    border: 1px solid transparent;
    outline: none;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.82rem;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
    box-shadow: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

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

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

.btn-secondary:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
}

.btn-accent {
    background: var(--accent);
    color: #06121a;
    font-weight: 600;
}

.btn-accent:hover {
    background: #4adff5;
}

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

.btn-small {
    padding: 5px 10px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-large {
    padding: 12px 24px;
    font-size: 0.92rem;
    border-radius: var(--radius-md);
    width: 100%;
}

/* ==========================================================================
   Kanban CRM Board Styling
   ========================================================================== */
.kanban-wrapper {
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
}

.kanban-board {
    display: flex;
    gap: 12px;
    height: 100%;
    min-width: max-content;
}

.kanban-column {
    width: 300px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
}

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

.kanban-column-header h3 {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.kanban-column-badge {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.kanban-cards-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100px;
}

.kanban-cards-container.drag-over {
    background: var(--primary-glow);
    border: 1px dashed rgba(139, 92, 246, 0.5);
    border-radius: var(--radius-md);
}

/* Kanban Cards */
.lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: grab;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.lead-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-elevated);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.card-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    line-height: 1.3;
}

.card-score-badge {
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.card-proof-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.source-chip,
.proof-chip {
    width: fit-content;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.source-chip {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
}

.proof-chip {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.score-quente {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.score-bom {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.28);
}

.score-testar {
    background: rgba(34, 211, 238, 0.1);
    color: #67e8f9;
    border: 1px solid rgba(34, 211, 238, 0.25);
}

.score-baixa {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.card-meta {
    font-size: 0.74rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.meta-niche {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

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

.card-rating-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--warning);
}

.card-rating-row span.reviews {
    color: var(--text-muted);
}

.card-budget-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.card-budget-label {
    font-size: 0.66rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-budget-val {
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.card-qualification {
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-commercial-row {
    display: grid;
    gap: 4px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.025);
}

.card-commercial-row span {
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-commercial-row strong {
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.4;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 2px;
}

.card-icon-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.card-icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.card-icon-btn.copied {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

/* ==========================================================================
   Lead Radar View Styling
   ========================================================================== */
.radar-container {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 16px;
    height: 100%;
}

.radar-controls {
    padding: 24px;
    overflow-y: auto;
}

.radar-controls h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.offer-stack {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.offer-stack div {
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
}

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

.form-group label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.proof-note {
    min-height: 41px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-secondary);
    background: rgba(16, 185, 129, 0.06);
    font-size: 0.8rem;
    line-height: 1.4;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

select, input[type="text"], input[type="number"], input[type="url"], input[type="date"], textarea {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    width: 100%;
    transition: var(--transition-smooth);
}

select:focus, input:focus, textarea:focus {
    border-color: var(--primary);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Checkbox Styles */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.84rem;
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Radio Group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.radio-container {
    display: flex;
    align-items: flex-start;
    position: relative;
    padding-left: 32px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
    user-select: none;
}

.radio-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radiomark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.radio-container:hover input ~ .radiomark {
    border-color: var(--primary);
}

.radio-container input:checked ~ .radiomark {
    background-color: transparent;
    border-color: var(--primary);
}

.radiomark:after {
    content: "";
    position: absolute;
    display: none;
}

.radio-container input:checked ~ .radiomark:after {
    display: block;
}

.radio-container .radiomark:after {
    top: 5px;
    left: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.radio-label-wrapper {
    display: flex;
    flex-direction: column;
}

.radio-label-wrapper strong {
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.radio-label-wrapper span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Monitor Window */
.radar-monitor {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

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

.monitor-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.monitor-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pulse-indicator.active {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    animation: pulse-green 1.5s infinite;
}

.pulse-indicator.inactive {
    background: var(--text-muted);
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.25);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.monitor-stats-bar {
    display: flex;
    gap: 18px;
    margin-bottom: 14px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.m-metric strong {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.m-metric.border-left {
    border-left: 1px solid var(--border-color);
    padding-left: 18px;
}

.monitor-terminal {
    background: #07080c;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-family: 'Consolas', 'SF Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    overflow-y: auto;
    flex: 1;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.terminal-line {
    border-left: 2px solid var(--text-muted);
    padding-left: 8px;
}

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

.info-line {
    color: #93c5fd;
    border-color: #3b82f6;
}

.success-line {
    color: #6ee7b7;
    border-color: #10b981;
}

.warning-line {
    color: #fcd34d;
    border-color: #f59e0b;
}

.error-line {
    color: #fca5a5;
    border-color: #ef4444;
}

.monitor-screenshot-area {
    height: 240px;
    background: #07080c;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.screenshot-placeholder {
    font-size: 0.8rem;
    color: var(--text-muted);
}

#live-screenshot {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   Statistics Panel Styling
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.metric-card {
    padding: 18px 20px;
    text-align: left;
}

.metric-card h3 {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.big-metric {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.success-text {
    color: var(--success) !important;
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.chart-box {
    padding: 20px 22px;
}

.chart-box h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 18px;
}

.custom-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bar-label-group {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

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

.bar-val {
    color: var(--text-primary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Modals & Popups Styling
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 5, 8, 0.7);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-premium);
}

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

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.close-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.commercial-section {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.16);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 20px 0;
}

.commercial-section h3 {
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary-hover);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hidden {
    display: none !important;
}


/* Demo comercial: ajustes leves sem redesenhar a estrutura */
.command-card-primary {
    background: var(--bg-card);
    border-color: rgba(139, 92, 246, 0.22);
}

.demo-insights-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.demo-insight {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
}

.demo-insight span {
    display: block;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.demo-insight strong {
    display: block;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.kanban-empty-state {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
    padding: 14px;
    text-align: center;
}

#btn-demo-mode.active {
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.12);
}

body.demo-mode .radar-monitor,
body.demo-mode .version-label {
    opacity: 0.72;
}

body.demo-mode .terminal-line {
    font-size: 0.76rem;
}

body.demo-mode .command-card p,
body.demo-mode .card-commercial-row strong {
    color: var(--text-secondary);
}

@media (max-width: 1180px) {
    .commercial-command-strip,
    .demo-insights-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .app-container {
        flex-direction: column;
        height: 100dvh;
    }

    .sidebar {
        width: 100%;
        flex: 0 0 auto;
        padding: 8px 10px;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .brand-container,
    .sidebar-footer,
    .nav-divider {
        display: none;
    }

    .nav-menu {
        flex-direction: row;
        gap: 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        flex: 0 0 auto;
        gap: 6px;
        padding: 8px 10px;
        font-size: 0.72rem;
        white-space: nowrap;
    }

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

    .main-content {
        min-width: 0;
        min-height: 0;
    }

    .app-header {
        height: 52px;
        padding: 7px 10px;
        gap: 8px;
    }

    .header-search,
    .search-input-wrapper {
        width: 100%;
    }

    .lead-toolbar,
    .pipeline-values,
    .demo-control,
    #btn-add-manual {
        display: none;
    }

    .header-actions {
        gap: 4px;
    }

    .autopilot-btn {
        min-width: 40px;
        padding-inline: 10px;
    }

    .autopilot-label {
        display: none;
    }

    .content-section {
        padding: 14px 10px;
    }
}


.demo-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.demo-mode-hint {
    color: var(--text-muted);
    font-size: 0.66rem;
    line-height: 1;
    white-space: nowrap;
}

/* ==========================================================================
   Fila do dia (rotina de prospecção) — painel "Quem chamar hoje"
   ========================================================================== */
.today-panel {
    margin: 0 0 16px 0;
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--success);
}
.today-panel.hidden { display: none; }
.today-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
.today-eyebrow {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.today-header h3 { margin: 2px 0 0 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.today-goal { text-align: right; min-width: 180px; }
.today-goal span { font-size: 12px; color: var(--text-secondary); }
.today-goal-bar {
    margin-top: 6px;
    height: 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}
.today-goal-bar div {
    height: 100%;
    border-radius: 99px;
    background: var(--success);
    transition: width 0.4s ease;
}
.today-group-label {
    margin: 14px 0 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.today-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    transition: var(--transition-smooth);
}
.today-row:hover { border-color: var(--border-hover); background: var(--bg-elevated); }
.today-row-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.today-row-info strong { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-row-info span { font-size: 12px; color: var(--text-secondary); }
.today-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 99px;
    white-space: nowrap;
}
.badge-overdue { background: rgba(239, 68, 68, 0.12); color: #f87171; }
.badge-due { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.badge-new { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.today-step { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.btn-today-wa { padding: 7px 14px; font-size: 12.5px; white-space: nowrap; }
.btn-today-wa:disabled { opacity: 0.4; cursor: not-allowed; }
.today-empty { color: var(--text-secondary); font-size: 13px; margin: 6px 0 0; }

/* Aviso acima do Kanban: primeiro uso, busca sem resultado ou erro de conexão */
.kanban-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px 22px;
    margin-bottom: 14px;
    border-radius: var(--radius-lg);
}
.kanban-notice-info h3 {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
}
.kanban-notice-info p {
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
    margin: 0;
    max-width: 560px;
}
.kanban-notice .btn { flex-shrink: 0; }

/* Variantes do toast (base em pipeline.css #pipeline-toast) */
#pipeline-toast.toast-success { border-color: rgba(16, 185, 129, 0.5); }
#pipeline-toast.toast-error { border-color: rgba(239, 68, 68, 0.55); }

/* Visão do vendedor (padrão): ferramentas internas da Orion ficam ocultas.
   Modo operador (Ctrl+Shift+O ou ?modo=operador) mostra tudo. */
body:not(.operator-mode) .operator-only { display: none !important; }
