/* FILENAME: quant_pulse.css
 * SYSTEM: MONARCH INSTITUTIONAL TERMINAL // V44.0 (PATH DEPENDENCY UPGRADE)
 * CLASSIFICATION: QUANTITATIVE / HIGH-FREQUENCY
 * RENDER_MODE: 4K_HD_TELEMETRY / ADAPTIVE FLUID
 * ARCHITECTURE: SINGLE-TABLE FLUID GRID
 * THEME: LUXURY QUANT (BLACK/GOLD/WHITE)
 */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&family=Inter:wght@400;600;800&family=Rajdhani:wght@500;600;700&display=swap');

/* ==========================================================================
   1.0 SYSTEM VARIABLES & PALETTE CONFIGURATION
   ========================================================================== */
.monarch-grid-layout {
    /* --- CORE PHYSICS --- */
    --bg-void: #000000;       /* Absolute Zero Black */
    --bg-panel: #050505;      /* Deep Matte Panel */
    --bg-chrome: #0a0a0a;     /* UI Chrome/Header */

    /* --- BORDERS & SEPARATORS --- */
    --border-dim: #222222;    /* Subtle separation */
    --border-mid: #444444;    /* Structural definition */
    --border-bright: #D4AF37; /* Gold Highlight */

    /* --- TEXTOGRAPHY --- */
    --text-primary: #ffffff;  /* Pure White */
    --text-secondary: #cccccc;/* Silver Grey */
    --text-muted: #666666;    /* Dark Grey */

    /* --- THEME ACCENTS (GOLD STANDARD) --- */
    --theme-gold: #D4AF37;
    --theme-gold-dim: rgba(212, 175, 55, 0.1);
    --theme-gold-glow: rgba(212, 175, 55, 0.25);

    /* --- SIGNAL COLORS (FUNCTIONAL) --- */
    --sig-buy: #2ecc71;
    --sig-buy-dim: rgba(46, 204, 113, 0.1);
    --sig-sell: #e74c3c;
    --sig-sell-dim: rgba(231, 76, 60, 0.1);
    --sig-warn: #f39c12;
    --sig-warn-dim: rgba(243, 156, 18, 0.1);
    --sig-info: #D4AF37;
    --sig-info-dim: rgba(212, 175, 55, 0.1);

    /* --- ROOT CONTAINER PROPERTIES --- */
    width: 100%;
    height: 100vh; /* Fixed viewport height */
    display: flex;
    flex-direction: column;
    background-color: var(--bg-void);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    overflow: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   2.0 GLOBAL RESET & SCROLLBAR ENGINEERING
   ========================================================================== */
.monarch-grid-layout * {
    box-sizing: border-box;
    outline: none;
    user-select: none;
}

/* SCROLLBARS (Gold Theme) */
.monarch-grid-layout ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.monarch-grid-layout ::-webkit-scrollbar-track {
    background: #000;
    border: 1px solid var(--border-dim);
}

.monarch-grid-layout ::-webkit-scrollbar-thumb {
    background: #333;
    border: 1px solid #000;
}

.monarch-grid-layout ::-webkit-scrollbar-thumb:hover {
    background: var(--theme-gold);
    cursor: pointer;
}

/* ==========================================================================
   3.0 HEADER & COMMAND DECK (GRID-LOCKED)
   ========================================================================== */
.monarch-grid-layout .top-nav-bar {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 20px;
    min-height: 70px;
    padding: 0 24px;
    background: var(--bg-chrome);
    border-bottom: 1px solid var(--border-dim);
    border-top: 2px solid var(--theme-gold);
    box-shadow: 0 4px 15px rgba(0,0,0,0.8);
    z-index: 100;
}

.monarch-grid-layout .brand-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.monarch-grid-layout .brand-section h1 {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: clamp(18px, 2vw, 22px);
    color: #ffffff;
    margin: 0;
    line-height: 1;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.monarch-grid-layout .brand-section .version {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--theme-gold);
    letter-spacing: 1px;
    margin-top: 4px;
    opacity: 0.9;
}

.monarch-grid-layout .control-surface {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-self: end;
}

.monarch-grid-layout .status-indicator {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    background: #050505;
    border: 1px solid #222;
    padding: 8px 12px;
    min-width: 140px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: all 0.3s;
}

.monarch-grid-layout .tactical-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--theme-gold);
    color: var(--theme-gold);
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 8px 20px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.monarch-grid-layout .tactical-btn:hover {
    background: var(--theme-gold);
    color: #000000;
    box-shadow: 0 0 15px var(--theme-gold-glow);
}

.monarch-grid-layout .system-clock {
    border-left: 1px solid var(--border-dim);
    padding-left: 20px;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 40px;
}

.monarch-grid-layout .system-clock div {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #fff;
    font-weight: 600;
    line-height: 1.2;
}

/* ==========================================================================
   4.0 KPI TELEMETRY DECK
   ========================================================================== */
.monarch-grid-layout .kpi-deck {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 15px 24px;
    border-bottom: 1px solid var(--border-dim);
    background: #000;
    flex-shrink: 0;
}

.monarch-grid-layout .kpi-module {
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    padding: 15px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.monarch-grid-layout .kpi-module:hover {
    border-color: var(--theme-gold);
    background: rgba(212, 175, 55, 0.02);
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

.monarch-grid-layout .kpi-module::before {
    content: '';
    position: absolute; top: 0; left: 0; width: 100%; height: 1px;
    background: var(--border-dim);
    transition: background 0.3s;
}

.monarch-grid-layout .kpi-module:hover::before {
    background: var(--theme-gold);
    height: 2px;
}

.monarch-grid-layout .kpi-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 1px;
}

.monarch-grid-layout .kpi-value {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(20px, 2vw, 28px);
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.5px;
    line-height: 1;
}

.monarch-grid-layout .kpi-subtext {
    font-size: 9px;
    color: var(--theme-gold);
    margin-top: 5px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* ==========================================================================
   5.0 SINGLE-TABLE DATA ENGINE (ADAPTIVE)
   ========================================================================== */
.monarch-grid-layout .data-viewport {
    padding: 0 24px 24px 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    background: #000;
}

.monarch-grid-layout .table-full-wrapper {
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    border-top: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: auto; /* Enables horizontal scroll on small devices */
    position: relative;
}

/* MASTER TABLE CONFIGURATION */
.monarch-grid-layout .quant-table {
    width: 100%;
    min-width: 1100px; /* Prevents 13 columns from crushing together */
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    table-layout: fixed;
}

.monarch-grid-layout .quant-table thead th {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #080808;
    border-bottom: 2px solid var(--theme-gold);

    color: #ffffff !important;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 16px 12px;
    text-align: left;
    cursor: default;
    box-shadow: 0 4px 10px rgba(0,0,0,0.8);
}

.monarch-grid-layout .quant-table tbody tr {
    transition: background 0.1s ease;
}

.monarch-grid-layout .quant-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #1a1a1a;
    color: #e0e0e0 !important;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.monarch-grid-layout .quant-table tbody tr:hover td {
    background: rgba(212, 175, 55, 0.08);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    color: #fff !important;
}

/* ==========================================================================
   6.0 COLUMN GEOMETRY (13 COLUMNS - REBALANCED)
   ========================================================================== */
.monarch-grid-layout .col-ticker { width: 7%; font-weight: 800; color: var(--theme-gold) !important; letter-spacing: 0.5px; }
.monarch-grid-layout .col-signal { width: 11%; }
.monarch-grid-layout .col-ai     { width: 4%; text-align: center !important; }
.monarch-grid-layout .col-conf   { width: 5%; text-align: center !important; }
.monarch-grid-layout .col-note   { width: 15%; color: #888 !important; font-style: italic; }
.monarch-grid-layout .col-fractal{ width: 6%; text-align: right !important; }
.monarch-grid-layout .col-vwap   { width: 8%; text-align: right !important; }
.monarch-grid-layout .col-stop   { width: 8%; text-align: right !important; }
.monarch-grid-layout .col-target { width: 8%; text-align: right !important; }
.monarch-grid-layout .col-mae    { width: 7%; text-align: right !important; }
.monarch-grid-layout .col-mfe    { width: 7%; text-align: right !important; }
.monarch-grid-layout .col-vol    { width: 7%; text-align: right !important; }
.monarch-grid-layout .col-acc    { width: 7%; text-align: right !important; }

/* ==========================================================================
   7.0 UTILITIES & VISUAL ASSETS
   ========================================================================== */

/* --- SIGNAL BADGES --- */
.monarch-grid-layout .signal-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 0px;
    font-size: 10px;
    font-weight: 700;
    min-width: 90px;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.monarch-grid-layout .tag-buy { background: rgba(0,0,0,0.5); color: var(--sig-buy); border: 1px solid var(--sig-buy); }
.monarch-grid-layout .tag-sell { background: rgba(0,0,0,0.5); color: var(--sig-sell); border: 1px solid var(--sig-sell); }
.monarch-grid-layout .tag-whale { background: var(--theme-gold-dim); color: var(--theme-gold); border: 1px solid var(--theme-gold); box-shadow: 0 0 10px var(--theme-gold-dim); }
.monarch-grid-layout .tag-neu { background: transparent; color: #666; border: 1px solid #333; }

/* --- LOADING OVERLAY & ANIMATIONS --- */
.monarch-grid-layout .loading-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 999;
}

.pulse-loader-text {
    font-family: 'JetBrains Mono', monospace; font-size: 14px; letter-spacing: 4px; font-weight: 700;
    color: var(--theme-gold); text-transform: uppercase; margin-bottom: 12px;
    animation: goldTextPulse 2s infinite ease-in-out;
}

.pulse-loader-track { width: 200px; height: 2px; background: #1a1a1a; position: relative; overflow: hidden; }
.pulse-loader-bar { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent; }
.pulse-loader-bar::after {
    content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 40%;
    background: var(--theme-gold); box-shadow: 0 0 15px var(--theme-gold);
    animation: goldBarSweep 1.5s infinite cubic-bezier(0.65, 0.05, 0.36, 1);
}

@keyframes goldTextPulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 0 rgba(212, 175, 55, 0); }
    50% { opacity: 0.6; text-shadow: 0 0 10px rgba(212, 175, 55, 0.5); }
}

@keyframes goldBarSweep {
    0% { transform: translateX(-150%); }
    100% { transform: translateX(350%); }
}

/* ==========================================================================
   8.0 ADAPTIVE BREAKPOINTS & RESPONSIVE DESIGN
   ========================================================================== */

/* Tablet Landscape */
@media (max-width: 1024px) {
    .monarch-grid-layout .kpi-deck { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .monarch-grid-layout .brand-section span.version { display: none; }
    .monarch-grid-layout .system-clock { display: none; } /* Hide clock to save header space */
}

/* Tablet Portrait & Mobile */
@media (max-width: 768px) {
    .monarch-grid-layout { height: 100vh; overflow-y: auto; } /* Allow whole app to scroll vertically if needed */

    .monarch-grid-layout .top-nav-bar {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        padding: 15px;
        gap: 15px;
    }

    .monarch-grid-layout .control-surface { justify-content: center; width: 100%; }
    .monarch-grid-layout .kpi-deck { grid-template-columns: 1fr; padding: 15px; }
    .monarch-grid-layout .data-viewport { padding: 0 15px 15px 15px; }

    /* The table wrapper will handle horizontal scrolling automatically due to min-width: 1100px */
}