/* Design System Core & CSS Variables */
:root {
    --bg-primary: #0A0F1D;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-input: #1F2937;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    
    /* Accents */
    --color-blue: #3B82F6;
    --color-green: #10B981;
    --color-orange: #F59E0B;
    --color-red: #EF4444;
    --color-whatsapp: #25D366;
    
    /* Competitor Analytics Dashboard Theme (Dark Navy, Solid White, Brushed Gold) */
    --gold-bg: #0B132B;
    --gold-card: #1C2541;
    --gold-primary: #D4AF37;
    --gold-secondary: #C5A059;
    --gold-white: #FFFFFF;
    --gold-border: rgba(212, 175, 55, 0.25);
    
    /* UI Sizing */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius: 12px;
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadow / Glow */
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --gold-glow: 0 0 15px rgba(212, 175, 55, 0.25);
    --blue-glow: 0 0 15px rgba(59, 130, 246, 0.25);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

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

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

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    font-size: 24px;
    color: var(--color-blue);
    text-shadow: var(--blue-glow);
}

.brand-text h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-text span {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-menu {
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    position: relative;
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

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

.nav-item.active {
    color: var(--text-primary);
    background-color: rgba(59, 130, 246, 0.12);
    box-shadow: inset 4px 0 0 var(--color-blue);
}

.nav-item.active i {
    color: var(--color-blue);
}

.badge {
    display: inline-block;
    background-color: var(--color-whatsapp);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

#whatsapp-unread-badge {
    position: absolute;
    right: 16px;
}

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

.system-node {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.pulse-green {
    width: 8px;
    height: 8px;
    background-color: var(--color-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    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); }
}

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

/* Global Header */
.app-header {
    height: var(--header-height);
    padding: 0 30px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left h1 {
    font-size: 22px;
    font-weight: 700;
}

.header-left p {
    font-size: 12px;
    color: var(--text-secondary);
}

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

.scenario-launcher {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-primary);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.scenario-launcher label {
    font-size: 12px;
    color: var(--text-secondary);
}

.scenario-launcher select {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    padding-right: 8px;
}

.scenario-launcher select option {
    background-color: var(--bg-secondary);
}

.clock-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.clock-display span {
    font-family: monospace;
}

/* Content Viewport & Tab Panels */
.content-viewport {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background-color: var(--bg-primary);
}

.tab-panel {
    display: none;
    height: 100%;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Buttons Styling */
.btn {
    padding: 8px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background-color: #2563EB;
}

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

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--color-red);
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
}

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

/* --- OVERVIEW VIEWPORTS --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--glass-shadow);
}

.metric-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.bg-blue { background-color: rgba(59, 130, 246, 0.15); color: var(--color-blue); }
.bg-green { background-color: rgba(16, 185, 129, 0.15); color: var(--color-green); }
.bg-orange { background-color: rgba(245, 158, 11, 0.15); color: var(--color-orange); }
.bg-gold { background-color: rgba(212, 175, 55, 0.15); color: var(--gold-primary); }

.overview-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title h3 {
    font-size: 16px;
    font-weight: 700;
}

/* Agent cards grid */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.agent-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition-normal);
}

.agent-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.agent-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.agent-name-role {
    display: flex;
    flex-direction: column;
}

.agent-name-role h4 {
    font-size: 14px;
    font-weight: 700;
}

.agent-name-role span {
    font-size: 11px;
    color: var(--text-secondary);
}

.agent-status-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.status-idle { background-color: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }
.status-running { background-color: rgba(59, 130, 246, 0.15); color: var(--color-blue); animation: flash 1.5s infinite; }
.status-waiting { background-color: rgba(245, 158, 11, 0.15); color: var(--color-orange); }
.status-done { background-color: rgba(16, 185, 129, 0.15); color: var(--color-green); }

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.agent-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

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

.agent-log-summary {
    font-size: 11px;
    color: var(--text-secondary);
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Console Logs output styling */
.console-container {
    display: flex;
    flex-direction: column;
}

.console-output {
    flex: 1;
    background-color: #060913;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    font-family: monospace;
    font-size: 12px;
    overflow-y: auto;
    height: 480px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.log-line {
    line-height: 1.4;
    word-break: break-all;
}

.log-line.system { color: var(--text-secondary); }
.log-line.agent { color: #818CF8; }
.log-line.whatsapp { color: var(--color-whatsapp); }
.log-line.warning { color: var(--color-orange); }
.log-line.error { color: var(--color-red); }
.log-line.success { color: var(--color-green); }


/* --- WHATSAPP SIMULATOR LAYOUT --- */
.whatsapp-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    height: 580px;
}

.chat-window {
    background-color: #0d141e;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.chat-header {
    background-color: #1f2c34;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--color-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.chat-user-info h4 {
    font-size: 14px;
    font-weight: 700;
}

.chat-user-info p {
    font-size: 11px;
}

.status-online { color: var(--color-whatsapp); }

.chat-actions {
    margin-left: auto;
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    cursor: pointer;
}

.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-image: radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 0);
    background-size: 24px 24px;
}

.msg-time {
    align-self: center;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: 4px;
    text-transform: uppercase;
}

.message {
    display: flex;
    max-width: 75%;
}

.message.incoming {
    align-self: flex-start;
}

.message.outgoing {
    align-self: flex-end;
}

.msg-content {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
}

.incoming .msg-content {
    background-color: #1f2c34;
    color: var(--text-primary);
    border-top-left-radius: 0;
}

.outgoing .msg-content {
    background-color: #005c4b;
    color: #E9EDEF;
    border-top-right-radius: 0;
}

.msg-timestamp {
    display: block;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    text-align: right;
    margin-top: 4px;
}

.chat-approval-bar {
    background-color: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.chat-footer {
    background-color: #1f2c34;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
}

.chat-input-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-file-btn {
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.chat-file-btn:hover {
    color: var(--text-primary);
}

.chat-input-controls input[type="text"] {
    flex: 1;
    background-color: #2a3942;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
}

.chat-send-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--color-blue);
    cursor: pointer;
}

.chat-send-btn:hover {
    color: #2563EB;
}

.whatsapp-info-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    height: 100%;
}

.info-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
}

.info-card h3 {
    font-size: 14px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.file-uploader-box {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.file-uploader-box:hover {
    border-color: var(--color-blue);
}

.upload-icon {
    font-size: 28px;
    color: var(--text-secondary);
}

.upload-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
}

.file-uploaded-msg {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-green);
}

.query-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.query-list li {
    font-size: 12px;
}

.query-list code {
    background-color: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--color-blue);
    font-family: monospace;
}

.spec-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 11px;
    color: var(--text-secondary);
}

.form-group input, .form-group select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    outline: none;
}


/* --- CRM PORTAL VIEWPORT --- */
.crm-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

.crm-tabs {
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    display: flex;
}

.crm-tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 16px 20px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.crm-tab-btn:hover {
    color: var(--text-primary);
}

.crm-tab-btn.active {
    color: var(--color-blue);
    border-bottom: 2px solid var(--color-blue);
}

.crm-body {
    padding: 24px;
}

.crm-subpanel {
    display: none;
}

.crm-subpanel.active {
    display: block;
}

/* CRM Table styling */
.table-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.table-search input {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    width: 240px;
    outline: none;
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.crm-table th {
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
}

.crm-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.crm-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Kanban Board Deals */
.deals-kanban {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.kanban-column {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.column-header {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-count {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.deal-card {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: grab;
    transition: var(--transition-fast);
}

.deal-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.deal-card h5 {
    font-size: 13px;
    font-weight: 700;
}

.deal-client {
    font-size: 11px;
    color: var(--text-secondary);
}

.deal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

.deal-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-primary);
}

.deal-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

/* Catalog Grid cards */
.catalog-header {
    margin-bottom: 20px;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.catalog-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.catalog-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #060913;
}

.catalog-card h4 {
    font-size: 15px;
    font-weight: 700;
}

.catalog-specs {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.catalog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    font-size: 13px;
}

/* Ledger financial panel */
.ledger-header {
    margin-bottom: 24px;
}

.ledger-financials {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    gap: 20px;
}

.financial-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.financial-block span {
    font-size: 12px;
    color: var(--text-secondary);
}

.financial-block h3 {
    font-size: 18px;
    font-weight: 700;
}

.text-green { color: var(--color-green); }
.text-danger { color: var(--color-red); }
.text-warning { color: var(--color-orange); }


/* --- TECHNICAL DATASHEET MODAL VIEWPORT --- */
.datasheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.datasheet-container {
    background-color: white;
    color: #1f2c3f;
    width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    position: relative;
    padding: 30px;
}

.datasheet-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #1f2c3f;
    cursor: pointer;
}

.datasheet-close-btn:hover {
    color: var(--color-red);
}

/* Printable Datasheet structure to avoid AI watermark feel */
.ds-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid #1E3A8A;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.ds-header-left h1 {
    font-size: 24px;
    color: #1E3A8A;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 4px;
}

.ds-header-left span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6B7280;
}

.ds-header-right img {
    height: 40px;
}

.ds-logo-text {
    font-size: 26px;
    font-weight: 800;
    color: #1E3A8A;
    font-family: 'Outfit', sans-serif;
}

.ds-logo-text span {
    font-size: 11px;
    font-weight: 500;
    display: block;
    color: #6B7280;
}

.ds-body-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

.ds-section-title {
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 700;
    color: #1E3A8A;
    border-bottom: 1px solid #E5E7EB;
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.ds-description {
    font-size: 12px;
    line-height: 1.5;
    color: #374151;
    margin-bottom: 20px;
}

.ds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 20px;
}

.ds-table th {
    background-color: #F3F4F6;
    color: #374151;
    padding: 6px 10px;
    font-weight: 700;
    text-align: left;
}

.ds-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #E5E7EB;
}

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

.ds-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ds-image-container img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #E5E7EB;
    background-color: #F9FAFB;
}

.ds-stamp-row {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 16px;
}

.ds-stamp {
    border: 1.5px solid #10B981;
    color: #10B981;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    transform: rotate(-3deg);
    letter-spacing: 0.5px;
}

.ds-stamp.rohs {
    border-color: #2563EB;
    color: #2563EB;
}

.ds-footer {
    margin-top: 30px;
    border-top: 1px solid #E5E7EB;
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: #6B7280;
}


/* --- COMPETITOR ANALYTICS SECTION (DARK NAVY / BRUSHED GOLD) --- */
.analytics-layout-darkgold {
    background-color: var(--gold-bg);
    border: 1px solid var(--gold-border);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: var(--gold-glow);
}

.analytics-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gold-border);
    padding-bottom: 16px;
}

.analytics-dropdown {
    background-color: var(--gold-card);
    border: 1px solid var(--gold-primary);
    color: var(--gold-white);
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.analytics-dropdown option {
    background-color: var(--gold-bg);
}

.badge-gold {
    background-color: rgba(212, 175, 55, 0.15);
    color: var(--gold-primary);
    border: 1px solid var(--gold-primary);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.status-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 10px;
}

.analytics-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.analytics-card {
    background-color: var(--gold-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--border-radius);
    padding: 20px;
}

.analytics-card.full-width {
    grid-column: span 2;
}

.analytics-card h3 {
    font-size: 14px;
    color: var(--gold-white);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analytics-card h3 i {
    color: var(--gold-primary);
}

.chart-container {
    height: 240px;
    position: relative;
    width: 100%;
}

.chart-container-large {
    height: 300px;
    position: relative;
    width: 100%;
}

.analytics-insights-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.insight-block {
    background-color: var(--gold-card);
    border: 1px solid var(--gold-border);
    border-radius: var(--border-radius);
    padding: 20px;
}

.insight-block h4 {
    font-size: 14px;
    color: var(--gold-white);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-block h4 i {
    color: var(--gold-primary);
}

.insight-block p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.insight-block.highlight-gold {
    border-color: var(--gold-primary);
    box-shadow: var(--gold-glow);
}

.margin-matrix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.matrix-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.matrix-cell span {
    font-size: 10px;
    color: var(--text-secondary);
}

.matrix-cell strong {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    color: var(--gold-primary);
}


/* --- MEMORY & SETTINGS VIEWPORTS --- */
.memory-logs-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

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

.badge-blue {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--color-blue);
    border: 1px solid var(--color-blue);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

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

.settings-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
}

.settings-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 16px;
}

.range-input-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.range-input-container input[type="range"] {
    flex: 1;
    background-color: var(--bg-input);
    height: 6px;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.range-val {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-blue);
    min-width: 60px;
}

.input-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.input-disabled {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
    cursor: not-allowed;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.checkbox-container input {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Leads Worksheet Tabs & Scraper Modal */
.leads-worksheet-tabs .btn-outline {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.06);
    color: var(--text-secondary);
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
}

.leads-worksheet-tabs .btn-outline.active {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: var(--color-blue) !important;
    color: var(--text-primary) !important;
}

#scraper-terminal::-webkit-scrollbar {
    width: 6px;
}
#scraper-terminal::-webkit-scrollbar-track {
    background: #000;
}
#scraper-terminal::-webkit-scrollbar-thumb {
    background: #1f2937;
    border-radius: 3px;
}

/* --- REDESIGNED ORCHESTRATOR AGENT PANEL --- */
.orchestrator-panel {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(7, 10, 19, 0.98));
    border: 1px solid rgba(245, 158, 11, 0.35); /* Glowing Gold Border */
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 16px rgba(245, 158, 11, 0.05);
    display: flex;
    gap: 24px;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.orchestrator-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #3b82f6, #10b981);
}

.orchestrator-panel:hover {
    border-color: rgba(245, 158, 11, 0.6);
}

.orchestrator-avatar-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, rgba(0,0,0,0) 70%);
}

.orchestrator-avatar-glow {
    position: absolute;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 2px dashed rgba(245, 158, 11, 0.5);
    animation: rotateDashed 20s linear infinite;
}

@keyframes rotateDashed {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.orchestrator-avatar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
    font-size: 24px;
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
        background: rgba(245, 158, 11, 0.1);
    }
    50% {
        box-shadow: 0 0 25px rgba(245, 158, 11, 0.5);
        background: rgba(245, 158, 11, 0.25);
    }
}

.orchestrator-details {
    flex: 1;
}

.orchestrator-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.orchestrator-title-bar h3 {
    font-size: 16px;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.orchestrator-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.orchestrator-role-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.orchestrator-live-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
}

.orchestrator-stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.orchestrator-stat-label {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.orchestrator-stat-value {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.orchestrator-stat-value.status-idle { color: #3b82f6; }
.orchestrator-stat-value.status-busy { color: #f59e0b; animation: textPulse 1.5s infinite; }
.orchestrator-stat-value.status-alert { color: #ef4444; }

@keyframes textPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; color: #ffedd5; }
}

.orchestrator-conn-list {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.orchestrator-conn-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
}

.orchestrator-conn-dot.active {
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
}

@media (max-width: 768px) {
    .orchestrator-panel {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    .orchestrator-title-bar {
        flex-direction: column;
        gap: 8px;
    }
    .orchestrator-live-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Voice Note Card & UI Elements */
.voice-note-card {
    background: #0b141a;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 10px 14px;
    margin-top: 6px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.voice-note-audio-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.voice-note-play-btn {
    background: #10b981;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.voice-note-play-btn:hover {
    background: #059669;
}

.voice-note-waves {
    flex: 1;
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.voice-note-wave-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(16, 185, 129, 0.2);
    transition: width 0.1s linear;
}

.voice-note-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.voice-note-transcript-btn {
    background: none;
    border: none;
    color: #10b981;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.voice-note-transcript-btn:hover {
    background: rgba(16, 185, 129, 0.1);
}

.voice-note-transcript-panel {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    color: #e5e7eb;
    border-left: 2px solid #10b981;
    margin-top: 5px;
    line-height: 1.4;
    word-break: break-word;
}

.voice-note-transcript-panel.hidden {
    display: none !important;
}

/* Pulsing Red Icon for Voice Recording */
.chat-voice-note-btn.recording {
    background: #ef4444 !important;
    color: white !important;
    animation: mic-pulse-anim 1.5s infinite ease-in-out;
}

@keyframes mic-pulse-anim {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Camera Scanner filter overrides */
.document-scan-filter {
    filter: contrast(2.5) grayscale(1) brightness(1.2);
}

/* Responsive Live Call Side panel & Mobile bottom sheet */
.live-call-panel {
    z-index: 1500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

@media (min-width: 769px) {
    .live-call-panel {
        position: fixed;
        top: 90px;
        right: 24px;
        width: 300px;
        height: calc(100vh - 150px);
        background: rgba(15, 23, 42, 0.9);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(12px);
        padding: 24px 20px;
    }
}

@media (max-width: 768px) {
    .live-call-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        height: 340px;
        background: rgba(15, 23, 42, 0.95);
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -10px 45px rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(16px);
        padding: 20px;
    }
}

/* Agent Takeover Styling */
@keyframes glow-warning {
    0%, 100% { border-color: rgba(217, 119, 6, 0.4); box-shadow: 0 0 10px rgba(217, 119, 6, 0.2); }
    50% { border-color: rgba(217, 119, 6, 0.8); box-shadow: 0 0 25px rgba(217, 119, 6, 0.5); }
}

.takeover-active-border {
    animation: glow-warning 2s infinite ease-in-out;
}

/* Virtual Cursor */
.agent-virtual-cursor {
    pointer-events: none;
    box-shadow: 0 0 15px #d97706, inset 0 0 10px rgba(255, 255, 255, 0.6);
}

/* Chat Typewriter Animation Cursor */
.typing-caret::after {
    content: '▍';
    display: inline-block;
    color: #3b82f6;
    margin-left: 3px;
    font-size: 14px;
    vertical-align: middle;
    animation: blink-caret 0.8s step-end infinite;
}

@keyframes blink-caret {
    from, to { opacity: 0; }
    50% { opacity: 1; }
}

/* Golden Focus Ripples during Takeover */
.takeover-ripple-target {
    position: relative;
    border-color: var(--gold-primary) !important;
    box-shadow: 0 0 20px var(--gold-primary) !important;
    transform: scale(1.03) !important;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    z-index: 100 !important;
}

/* ==========================================
   Minimized Scraper Floating Widget
   ========================================== */
.scraper-minimized-widget {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1200;
    background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 12px;
    padding: 10px 16px;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 15px rgba(59, 130, 246, 0.15);
    cursor: pointer;
    animation: scraperWidgetSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
    font-family: 'Outfit', sans-serif;
}

.scraper-minimized-widget:hover {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 25px rgba(59, 130, 246, 0.25);
    transform: translateY(-2px);
}

@keyframes scraperWidgetSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.scraper-minimized-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #9ca3af;
    flex-shrink: 0;
    transition: background 0.3s;
}

.scraper-minimized-dot.running {
    background: #10B981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
    animation: pulse 1.5s infinite;
}

.scraper-minimized-dot.done {
    background: #3b82f6;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}

.scraper-minimized-label {
    font-size: 12px;
    font-weight: 600;
    color: #e5e7eb;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scraper-minimized-label i {
    font-size: 11px;
    color: #3b82f6;
}

.scraper-minimized-status {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 10px;
}

.scraper-minimized-restore {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: #60a5fa;
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.scraper-minimized-restore:hover {
    background: rgba(59, 130, 246, 0.3);
    color: #93bbfd;
    border-color: rgba(59, 130, 246, 0.5);
}
