/* ==========================================================================
   COINMANCER: by Marc — DESIGN SYSTEM & LUXURY DARK THEME
   ========================================================================== */

:root {
    --bg-dark: #090c14;
    --bg-surface: rgba(18, 24, 40, 0.7);
    --bg-surface-hover: rgba(28, 36, 58, 0.8);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(99, 102, 241, 0.3);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-sub: #64748b;
    
    --primary: #6366f1;       /* Indigo Vibrant */
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent: #a855f7;        /* Purple Neon */
    --success: #10b981;       /* Emerald */
    --danger: #ef4444;        /* Crimson */
    --warning: #f59e0b;       /* Amber */
    --gold: #fbbf24;          /* Luxury Gold */
    --cyan: #06b6d4;          /* Cyber Cyan */

    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* BACKGROUND AMBIENT ORBS */
.app-background {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 0%, #13192f 0%, var(--bg-dark) 70%);
    z-index: -2;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.18;
    z-index: -1;
    pointer-events: none;
}
.orb-1 {
    width: 600px; height: 600px;
    background: var(--primary);
    top: -100px; left: -100px;
}
.orb-2 {
    width: 500px; height: 500px;
    background: var(--accent);
    bottom: -150px; right: -100px;
}

/* CONTAINER */
.dashboard-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 32px;
}

/* GLASSMORPHISM SHARED CLASS */
.glass {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.glass:hover {
    border-color: var(--border-accent);
}

/* HEADER / NAVIGATION */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 28px;
    margin-bottom: 16px;
    background: rgba(15, 20, 34, 0.85);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.brand-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.logo-icon {
    font-size: 32px;
    background: linear-gradient(135deg, var(--gold), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px var(--gold));
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 24px;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: -4px;
}

.author-badge {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.mode-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
    padding: 6px 14px;
    border-radius: 9999px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

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

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
    100% { transform: scale(0.95); opacity: 1; }
}

/* AGENT TOOLBAR SEPARADO DEL HEADER */
.agent-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 28px;
    margin-bottom: 24px;
    border-radius: 18px;
    background: rgba(20, 28, 48, 0.75);
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.agent-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.agent-name-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}
.agent-name-input-row input {
    flex: 1;
}
.agent-name-input-row button {
    flex-shrink: 0;
    white-space: nowrap;
}

/* BUTTONS */
.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-xs {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
}
.btn-xs:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* STATUS BANNER */
.status-banner {
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--border-accent);
    color: #fff;
}
.hidden { display: none !important; }

/* KPI CARDS GRID */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 10px;
}

.kpi-icon {
    font-size: 20px;
    opacity: 0.8;
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.kpi-subtext {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-sub);
}

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}
.badge-info {
    background: rgba(6, 182, 212, 0.15);
    color: var(--cyan);
}
.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}
.badge-legal {
    background: rgba(251, 191, 36, 0.15);
    color: var(--gold);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* CHARTS SECTION */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

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

.chart-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.header-title h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

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

.canvas-wrapper {
    position: relative;
    height: 280px;
    width: 100%;
}

.canvas-wrapper-donut {
    position: relative;
    height: 200px;
    width: 100%;
    margin-bottom: 16px;
}

.chart-legend-custom {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.cyan { background: var(--cyan); }
.dot.purple { background: var(--accent); }

/* DONUT SUMMARY */
.donut-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border-glass);
    padding-top: 16px;
}

.donut-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}
.donut-item strong { color: var(--text-main); }

/* TABLES GRID */
.tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

.table-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.table-responsive {
    overflow-x: auto;
}

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

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-glass);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 14px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

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

.tag-buy {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
}

.tag-sell {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
}

/* PROGRESS BARS FOR ASSETS */
.alloc-bar-wrap {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
}
.alloc-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--cyan));
    border-radius: 4px;
}

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 7, 12, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #0f1422;
    border: 1px solid var(--border-accent);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    overflow: hidden;
}

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

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}
.modal-icon { font-size: 28px; }
.modal-title-group h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}
.modal-title-group p {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.btn-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.tax-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.tax-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tax-stat-card span {
    font-size: 12px;
    color: var(--text-muted);
}
.tax-stat-card strong {
    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--text-main);
}
.highlight-green { color: var(--success) !important; }

.tax-info-banner {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 12px;
    font-size: 12px;
    color: #fef3c7;
    margin-bottom: 24px;
    align-items: center;
}

.modal-subtitle {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-table-wrap {
    max-height: 240px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   TABS NAVIGATION SYSTEM (by Marc)
   ========================================================================== */
.tabs-nav {
    display: flex;
    gap: 12px;
    padding: 10px 16px;
    margin-bottom: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-glass);
    background: rgba(18, 24, 40, 0.65);
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.tab-pane {
    animation: fadeInTab 0.35s ease-in-out;
}

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

.tab-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    margin-bottom: 24px;
    border-radius: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

/* ==========================================================================
   TRIDENTE PATRIMONIAL (SCROLL / SLIDER SYSTEM)
   ========================================================================== */
.trident-editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.trident-slider-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-radius: 20px;
    border: 1px solid var(--border-glass);
    position: relative;
    overflow: hidden;
}

.trident-slider-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0.8;
}

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

.slider-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-icon {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 12px;
}

.slider-title h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.slider-title p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.slider-val-badge {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--cyan);
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 6px 14px;
    border-radius: 12px;
}

.slider-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slider-control input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    transition: background 0.3s;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid #fff;
    box-shadow: 0 0 12px var(--primary-glow);
    cursor: grab;
    transition: transform 0.2s;
}

.slider-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider-range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-sub);
    font-weight: 500;
}

.trident-summary-box {
    padding: 24px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid var(--border-glass);
}

.summary-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 16px;
}

.summary-info strong {
    font-size: 20px;
    color: var(--text-main);
}

.reserva-badge {
    font-size: 13px;
    color: var(--success);
    font-weight: 600;
}

.progress-bar-wrap {
    height: 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    width: 100%;
}

.progress-bar-fill {
    height: 100%;
    transition: width 0.4s ease;
}

/* ==========================================================================
   MULTI-AGENT CONTROL BAR & QUANTITATIVE PARAMETERS (COINMANCER: BY MARC)
   ========================================================================== */

.agent-control-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 18px;
    border-radius: 50px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.agent-control-bar:hover {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
}

.agent-selector-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-icon {
    font-size: 18px;
    animation: pulseIcon 2s infinite;
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.agent-selector-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agent-dropdown {
    background: rgba(30, 41, 59, 0.85);
    color: var(--text-main);
    border: 1px solid rgba(99, 102, 241, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.agent-dropdown:hover, .agent-dropdown:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.btn-reset-agent {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.4));
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-reset-agent:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4), rgba(220, 38, 38, 0.7));
    color: #ffffff;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.mt-4 {
    margin-top: 28px !important;
}

.toggle-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.badge-leverage {
    background: linear-gradient(135deg, #e11d48, #f43f5e);
    color: #fff;
}

.badge-sl {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.badge-tp {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.badge-mode {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.glass-input {
    width: 100%;
    background: rgba(30, 41, 59, 0.85);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.glass-input:focus {
    border-color: var(--accent);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVENESS (PATCH V5)
   ========================================================================== */
@media (max-width: 768px) {
    .dashboard-container { padding: 12px 14px; }
    .top-nav { flex-direction: column; align-items: stretch; padding: 16px; gap: 16px; }
    .brand-section { justify-content: center; text-align: center; }
    .header-actions { flex-direction: column; width: 100%; }
    .header-actions .btn { width: 100%; justify-content: center; }
    .agent-toolbar { flex-direction: column; align-items: stretch; padding: 16px; }
    .agent-toolbar-actions { width: 100%; justify-content: stretch; }
    .agent-toolbar-actions .btn { width: 100%; }
    .tabs-nav { flex-direction: column; padding: 8px; }
    .tab-btn { width: 100%; justify-content: center; padding: 12px; }
    .kpi-grid, .charts-grid, .tables-grid, .trident-editor-grid { grid-template-columns: 1fr; }
    .kpi-card { padding: 16px; }
    .kpi-value { font-size: 24px; }
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 10px; border-radius: 8px; }
    .data-table th, .data-table td { white-space: nowrap; padding: 10px 8px; font-size: 12px; }
    .modal-card { width: 95%; margin: auto; max-height: 85vh; }
    .tax-metrics-grid { grid-template-columns: 1fr; }
    .canvas-wrapper { height: 220px; }
    .slider-title { flex-direction: column; align-items: flex-start; }
}

.brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}
.brand-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
}
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* NEW CENTERED HEADER STYLES (Desktop) */
.top-nav-centered {
    flex-direction: column;
    gap: 15px;
    padding: 25px;
}
.brand-centered {
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.text-centered {
    align-items: center;
    text-align: center;
}
.actions-centered {
    width: 100%;
    justify-content: center;
}
.brand-logo {
    width: 150px;
    height: 150px;
    border-radius: 0;
    border: none;
    box-shadow: none;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
}

/* MOBILE OPTIMIZATIONS PATCH */
@media (max-width: 768px) {
    .top-nav-centered {
        padding: 16px;
    }
    .brand-logo {
        width: 100px;
        height: 100px;
    }
    .btn {
        white-space: normal; /* Allow text wrapping on narrow screens */
        text-align: center;
        padding: 12px 16px;
    }
    .brand-text h1 {
        font-size: 20px;
    }
    .agent-name-input-row {
        flex-direction: column;
    }
    .agent-name-input-row button {
        width: 100%;
    }
    .slider-val-badge {
        font-size: 18px;
    }
}


/* --- AD BANNERS LAYOUT --- */
.layout-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 10px;
}

.dashboard-container {
    flex: 1;
    max-width: 1200px;
    width: 100%;
}

.ad-banner {
    width: 160px;
    display: none; /* Oculto en móviles */
    position: sticky;
    top: 20px;
}

.ad-placeholder {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    height: 600px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.2);
    text-align: center;
    padding: 10px;
    font-size: 12px;
    font-weight: 500;
}

@media (min-width: 1400px) {
    .ad-banner {
        display: block;
    }
}
