/**
 * @fileoverview NEXUS BI - ENTERPRISE SYSTEMS ARCHITECTURE
 * PLATFORM MASTER STYLESHEET (CYBER-PREMIUM EDITION)
 * ARCHITECTURE: MONOLITHIC HUB MASTERPIECE // ELITE SENIOR LEVEL
 */

/* ==========================================================================
   1. DESIGN TOKENS & SYSTEM VARIABLES (Премиальная неоновая палитра)
   ========================================================================== */
:root {
    --bg-main: #030712; /* Глубокий, чистый и дорогой темный цвет */
    --bg-card: rgba(15, 23, 42, 0.45); /* Идеальное полупрозрачное стекло */
    --bg-sidebar: #090f1d;
    --bg-input: #0b1324;
    --bg-hover: rgba(56, 189, 248, 0.08);
    /* Типографика */
    --text-main: #f8fafc;
    --text-muted: #64748b;
    --text-silver: #94a3b8;
    /* Акценты с эффектом Glow */
    --accent-primary: #38bdf8;
    --accent-success: #34d399;
    --accent-danger: #fb7185;
    --accent-indigo: #818cf8;
    /* Статусы */
    --status-success: #10b981;
    --status-pending: #fbbf24;
    /* Эффекты */
    --border-color: rgba(255, 255, 255, 0.04);
    --border-glow: rgba(56, 189, 248, 0.15);
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --font-stack: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0px 0px rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   2. GLOBAL RESET & AMBIENT SETUP
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-stack);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* Сверхтехнологичная эмбиент-подсветка */
.ambient-glow {
    position: absolute;
    top: -10%;
    left: -10%;
    right: -10%;
    height: 700px;
    background-image: radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.08) 0%, transparent 40%), radial-gradient(circle at 85% 20%, rgba(129, 140, 248, 0.05) 0%, transparent 40%);
    z-index: 1;
    pointer-events: none;
}

/* Элегантный стеклянный скроллбар */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--accent-primary);
        box-shadow: 0 0 10px var(--accent-primary);
    }

/* ==========================================================================
   3. LAYOUT & SIDEBAR REDESIGN
   ========================================================================== */
.app-layout {
    position: relative;
    display: flex;
    width: 100vw;
    height: 100vh;
    z-index: 2;
}

.main-sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 28px 24px;
    flex-shrink: 0;
    z-index: 10;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(56, 189, 248, 0.03) 100%);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--border-radius-md);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.brand-text h2 {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-silver);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition-smooth);
    position: relative;
}

    .menu-item:hover {
        color: #fff;
        background-color: var(--bg-hover);
        transform: translateX(4px);
    }

    .menu-item.active {
        color: #fff;
        background: linear-gradient(90deg, rgba(56, 189, 248, 0.12) 0%, transparent 100%);
        border-left: 3px solid var(--accent-primary);
        box-shadow: inset 8px 0 16px -8px rgba(56, 189, 248, 0.3);
        font-weight: 600;
    }

/* ==========================================================================
   4. APP CONTAINER & HEADERS
   ========================================================================== */
.app-container {
    flex-grow: 1;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 40px;
    gap: 28px;
    z-index: 5;
}

.main-header h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 60%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.export-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 12px 22px;
    border-radius: var(--border-radius-md);
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    transition: var(--transition-smooth);
}

    .export-btn:hover {
        background: var(--text-main);
        color: var(--bg-main);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
        transform: translateY(-1px);
    }

/* ==========================================================================
   5. FILTERS PANEL (Glassmorphism & Neon inputs)
   ========================================================================== */
.filters-panel {
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 24px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-premium);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.filter-group select,
.filter-group input {
    background-color: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    padding: 14px 18px;
    border-radius: var(--border-radius-md);
    font-size: 13px;
    transition: var(--transition-smooth);
}

    .filter-group select:focus,
    .filter-group input:focus {
        border-color: var(--accent-primary);
        box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
        background-color: #0d172d;
    }

/* ==========================================================================
   6. CORE WIDGETS LAYOUT
   ========================================================================== */
.widget-wrapper {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
}

    .widget-wrapper:hover {
        border-color: rgba(56, 189, 248, 0.2);
        box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6), 0 0 30px rgba(56, 189, 248, 0.03);
        transform: translateY(-2px);
    }

.widget-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(0, 0, 0, 0.15);
}

    .widget-header h3 {
        font-size: 12px;
        font-weight: 700;
        color: var(--text-main);
        letter-spacing: 0.06em;
    }

/* ==========================================================================
   7. KPI ARCHITECTURE (Premium Dashboard Cards)
   ========================================================================== */
.kpi-grid {
    gap: 24px;
}

.kpi-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%), rgba(11, 18, 36, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-lg);
    padding: 26px;
    transition: var(--transition-smooth);
}

    .kpi-card:hover {
        transform: translateY(-4px);
    }

    .kpi-card.text-revenue:hover {
        border-color: rgba(56, 189, 248, 0.3);
        box-shadow: 0 15px 30px -10px rgba(56, 189, 248, 0.15);
    }

    .kpi-card.text-orders:hover {
        border-color: rgba(52, 211, 153, 0.3);
        box-shadow: 0 15px 30px -10px rgba(52, 211, 153, 0.15);
    }

    .kpi-card.text-aov:hover {
        border-color: rgba(251, 113, 133, 0.3);
        box-shadow: 0 15px 30px -10px rgba(251, 113, 133, 0.15);
    }

.kpi-value {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-top: 6px;
}

/* ==========================================================================
   8. REAL-TIME DATA TABLES
   ========================================================================== */
.enterprise-table th {
    padding: 16px;
    font-size: 11px;
    letter-spacing: 0.08em;
    background: rgba(0, 0, 0, 0.1);
}

.enterprise-table td {
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.enterprise-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   9. HIGH-TECH COCKPIT FOR TAB: "ГЛИБОКА АНАЛІТИКА" (OLAP MASTER)
   ========================================================================== */
.view-section {
    animation: fadeInView 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInView {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Пульсирующий живой статус трансляции */
@keyframes neonPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 8px #10b981;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.6;
        box-shadow: 0 0 18px #10b981;
    }
}

span[style*="animation: pulse"] {
    animation: neonPulse 1.8s infinite cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Новые ультимативные стили табличного интерфейса Senior++ */
.olap-metadata-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 20px;
}

.olap-title-block h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 0 0 4px 0;
}

.olap-title-block p {
    font-size: 0.85rem;
    color: var(--text-silver);
    margin: 0;
}

.olap-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(52, 211, 153, 0.06);
    border: 1px solid rgba(52, 211, 153, 0.2);
    padding: 6px 14px;
    border-radius: 30px;
}

    .olap-status-badge .pulse-dot {
        width: 6px;
        height: 6px;
        background-color: var(--accent-success);
        border-radius: 50%;
        box-shadow: 0 0 10px var(--accent-success);
    }

    .olap-status-badge .badge-text {
        font-family: var(--font-mono);
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--accent-success);
        letter-spacing: 0.05em;
    }

/* Сетка корпоративной таблицы */
.enterprise-olap-table {
    width: 100%;
    border-collapse: collapse;
}

    .enterprise-olap-table th {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-muted);
        letter-spacing: 0.08em;
        padding: 12px 16px;
        text-transform: uppercase;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

.olap-row-interactive {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

    .olap-row-interactive:hover {
        background-color: rgba(255, 255, 255, 0.02);
    }

    .olap-row-interactive td {
        padding: 20px 16px;
        vertical-align: middle;
    }

.cell-sector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sector-indicator {
    width: 4px;
    height: 16px;
    border-radius: 2px;
}

.sector-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.cell-deals {
    font-size: 0.95rem;
    color: #cbd5e1;
}

.deals-unit {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 4px;
}

/* Стилизация прогресс-бара */
.olap-progress-container {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 320px;
}

.percentage-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    min-width: 45px;
}

.progress-bar-track {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cell-revenue {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

    .cell-revenue .currency-symbol {
        color: var(--text-muted);
        margin-right: 2px;
        font-weight: 500;
    }
