﻿:root {
    /* Color Palette - Premium Dark */
    --bg-dark: #0a0b0e;
    --bg-sidebar: #111319;
    --card-bg: #15171e;
    --card-hover: #1c1f28;
    --primary: #10b981; /* Emerald Green */
    --primary-glow: rgba(16, 185, 129, 0.2);
    --secondary: #059669;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    --border: rgba(255, 255, 255, 0.08);
    --accent-glow: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --glass-bg: rgba(21, 23, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    
    /* Stats Colors */
    --clr-positive: #10b981;
    --clr-negative: #ef4444;
    --clr-warning: #f59e0b;
    --clr-strategic: #10b981;
    
    /* Simulator Specific */
    --clr-opt: #10b981;
    --clr-base: #3b82f6;
    --clr-pes: #f59e0b;
}

.hidden {
    display: none !important;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, .logo-text {
    font-family: 'Outfit', sans-serif;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo-section {
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-glow);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.logo-text {
    font-size: 1.4rem;
    letter-spacing: 1px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--text-dim);
    border-radius: 8px;
    transition: all 0.3s ease;
    gap: 12px;
}

.nav-item i {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    background: var(--card-bg);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--card-bg);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

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

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

.avatar {
    width: 40px;
    height: 40px;
    background: #262a33;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2.5rem;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
}

.accent-text {
    color: var(--primary);
}

.subtitle {
    color: var(--text-dim);
    font-size: 0.95rem;
}

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

.search-bar {
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    width: 18px;
}

.search-bar input {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: white;
    padding: 10px 10px 10px 40px;
    border-radius: 8px;
    width: 300px;
    outline: none;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    border-color: var(--primary);
}

.btn-primary {
    background: var(--accent-glow);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s;
}

.metric-card:hover {
    transform: translateY(-5px);
    border-color: var(--text-dim);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon.buyers { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.metric-icon.volume { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.metric-icon.average { background: rgba(167, 139, 250, 0.1); color: #a78bfa; }
.metric-icon.strategic { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.metric-label {
    display: block;
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.metric-data h3 {
    font-size: 1.6rem;
    font-weight: 700;
}

.metric-trend {
    font-size: 0.75rem;
    margin-top: 4px;
    display: block;
}

.metric-trend.positive { color: var(--clr-positive); }
.metric-trend.neon { color: var(--primary); font-weight: 700; }

/* Charts Area */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.chart-container {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
}

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

#demandChart, #regionChart {
    width: 100% !important;
    max-height: 300px;
}

/* Data Table Styling */
.data-section {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 1.5rem;
}

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

.filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    background: #1c1f28;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

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

th {
    text-align: left;
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 16px 12px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.strategic-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.standard-badge {
    background: #262a33;
    color: var(--text-dim);
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* Simulator Layout & Components */
.simulator-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
}

.sim-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sim-group {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.sim-group h3 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.glass-card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow);
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    width: 16px !important;
    height: 16px !important;
}

.input-with-icon input {
    padding-left: 42px !important;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-field label {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 500;
}

.input-field input {
    background: #1c1f28;
    border: 1px solid var(--border);
    color: white;
    padding: 12px;
    border-radius: 8px;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    transition: all 0.3s;
}

.input-field input:focus {
    border-color: var(--primary);
    background: #252a35;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 10px;
    font-style: italic;
}

/* Scenario Cards */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.scenario {
    position: relative;
    padding: 1.5rem;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scenario h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.card-tag {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.res-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.res-item span { color: var(--text-dim); }
.res-item strong { color: var(--text-main); }

.flow-box {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.flow-title {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.flow-details {
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Individual Scenario Colors */
.scenario.optimista { border-top: 4px solid var(--clr-opt); }
.scenario.base { border-top: 4px solid var(--clr-base); }
.scenario.pesimista { border-top: 4px solid var(--clr-pes); }

.scenario.active {
    background: var(--card-hover);
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.sim-chart {
    height: 350px;
}

/* Responsive Design Tweaks */
@media (max-width: 1200px) {
    .simulator-layout {
        grid-template-columns: 1fr;
    }
    .scenario-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.scenario {
    animation: fadeInUp 0.5s ease-out forwards;
}

.scenario:nth-child(2) { animation-delay: 0.1s; }
.scenario:nth-child(3) { animation-delay: 0.2s; }

.counter {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
}

.flow-container {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.flow-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
}

.flow-details {
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flow-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 8px;
}

.flow-item.anticipo .flow-dot { background: var(--primary); }
.flow-item.mitad .flow-dot { background: var(--clr-base); }
.flow-item.final .flow-dot { background: var(--text-muted); }

.canvas-wrapper {
    height: 300px;
    position: relative;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.modal-container {
    width: 90%;
    max-width: 600px;
    padding: 2.5rem;
    position: relative;
    animation: modalSlide 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

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

.modal-header h2 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.input-grid-modal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Placeholder Sections */
.placeholder-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 2rem;
    margin-top: 2rem;
}

.placeholder-section i {
    width: 64px;
    height: 64px;
    color: var(--primary);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.placeholder-section h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.placeholder-section p {
    color: var(--text-muted);
    max-width: 400px;
}

/* Custom Select Styling */
select {
    background: #1c1f28;
    border: 1px solid var(--border);
    color: white;
    padding: 12px;
    border-radius: 8px;
    outline: none;
    font-family: 'Inter', sans-serif;
    width: 100%;
    cursor: pointer;
}

select:focus {
    border-color: var(--primary);
}

/* ===== CLIENT DATABASE / DIRECTORY ===== */
.data-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem 2rem;
    margin-top: 1.5rem;
}

.section-header {
    margin-bottom: 1.5rem;
}

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

.header-filters .search-bar {
    flex: 1;
    min-width: 220px;
}

.filters {
    display: flex;
    gap: 8px;
}

.filter-dir-btn,
.filter-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.25s ease;
}

.filter-dir-btn:hover,
.filter-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

.filter-dir-btn.active,
.filter-btn.active {
    background: var(--primary);
    color: #0a0e17;
    border-color: var(--primary);
    font-weight: 700;
}

/* Directory Table specific */
#directoryTable {
    width: 100%;
    border-collapse: collapse;
}

#directoryTable thead th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

#directoryTable tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
}

#directoryTable tbody tr:hover {
    background: rgba(16, 185, 129, 0.04);
}

#directoryTable tbody td {
    padding: 14px 16px;
    font-size: 0.9rem;
    color: #e0e0e0;
    vertical-align: middle;
}

#directoryTable tbody td:first-child {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

/* ===== CONFIGURATION MODULE ===== */
.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.config-card {
    padding: 2rem;
}

.config-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.config-card h3 i {
    width: 22px;
    height: 22px;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.config-form .btn-primary {
    margin-top: 0.5rem;
    align-self: flex-start;
}

/* Toggle Switch */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

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

.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #3a3f4b;
    border-radius: 26px;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

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

/* Integrations */
.integrations-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.integration-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s ease;
}

.integration-item:hover {
    border-color: var(--primary);
}

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

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

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

/* Status Badges */
.status-badge {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-badge.pending {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.status-badge.active, .status-badge.transito {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-badge.completed, .status-badge.entregado {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.cancelled, .status-badge.rechazada {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.aprobada {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Shared Table Styles (shipments + quotes) */
#shipmentsTable,
#quotesTable {
    width: 100%;
    border-collapse: collapse;
}

#shipmentsTable thead th,
#quotesTable thead th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

#shipmentsTable tbody tr,
#quotesTable tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
}

#shipmentsTable tbody tr:hover,
#quotesTable tbody tr:hover {
    background: rgba(16, 185, 129, 0.04);
}

#shipmentsTable tbody td,
#quotesTable tbody td {
    padding: 14px 16px;
    font-size: 0.9rem;
    color: #e0e0e0;
    vertical-align: middle;
}

/* Toast notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: #0a0e17;
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 2000;
    animation: toastSlide 0.4s ease, toastFade 0.4s ease 2.5s forwards;
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.3);
}

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

@keyframes toastFade {
    to { opacity: 0; transform: translateY(-10px); }
}

/* ===== STAFF REGISTRY ===== */
.staff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.staff-header h3 {
    margin-bottom: 0 !important;
}

.btn-sm {
    padding: 8px 16px !important;
    font-size: 0.82rem !important;
}

.staff-metrics {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 12px;
}

.staff-metric-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.staff-metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

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

#staffTable {
    width: 100%;
    border-collapse: collapse;
}

#staffTable thead th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

#staffTable tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
}

#staffTable tbody tr:hover {
    background: rgba(16, 185, 129, 0.04);
}

#staffTable tbody td {
    padding: 14px 16px;
    font-size: 0.9rem;
    color: #e0e0e0;
    vertical-align: middle;
}

/* Staff modal form */
.staff-modal-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.staff-modal-form .input-field:last-child {
    grid-column: 1 / -1;
}

/* Staff Action Buttons */
.btn-danger-sm {
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.btn-reactivate-sm {
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-reactivate-sm:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10b981;
}

/* ===== QUOTE FILTERS ===== */
.quote-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.quote-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.quote-filter-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

.quote-filter-btn.active {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
}

.quote-filter-btn.active .filter-count {
    background: rgba(16, 185, 129, 0.2);
}

.count-pending {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
}

.count-approved {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
}

.count-rejected {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
}

/* ===== BUYER DETAIL PANEL ===== */
.buyer-detail-panel {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    animation: slideDown 0.3s ease;
}

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

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

.detail-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    color: var(--primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.detail-card {
    padding: 1.2rem 1.5rem;
}

.detail-card h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-field label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.editable-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 36px;
}

.field-value {
    font-size: 0.92rem;
    color: #e0e0e0;
    font-weight: 500;
}

.btn-edit-field {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-edit-field:hover {
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary);
    border-color: rgba(16, 185, 129, 0.3);
}

.btn-edit-field svg,
.btn-edit-field i {
    width: 14px;
    height: 14px;
}

.inline-edit-input {
    flex: 1;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
}

.inline-edit-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.btn-save-inline {
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--primary);
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-save-inline:hover {
    opacity: 0.85;
}

.btn-view-buyer {
    padding: 5px 16px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.08);
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-view-buyer:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--primary);
}

/* ===== UTILITY CLASSES (replacing inline styles) ===== */
.metrics-grid--spaced {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* ===== LANGUAGE SELECTOR CARD ===== */
.lang-card {
    padding: 2rem !important;
}


.lang-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.4rem;
}

.lang-card-sub {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.lang-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.lang-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 1.2rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    color: var(--text-muted);
}

.lang-btn:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-3px);
    color: var(--text-main);
}

.lang-btn.active {
    background: rgba(16, 185, 129, 0.12);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
    color: var(--text-main);
}

.lang-flag {
    font-size: 2.2rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.lang-name {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.lang-check {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.lang-check i {
    width: 10px;
    height: 10px;
    color: white;
}

.lang-btn.active .lang-check {
    opacity: 1;
    transform: scale(1);
}

@media (max-width: 900px) {
    .lang-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== CLOUDFLARE INTEGRATION LINK ===== */
.integration-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.integration-link:hover {
    color: #f6821f;
}

.integration-link:hover strong {
    color: #f6821f;
    text-shadow: 0 0 10px rgba(246, 130, 31, 0.4);
}

.cf-logo {
    font-size: 1.1rem;
    filter: drop-shadow(0 0 4px rgba(246, 130, 31, 0.5));
}

/* ===== INTEGRATION ACTIVATE BUTTONS ===== */
.integration-item {
    gap: 1rem;
}

.int-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.int-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.int-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-activate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: var(--primary);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-activate i {
    width: 13px;
    height: 13px;
}

.btn-activate:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-activate.btn-deactivate {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.btn-activate.btn-deactivate:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.cloudflare-btn:not(.btn-deactivate) {
    background: rgba(246, 130, 31, 0.1);
    border-color: rgba(246, 130, 31, 0.4);
    color: #f6821f;
}

.cloudflare-btn:not(.btn-deactivate):hover {
    background: rgba(246, 130, 31, 0.2);
    border-color: #f6821f;
    box-shadow: 0 4px 12px rgba(246, 130, 31, 0.25);
}

/* Green ACTIVO badge */
.status-badge.activo {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.4);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3); }
    50%       { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}

/* ===================================================
   HELP / MANUAL SECTION
   =================================================== */
.help-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; margin-top: 8px; }
.help-toc { position: sticky; top: 20px; padding: 20px; border-radius: 16px; }
.help-toc h3 { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary); margin-bottom: 14px; }
.toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.toc-list li a { display: block; padding: 7px 10px; border-radius: 8px; font-size: 0.82rem; color: var(--text-muted); text-decoration: none; transition: all 0.2s; border-left: 2px solid transparent; }
.toc-list li a:hover { color: var(--primary); background: var(--primary-glow); border-left-color: var(--primary); padding-left: 14px; }
.help-sections { display: flex; flex-direction: column; gap: 12px; }
.help-card { border-radius: 16px; overflow: hidden; border: 1px solid var(--glass-border); transition: box-shadow 0.2s; }
.help-card:hover { box-shadow: 0 0 0 1px rgba(16,185,129,0.2); }
.help-card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; user-select: none; transition: background 0.2s; }
.help-card-header:hover { background: rgba(16,185,129,0.06); }
.help-card-header h3 { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; font-weight: 600; color: var(--text-main); margin: 0; }
.help-card-header h3 svg { color: var(--primary); width: 18px; height: 18px; }
.help-chevron { color: var(--text-dim); width: 18px; height: 18px; flex-shrink: 0; transition: transform 0.3s; }
.help-card-body { display: none; padding: 0 20px 20px; animation: help-fade-in 0.25s ease; }
.help-card.open .help-card-body { display: block; }
.help-card.open .help-chevron { transform: rotate(180deg); }
.help-card.open .help-card-header { border-bottom: 1px solid var(--glass-border); }
@keyframes help-fade-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.help-card-body p { color: var(--text-muted); line-height: 1.7; margin: 10px 0; font-size: 0.9rem; }
.help-card-body h4 { color: var(--text-main); font-size: 0.82rem; font-weight: 700; margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--glass-border); text-transform: uppercase; letter-spacing: 0.05em; }
.help-card-body ul, .help-card-body ol { padding-left: 18px; margin: 8px 0; }
.help-card-body li { color: var(--text-muted); font-size: 0.88rem; line-height: 1.7; margin-bottom: 4px; }
.help-card-body strong { color: var(--text-main); }
.help-card-body a { color: var(--primary); text-decoration: none; }
.help-card-body a:hover { text-decoration: underline; }
.help-card-body code { background: rgba(16,185,129,0.1); color: var(--primary); padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 0.85em; }
.help-card-body table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 0.85rem; }
.help-card-body thead th { background: rgba(16,185,129,0.08); color: var(--primary); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 12px; text-align: left; border-bottom: 1px solid rgba(16,185,129,0.25); }
.help-card-body tbody td { padding: 9px 12px; color: var(--text-muted); border-bottom: 1px solid var(--glass-border); line-height: 1.5; }
.help-card-body tbody tr:last-child td { border-bottom: none; }
.help-card-body tbody tr:hover td { background: rgba(255,255,255,0.02); }
.help-note, .help-tip, .help-warning { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; margin: 14px 0 4px; font-size: 0.85rem; line-height: 1.6; }
.help-note { background: rgba(59,130,246,0.08); border-left: 3px solid #3b82f6; color: #93c5fd; }
.help-note svg { color: #3b82f6; flex-shrink:0; width:16px; height:16px; margin-top:2px; }
.help-tip  { background: rgba(16,185,129,0.08); border-left: 3px solid var(--primary); color: #6ee7b7; }
.help-tip svg { color: var(--primary); flex-shrink:0; width:16px; height:16px; margin-top:2px; }
.help-warning { background: rgba(245,158,11,0.08); border-left:3px solid #f59e0b; color: #fcd34d; }
.help-warning svg { color: #f59e0b; flex-shrink:0; width:16px; height:16px; margin-top:2px; }
.help-footer { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; padding: 16px 24px; border-radius: 14px; margin-top: 24px; }
.help-footer-item { display: flex; flex-direction: column; gap: 3px; }
.help-footer-item span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.help-footer-item a, .help-footer-item strong { font-size: 0.85rem; color: var(--primary); text-decoration: none; font-weight: 600; }
@media print {
    .sidebar, #dashboardView, #simulatorView, #compradoresView, #logisticaView, #cotizacionesView, #configuracionView, .modal, #buyerDetailPanel, .help-toc, #btnExportPDF, .top-header .header-right { display: none !important; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    body { background: #fff !important; color: #1a1a1a !important; }
    .main-content { margin-left: 0 !important; padding: 20px !important; background: white !important; }
    #ayudaView { display: block !important; padding: 0 !important; }
    .top-header { border-bottom: 2px solid #10b981 !important; background: white !important; padding: 16px 0 !important; margin-bottom: 24px; display: block !important; }
    .top-header h2 { color: #1a1a1a !important; } .accent-text { color: #059669 !important; } .top-header .subtitle { color: #555 !important; }
    .help-layout { display: block !important; } .help-card-body { display: block !important; }
    .help-card { page-break-inside: avoid; border: 1px solid #ddd !important; background: #fff !important; box-shadow: none !important; margin-bottom: 14px !important; border-radius: 8px !important; }
    .help-card-header { background: #f8f8f8 !important; padding: 12px 16px !important; }
    .help-card-header h3 { color: #1a1a1a !important; } .help-chevron { display: none !important; }
    .help-card-body { padding: 12px 16px 16px !important; }
    .help-card-body p, .help-card-body li { color: #333 !important; } .help-card-body h4 { color: #1a1a1a !important; border-bottom-color: #ddd !important; }
    .help-card-body strong { color: #000 !important; } .help-card-body a { color: #059669 !important; }
    .help-card-body thead th { background: #f0fdf4 !important; color: #059669 !important; border-bottom: 1px solid #ccc !important; }
    .help-card-body tbody td { color: #333 !important; border-bottom: 1px solid #eee !important; }
    .help-note { background: #eff6ff !important; color: #1e40af !important; }
    .help-tip  { background: #f0fdf4 !important; color: #065f46 !important; }
    .help-warning { background: #fffbeb !important; color: #92400e !important; }
    .help-footer { background: #f8f8f8 !important; border: 1px solid #ddd !important; box-shadow: none !important; }
    .help-footer-item span { color: #666 !important; } .help-footer-item a, .help-footer-item strong { color: #059669 !important; }
}