@charset "UTF-8";
/**
 * FILE: /include/css/style.css
 * SCOPO: KRATOS FTS 5.0 - Master Stylesheet (Unified Complete)
 * DESIGN: Terminale Finanziario (Dark Quantum)
 */

/* ========================================================================
   1. VARIABILI DI SISTEMA (COLORI E DIMENSIONI)
   ======================================================================== */
:root {
    --bg-main: #020409;
    --bg-panel: rgba(15, 23, 42, 0.4);
    --border-panel: rgba(255, 255, 255, 0.05);
    --text-muted: #64748b;
    --text-light: #f8fafc;
    --accent-blue: #06b6d4;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    --font-mono: "JetBrains Mono", monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ========================================================================
   2. RESET E IMPOSTAZIONI GLOBALI
   ======================================================================== */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}
body { 
    background-color: var(--bg-main); 
    color: var(--text-light); 
    font-family: var(--font-sans); 
}
a { 
    text-decoration: none; 
}

/* ========================================================================
   3. TOP NAVIGATION BAR (menu_top.php)
   ======================================================================== */
.kratos-top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 20px;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 99999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
.kratos-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-weight: 900;
    font-size: 15px;
    color: #ffffff;
    letter-spacing: 1.5px;
}
.kratos-nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}
.kratos-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    transition: all 0.2s ease;
}
.kratos-nav-item:hover {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.03);
}
.kratos-nav-item.active {
    color: var(--accent-blue);
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}
.kratos-nav-icon {
    width: 13px;
    height: 13px;
    stroke-width: 2.2;
}
.kratos-user-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 10px;
}
.kratos-user-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 4px;
}
.kratos-logout-btn {
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 800;
    background: rgba(239, 68, 68, 0.08);
    transition: all 0.2s ease;
}
.kratos-logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--accent-red);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}
.kratos-hamburger {
    display: none;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-panel);
    color: var(--text-light);
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.kratos-hamburger:hover {
    background: rgba(6,182,212,0.2);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}
.kratos-hamburger svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* ========================================================================
   4. LAYOUT QUANTUM & GRIGLIA
   ======================================================================== */
.kratos-quantum-wrapper {
    max-width: 100%;
    width: 99%;
    margin: 0 auto;
    padding: 0 10px 40px 10px;
}
.kratos-hud-header {
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-panel);
    padding-bottom: 10px;
}
.kratos-hud-title {
    font-size: 16px;
    font-weight: 900;
    color: var(--text-light);
    margin: 0;
    text-transform: uppercase;
}
.kratos-hud-title span {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 8px;
}
.matrix-grid-3col {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 15px;
    align-items: start;
}
@media (max-width: 1280px) {
    .matrix-grid-3col {
        grid-template-columns: 1fr;
    }
    .kratos-col-left, 
    .kratos-col-right {
        grid-column: span 1;
    }
}

/* ========================================================================
   5. PANNELLI BASE
   ======================================================================== */
.matrix-col {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.kratos-filter-input {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    flex: 1;
    outline: none;
}
.kratos-filter-input:focus {
    border-color: var(--accent-blue);
}
.kratos-filter-input option {
    background-color: #0b0f19;
    color: #f8fafc;
    padding: 5px;
}

/* ========================================================================
   6. COMPONENTI FINANZIARI
   ======================================================================== */
.val-positive {
    color: var(--accent-green);
    font-family: var(--font-mono);
    font-weight: 700;
}
.val-negative {
    color: var(--accent-red);
    font-family: var(--font-mono);
    font-weight: 700;
}

/* ========================================================================
   7. STATUS BAR E MOBILE TAB BAR
   ======================================================================== */
.q-status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25px;
    background: #05080f;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    font-family: var(--font-mono);
    font-size: 9px;
    color: #64748b;
    z-index: 1000;
}
.q-status-left, 
.q-status-right {
    display: flex;
    gap: 20px;
}
.q-status-bar span b {
    color: #94a3b8;
    font-weight: normal;
}
.q-mobile-tab-bar {
    display: none;
}

@media (max-width: 992px) {
    .q-status-bar {
        display: none;
    }
    body {
        padding-bottom: 70px;
    }
    .q-mobile-tab-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px;
        background: rgba(11, 15, 25, 0.95);
        backdrop-filter: blur(15px);
        border-top: 1px solid rgba(6, 182, 212, 0.2);
        z-index: 9999;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
        justify-content: space-around;
        align-items: center;
    }
    .q-tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: #64748b;
        flex: 1;
        height: 100%;
        transition: all 0.2s ease;
    }
    .q-tab-item svg {
        width: 22px;
        height: 22px;
        stroke: #64748b;
        stroke-width: 2;
        fill: none;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .q-tab-item span {
        font-family: var(--font-mono);
        font-size: 9px;
        font-weight: 800;
        text-transform: uppercase;
    }
    .q-tab-item.active {
        color: var(--accent-blue);
    }
    .q-tab-item.active svg {
        stroke: var(--accent-blue);
        filter: drop-shadow(0 0 5px rgba(6,182,212,0.5));
    }
}

/* ========================================================================
   8. COMPONENTI DI SISTEMA (TOAST E SCROLL)
   ======================================================================== */
#kratos-toast-container {
    position: fixed;
    bottom: 40px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10000;
    pointer-events: none;
}
.kratos-toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    padding: 12px 18px;
    border-radius: 6px;
    border-left: 4px solid var(--accent-blue);
    font-family: var(--font-mono);
    font-size: 11px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 280px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}
.kratos-toast.show {
    transform: translateX(0);
}
.kratos-toast.success {
    border-left-color: var(--accent-green);
}
.kratos-toast.error {
    border-left-color: var(--accent-red);
}
#kratos-back-to-top {
    position: fixed;
    bottom: 40px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(6, 182, 212, 0.2);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    backdrop-filter: blur(5px);
}
#kratos-back-to-top.visible {
    opacity: 1;
    visibility: visible;
    right: 80px;
}
#kratos-back-to-top:hover {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.5);
}

/* ========================================================================
   9. BADGES & HEADER ACTIONS
   ======================================================================== */
.kratos-hud-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.kratos-status-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    border: 1px solid var(--border-panel);
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pulse-node-blue { width: 6px; height: 6px; background-color: var(--accent-blue); border-radius: 50%; box-shadow: 0 0 8px var(--accent-blue); animation: nodePulse 1.5s infinite ease-in-out; }
.pulse-node-green { width: 6px; height: 6px; background-color: var(--accent-green); border-radius: 50%; box-shadow: 0 0 8px var(--accent-green); animation: nodePulse 1.5s infinite ease-in-out; }
.pulse-node-red { width: 6px; height: 6px; background-color: var(--accent-red); border-radius: 50%; box-shadow: 0 0 8px var(--accent-red); opacity: 0.7; }

@keyframes nodePulse {
    0% { transform: scale(0.9); opacity: 0.4; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.4; }
}

/* ========================================================================
   10. COMPONENTI STANDARD (HUD Patrimonio Desktop Base)
   ======================================================================== */

/* GESTIONE VISIBILITÀ INCROCIATA WIDGET */
.mobile-only-kratos { display: none !important; }
.desktop-only-kratos { display: flex; flex-direction: column; gap: 15px; }

.kratos-main-equity {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 900;
    color: var(--text-light);
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    line-height: 1;
    text-shadow: 0 0 12px rgba(248, 250, 252, 0.1);
}

.kratos-glass-card {
    background: linear-gradient(160deg, rgba(15,23,42,0.95) 0%, rgba(5,8,15,0.98) 100%);
    border: 1px solid var(--border-panel);
    border-left: 3px solid var(--theme-color, transparent);
    border-radius: 6px;
    padding: 12px 15px;
    box-shadow: 0 5px 15px -5px rgba(0,0,0,0.5);
}
.kratos-equity-wrapper {
    display: flex;
    flex-direction: column;
}
.kratos-lcd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}
.kratos-lcd-block {
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    background: var(--lcd-bg, rgba(0,0,0,0.2));
    border-color: var(--lcd-border, transparent);
}
.kratos-lcd-lbl {
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--theme-color, var(--text-muted));
}
.kratos-lcd-val {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    color: var(--theme-color, var(--text-light));
}
.kratos-lcd-pct {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 900;
    padding: 2px 4px;
    border-radius: 3px;
    color: var(--theme-color);
    background: var(--lcd-bg);
}
.kratos-micro-strip {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 9px;
    padding: 6px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.03);
}

/* BLINDO ISOLAMENTO DESKTOP: NASCONDE TUTTI GLI ELEMENTI MOBILE */
.kratos-collapse-icon { display: none !important; }
.kratos-widget-summary { display: none !important; }
.mobile-only-kgr { display: none !important; }
.m-lbl, .m-lbl-inline { display: none !important; }
.kratos-mobile-search-btn { display: none !important; }
.kratos-mobile-search-container { display: none !important; }

/* ========================================================================
   11. TITOLI STANDARD DEI WIDGET (Quantum Title Bar)
   ======================================================================== */
.kratos-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}
.kratos-panel-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 1px;
    background: var(--theme-color, var(--accent-blue));
    box-shadow: 0 0 8px var(--theme-color, var(--accent-blue));
}
.kratos-panel-indicator {
    width: 4px;
    height: 12px;
    background: var(--theme-color, var(--accent-blue));
    border-radius: 2px;
    box-shadow: 0 0 6px var(--theme-color, var(--accent-blue));
}
.kratos-panel-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 900;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.kratos-widget-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ========================================================================
   12. WIDGET: MACRO QUAD-CORE EQUALIZER
   ======================================================================== */
.mi-dashboard { display: flex; align-items: center; gap: 20px; }
.mi-ring-wrapper { flex: 0 0 70px; display: flex; flex-direction: column; align-items: center; cursor: help; }
.mi-ring {
    position: relative; width: 64px; height: 64px; border-radius: 50%;
    background: conic-gradient(var(--ring-c) var(--ring-v), rgba(255,255,255,0.05) 0);
    display: flex; align-items: center; justify-content: center; box-shadow: 0 0 15px var(--ring-s);
}
.mi-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: linear-gradient(160deg, #0f172a 0%, #05080f 100%); }
.mi-ring-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.mi-score-val { font-family: var(--font-mono); font-size: 24px; font-weight: 900; color: var(--theme-color); line-height: 1; letter-spacing: -1px; text-shadow: 0 0 10px var(--ring-s); }
.mi-score-lbl { font-family: var(--font-mono); font-size: 9px; font-weight: 900; color: var(--theme-color); margin-top: 8px; letter-spacing: 0.5px; text-align: center; }
.mi-eq-wrap { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.mi-eq-row { display: flex; flex-direction: column; gap: 4px; cursor: help; }
.mi-eq-top { display: flex; justify-content: space-between; align-items: baseline; }
.mi-eq-name { font-family: var(--font-mono); font-size: 8px; font-weight: 800; color: #94a3b8; letter-spacing: 0.5px; }
.mi-eq-val { font-family: var(--font-mono); font-size: 10px; font-weight: 900; color: #fff; }
.mi-eq-status { font-size: 8px; padding-left: 5px; font-weight: 900; }
.mi-eq-track { width: 100%; height: 4px; background: rgba(0,0,0,0.5); border-radius: 2px; overflow: hidden; border: 1px solid rgba(255,255,255,0.02); }
.mi-eq-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease-out; }

/* ========================================================================
   13. WIDGET: STRATEGIC INTEL (Contagiri / Gauges)
   ======================================================================== */
.intel-gauge-container { display: flex; justify-content: space-around; align-items: flex-end; margin: 15px 0; gap: 15px; }
.intel-gauge-box { position: relative; width: 100px; height: 55px; display: flex; flex-direction: column; align-items: center; }
.intel-gauge-core { position: absolute; bottom: 0; left: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; z-index: 3; }
.intel-gauge-val { font-family: var(--font-mono); font-size: 18px; font-weight: 900; line-height: 1; letter-spacing: -0.5px; color: var(--text-light); }
.intel-gauge-lbl { font-family: var(--font-mono); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; opacity: 0.9; margin-top: 2px; }
.intel-perf-row { display: flex; justify-content: space-between; align-items: center; }

/* ========================================================================
   14. WIDGET: MASTER ASSET LEDGER (Desktop Base Styles)
   ======================================================================== */
.w-control-dashboard { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 15px; padding-bottom: 12px; border-bottom: 1px dashed rgba(255,255,255,0.05); }
.w-control-group { display: flex; flex-direction: column; gap: 4px; }
.w-group-lbl { font-family: var(--font-mono); font-size: 8px; color: var(--text-muted); font-weight: 900; text-transform: uppercase; letter-spacing: 1px; }

.w-seg-container { display: flex; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.08); border-radius: 4px; padding: 2px; }
.w-seg-btn { background: transparent; border: none; color: var(--text-muted); font-family: var(--font-mono); font-size: 9px; font-weight: 800; padding: 5px 10px; border-radius: 3px; cursor: pointer; text-transform: uppercase; transition: all 0.2s; }
.w-seg-btn:hover { color: #fff; }
.w-seg-btn.active { background: rgba(6, 182, 212, 0.2); color: var(--accent-blue); box-shadow: 0 0 10px rgba(6, 182, 212, 0.3); }

.w-select-sort, .w-text-search { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.08); color: #fff; font-family: var(--font-mono); font-size: 10px; font-weight: 800; padding: 6px 10px; border-radius: 4px; outline: none; transition: border 0.2s; }
.w-select-sort:focus, .w-text-search:focus { border-color: var(--accent-blue); box-shadow: 0 0 8px rgba(6,182,212,0.3); }
.w-select-sort option { background: #0b0f19; color: #fff; }

.q-global-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); }
.q-global-table th { position: sticky; top: 0; background: rgba(11, 15, 25, 0.98); z-index: 10; font-size: 9px; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,0.1); padding: 10px 8px; font-weight: 800; }
.q-global-table td { padding: 10px 8px; border-bottom: 1px dashed rgba(255,255,255,0.05); font-size: 11px; color: #e2e8f0; vertical-align: middle; white-space: nowrap; }
.q-stream-node-row:hover td { background: rgba(6, 182, 212, 0.05) !important; cursor: pointer; }

.qs-detail-container-row { display: none !important; }
.qs-detail-container-row.open { display: table-row !important; }
.qs-detail-td { padding: 12px 15px !important; background: rgba(2, 4, 9, 0.95) !important; border-bottom: 2px solid rgba(6, 182, 212, 0.2) !important; }
.qs-sub-ledger-wrapper { border-left: 2px solid var(--accent-blue); padding-left: 10px; }
.qs-sub-ledger-table { width: 100%; border-collapse: separate; border-spacing: 0; background: rgba(15, 23, 42, 0.4); border: 1px solid rgba(255,255,255,0.05); border-radius: 6px; overflow: hidden; }
.qs-sub-ledger-table th { background: rgba(0,0,0,0.6) !important; padding: 6px 10px; font-size: 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.qs-sub-ledger-table td { padding: 8px 10px; border-bottom: 1px dashed rgba(255,255,255,0.03) !important; font-size: 10px; }

/* ========================================================================
   15. WIDGET: QUICK SEARCH TERMINAL (Desktop Base)
   ======================================================================== */
.qs-input-cluster { display: flex; align-items: center; background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 4px; padding: 2px; transition: all 0.2s ease; }
.qs-input-cluster:focus-within { border-color: var(--accent-blue); box-shadow: 0 0 10px rgba(6, 182, 212, 0.25); }
.qs-terminal-input { flex: 1; background: transparent; border: none; outline: none; color: var(--text-light); font-family: var(--font-mono); font-size: 11px; padding: 6px 10px; }
.qs-terminal-input::placeholder { color: var(--text-muted); font-size: 10px; }
.qs-terminal-btn { display: flex; align-items: center; gap: 5px; background: rgba(6, 182, 212, 0.15); border: 1px solid rgba(6, 182, 212, 0.3); color: var(--accent-blue); font-family: var(--font-mono); font-size: 10px; font-weight: 900; padding: 5px 10px; border-radius: 3px; cursor: pointer; transition: all 0.2s ease; }
.qs-terminal-btn:hover { background: var(--accent-blue); color: #fff; box-shadow: 0 0 10px rgba(6, 182, 212, 0.4); }

/* ========================================================================
   16. WIDGET: ASSET DETAIL HEADER (Quantum UI FTS 5.0 Base)
   ======================================================================== */
.ah-chassis-card { padding: 12px 18px !important; background: linear-gradient(90deg, rgba(15,23,42,0.95) 0%, rgba(5,8,15,0.98) 100%) !important; }
.ah-mobile-title-bar { display: none !important; }
.ah-chassis-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.ah-info-side { display: flex; flex-direction: column; gap: 6px; }
.ah-ticker-block { display: flex; align-items: baseline; gap: 12px; }
.ah-ticker { font-family: var(--font-mono); font-size: 26px; font-weight: 900; color: #fff; letter-spacing: -0.5px; line-height: 1; margin: 0; }
.ah-name { font-size: 13px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

.ah-badges-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ah-badge { font-family: var(--font-mono); font-size: 9px; font-weight: 800; padding: 3px 8px; border-radius: 4px; display: inline-flex; align-items: center; letter-spacing: 0.5px; text-transform: uppercase; line-height: 1.2; }
.ah-badge-mkt { background: rgba(15, 23, 42, 0.8); border: 1px solid rgba(255, 255, 255, 0.08); color: #cbd5e1; }
.ah-badge-mkt span { color: var(--text-muted); padding-right: 5px; margin-right: 5px; border-right: 1px solid rgba(255, 255, 255, 0.08); }
.ah-badge-type { background: var(--a-theme-bg, rgba(6, 182, 212, 0.15)); color: var(--a-theme-col, var(--accent-blue)); border: 1px solid rgba(255, 255, 255, 0.08); }
.ah-badge-cat { background: rgba(255, 255, 255, 0.03); color: var(--cat-c, var(--text-light)); border: 1px dashed var(--cat-c, var(--border-panel)); }
.ah-badge-tag { background: rgba(6, 182, 212, 0.1); color: var(--accent-blue); border: 1px solid rgba(6, 182, 212, 0.3); }

.ah-goals-block { display: flex; gap: 25px; align-items: center; }
.ah-goal-item { display: flex; flex-direction: column; align-items: flex-end; }
.ah-goal-lbl { font-family: var(--font-mono); font-size: 8px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 3px; font-weight: 800; letter-spacing: 0.5px; display: flex; align-items: center; gap: 3px; }
.ah-goal-val { font-family: var(--font-mono); font-size: 13px; font-weight: 900; }
.ah-btn-fav { background: transparent; border: none; cursor: pointer; transition: transform 0.2s ease; padding: 0; outline: none; display: flex; align-items: center; }
.ah-btn-fav:hover { transform: scale(1.15); }

/* ========================================================================
   17. WIDGET: METRICS & KGR GAUGE (Local KGR)
   ======================================================================== */
.ad-met-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.ad-strat-container { display: flex; gap: 6px; width: 100%; }
.ad-strat-btn { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.05); color: #64748b; font-family: var(--font-mono); font-size: 9px; font-weight: 900; padding: 4px 8px; border-radius: 4px; cursor: pointer; transition: 0.2s; flex: 1; text-align: center; }
.ad-strat-btn.active { border-color: var(--dynamic-color, #06b6d4); color: var(--dynamic-color, #06b6d4); background: var(--dynamic-bg, rgba(6,182,212,0.1)); }

.k-switch-wrapper { display: flex; align-items: center; gap: 5px; }
.k-switch-lbl { font-family: var(--font-mono); font-size: 8px; font-weight: 900; cursor: pointer; letter-spacing: 0.5px; text-transform: uppercase; }
.k-switch { position: relative; display: inline-block; width: 26px; height: 12px; }
.k-switch input { opacity: 0; width: 0; height: 0; }
.k-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 12px; border: 1px solid rgba(255,255,255,0.2); }
.k-slider:before { position: absolute; content: ""; height: 8px; width: 8px; left: 1px; bottom: 1px; background-color: #94a3b8; transition: .4s; border-radius: 50%; }
.k-switch input:checked + .k-slider { background-color: rgba(6, 182, 212, 0.2); border-color: #06b6d4; }
.k-switch input:checked + .k-slider:before { transform: translateX(14px); background-color: #06b6d4; }

.ad-top-metrics { display: flex; align-items: center; gap: 20px; margin-bottom: 15px; }
.kgr-gauge-wrapper { position: relative; width: 100px; height: 50px; overflow: hidden; flex-shrink: 0; }
.kgr-gauge-arc { position: absolute; top: 0; left: 0; width: 100px; height: 100px; border-radius: 50%; background: conic-gradient(from 270deg, #ef4444 0% 20%, #f59e0b 20% 27.5%, #10b981 27.5% 37.5%, #06b6d4 37.5% 50%, transparent 50%); mask: radial-gradient(transparent 38px, black 39px); -webkit-mask: radial-gradient(transparent 38px, black 39px); }
.kgr-gauge-needle { position: absolute; bottom: 0; left: 50%; width: 3px; height: 45px; background: #fff; transform-origin: bottom center; margin-left: -1.5px; border-radius: 3px 3px 0 0; box-shadow: 0 0 5px rgba(0,0,0,0.5); z-index: 2; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.kgr-gauge-pin { position: absolute; bottom: -5px; left: 50%; width: 10px; height: 10px; background: #0f172a; border: 1px solid #06b6d4; border-radius: 50%; margin-left: -5px; z-index: 3; }
.ad-score-container { display: flex; flex-direction: column; justify-content: center; }
.ad-score-big { font-family: var(--font-mono); font-size: 42px; font-weight: 900; line-height: 1; text-shadow: 0 0 15px rgba(0,0,0,0.8); transition: color 0.4s ease; letter-spacing: -1px; }
.ad-score-lbl { font-family: var(--font-mono); font-size: 10px; font-weight: 900; letter-spacing: 1px; margin-top: 4px; transition: color 0.4s ease; text-transform: uppercase; }

.ad-bottom-metrics { display: flex; gap: 15px; border-top: 1px dashed rgba(255,255,255,0.05); padding-top: 15px; align-items: center; }
.ad-eq-wrap { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.ad-eq-row { display: flex; align-items: center; gap: 6px; cursor: help; }
.ad-eq-lbl { font-family: var(--font-mono); font-size: 9px; font-weight: 900; color: #94a3b8; width: 12px; text-align: center; }
.ad-eq-track { flex: 1; height: 5px; background: rgba(0,0,0,0.4); border-radius: 3px; overflow: hidden; border: 1px solid rgba(255,255,255,0.02); }
.ad-eq-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease-out; }
.ad-eq-val { font-family: var(--font-mono); font-size: 9px; font-weight: 900; width: 18px; text-align: right; }

.ad-kgr-legend { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; border-left: 1px dashed rgba(255,255,255,0.1); padding-left: 15px; }
.k-leg-item { display: flex; align-items: center; gap: 6px; }
.k-leg-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.k-leg-txt { font-family: var(--font-mono); font-size: 8px; font-weight: 900; color: #cbd5e1; letter-spacing: 0.5px; }

#k-v4-intel-panel { margin-top: 15px; border-top: 1px dashed rgba(255,255,255,0.05); padding-top: 12px; }
.k-adv-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.k-adv-block { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.03); border-left: 2px solid #06b6d4; padding: 8px 10px; border-radius: 4px; }
.k-adv-title { font-family: var(--font-mono); font-size: 8px; color: #06b6d4; font-weight: 900; margin-bottom: 6px; display: block; letter-spacing: 0.5px; text-transform: uppercase; }
.k-adv-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; border-bottom: 1px dotted rgba(255,255,255,0.02); padding-bottom: 4px; }
.k-adv-row:last-child { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.k-adv-lbl { font-size: 9px; color: #64748b; font-family: var(--font-mono); }
.k-adv-val { font-size: 10px; color: #f8fafc; font-weight: 900; font-family: var(--font-mono); }

/* ========================================================================
   18. WIDGET: ASSET SNIPER CHART (Quantum Flow)
   ======================================================================== */
.adc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.adc-title-container { display: flex; flex-direction: column; }
.adc-subtitle { font-family: var(--font-mono); font-size: 9px; color: var(--text-muted); text-transform: uppercase; }

.adc-tf-container { display: flex; gap: 6px; }
.adc-tf-btn {
    background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.05); color: var(--text-muted);
    font-size: 9px; padding: 5px 12px; cursor: pointer; border-radius: 4px; font-weight: 900;
    font-family: var(--font-mono); transition: 0.2s;
}
.adc-tf-btn:hover { color: #f8fafc; border-color: rgba(255,255,255,0.2); }
.adc-tf-btn.active {
    background: rgba(6,182,212,0.1); color: var(--accent-blue);
    border-color: var(--accent-blue); box-shadow: 0 0 10px rgba(6,182,212,0.2);
}

.sniper-chart-wrapper {
    position: relative;
    height: 400px; /* Altezza ottimizzata Desktop */
    width: 100%;
}

.adc-legend {
    display: flex; 
    flex-direction: row; 
    justify-content: center; 
    gap: 12px; 
    flex-wrap: wrap;
    margin-top: 15px; 
    padding-top: 12px; 
    border-top: 1px dashed rgba(255,255,255,0.05);
}
.adc-leg-pill {
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    color: var(--text-muted); 
    font-size: 9px;
    font-weight: 800; 
    font-family: var(--font-mono); 
    cursor: pointer; 
    padding: 4px 10px;
    border-radius: 4px; 
    background: rgba(0,0,0,0.3); 
    transition: all 0.2s ease; 
    border: 1px solid rgba(255,255,255,0.03);
    width: auto !important; /* Forza larghezza compatta su desktop */
}
.adc-leg-pill:hover { background: rgba(255,255,255,0.05); color: #fff; border-color: rgba(255,255,255,0.1); }
.adc-leg-line { width: 15px; height: 3px; border-radius: 2px; }
.adc-leg-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ========================================================================
   19. WIDGET: ACTIVE LOTS LEDGER
   ======================================================================== */
.adl-header { display: flex; justify-content: flex-end; margin-bottom: 15px; padding-bottom: 12px; border-bottom: 1px dashed rgba(255,255,255,0.05); }
.adl-seg-container { display: flex; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; padding: 2px; }
.adl-seg-btn { background: transparent; border: none; color: var(--text-muted); font-family: var(--font-mono); font-size: 9px; font-weight: 800; padding: 4px 12px; border-radius: 4px; cursor: pointer; text-transform: uppercase; transition: all 0.2s; }
.adl-seg-btn.active { background: rgba(6, 182, 212, 0.2); color: var(--accent-blue); box-shadow: 0 0 10px rgba(6, 182, 212, 0.3); }

.adl-table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); }
.adl-table th { background: rgba(0, 0, 0, 0.5); font-size: 8px; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,0.05); padding: 10px 8px; font-weight: 800; letter-spacing: 1px; white-space: nowrap; }
.adl-table td { padding: 10px 8px; border-bottom: 1px dashed rgba(255,255,255,0.03); font-size: 11px; color: #e2e8f0; vertical-align: middle; white-space: nowrap; }
.adl-row:hover td { background: rgba(59, 130, 246, 0.1); cursor: pointer; }

.adl-type-pac { color: var(--accent-orange); background: rgba(245,158,11,0.1); padding: 2px 5px; border-radius: 3px; font-size: 8px; font-weight: 900; }
.adl-type-single { color: var(--accent-blue); background: rgba(6,182,212,0.1); padding: 2px 5px; border-radius: 3px; font-size: 8px; font-weight: 900; }
.adl-mode-real { color: var(--accent-green); font-weight: 800; font-size: 8px; }
.adl-mode-sim { color: var(--accent-blue); font-weight: 800; font-size: 8px; }
.led-green-blink { width: 8px; height: 8px; background-color: var(--accent-green); border-radius: 50%; box-shadow: 0 0 6px var(--accent-green); animation: ledBlink 1.5s infinite alternate; margin: 0 auto; }
@keyframes ledBlink { 0% { opacity: 0.3; transform: scale(0.9); } 100% { opacity: 1; transform: scale(1.1); } }

.adl-btn-sell-lot { font-family: var(--font-mono); font-size: 8px; font-weight: 900; color: var(--accent-red); background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); padding: 4px 8px; border-radius: 4px; cursor: pointer; transition: all 0.2s; text-transform: uppercase; }
.adl-btn-sell-lot:hover { background: var(--accent-red); color: #fff; box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
.adl-totals-bar { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 12px; margin-top: 12px; font-family: var(--font-mono); font-size: 10px; background: rgba(0,0,0,0.2); padding: 10px 14px; border-radius: 6px; }

/* ========================================================================
   20. RESPONSIVE MOBILE (Smartphone < 768px)
   DEVE CONTENERE TUTTI GLI OVERRIDE MOBILE AL SUO INTERNO!
   ======================================================================== */
@media (max-width: 768px) {
    /* 1. STRUTTURA GLOBALE E MENU */
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    .kratos-quantum-wrapper {
        padding: 0 5px 70px 5px;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .matrix-grid-3col {
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    } 
    .matrix-col {
        gap: 8px;
        min-width: 0;
        width: 100%;
    } 
    
    .kratos-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .kratos-nav-links {
        display: none;
    }
    .kratos-nav-links.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(11, 15, 25, 0.98);
        border-bottom: 2px solid var(--accent-blue);
        padding: 10px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.8);
        z-index: 999999;
    }
    .kratos-nav-links.mobile-open .kratos-nav-item {
        width: 100%;
        justify-content: center;
        padding: 15px;
        font-size: 11px;
    }

    .kratos-user-badge span {
        display: none;
    }
    .kratos-brand {
        font-size: 11px;
    }
    .kratos-logout-btn {
        padding: 4px 6px;
        font-size: 8px;
    }

    /* GESTIONE VISIBILITÀ INCROCIATA WIDGET (OVERRIDE) */
    .mobile-only-kratos { display: block !important; }
    .desktop-only-kratos { display: none !important; }

    /* RICERCA MOBILE IN TOP BAR */
    .kratos-desktop-search-widget {
        display: none !important;
    }
    .kratos-mobile-search-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: rgba(0,0,0,0.3);
        border: 1px solid var(--border-panel);
        color: var(--text-light);
        padding: 6px;
        border-radius: 4px;
        cursor: pointer;
    }
    .kratos-mobile-search-btn svg {
        width: 16px;
        height: 16px;
        stroke: currentColor;
    }
    .kratos-mobile-search-container.active {
        display: block !important;
        position: sticky;
        top: 43px;
        left: 0;
        width: 100%;
        background: rgba(11, 15, 25, 0.98);
        border-bottom: 2px solid var(--accent-blue);
        padding: 8px 10px;
        z-index: 999998;
        box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    }
    .kratos-mobile-search-container form {
        display: flex;
        gap: 6px;
    }
    .kratos-mobile-search-container input {
        flex: 1;
        background: rgba(0,0,0,0.5);
        border: 1px solid rgba(255,255,255,0.1);
        color: #fff;
        padding: 6px 10px;
        border-radius: 4px;
        font-family: var(--font-mono);
        font-size: 11px;
        outline: none;
    }
    .kratos-mobile-search-container button {
        background: rgba(6,182,212,0.2);
        border: 1px solid var(--accent-blue);
        color: var(--accent-blue);
        font-family: var(--font-mono);
        font-weight: 900;
        padding: 0 12px;
        border-radius: 4px;
        font-size: 10px;
        cursor: pointer;
    }

    /* ATTIVAZIONE ELEMENTI COLLASSABILI SU MOBILE */
    .kratos-panel-title {
        cursor: pointer;
        user-select: none;
        align-items: center;
    }
    .kratos-collapse-icon {
        display: inline-block !important;
        font-size: 8px;
        margin-right: 8px;
        color: var(--text-muted);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .kratos-widget-summary {
        display: none;
        align-items: center;
        gap: 6px;
        margin-right: 10px;
        font-family: var(--font-mono);
        font-weight: 900;
    }
    
    .kratos-glass-card.mobile-collapsed .kratos-collapse-icon {
        transform: rotate(-90deg);
    }
    .kratos-glass-card.mobile-collapsed .kratos-collapsible-body {
        display: none !important;
    }
    .kratos-glass-card.mobile-collapsed .kratos-widget-summary {
        display: flex !important;
    }
    .kratos-glass-card.mobile-collapsed .kratos-panel-title {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    .kratos-glass-card.mobile-collapsed .kratos-panel-title::after {
        display: none;
    }
    
    .mobile-only-kgr {
        display: inline-block !important;
    }
    .m-lbl {
        display: inline !important;
        font-size: 7px;
        color: var(--text-muted);
        font-weight: 800;
        text-transform: uppercase;
        margin-right: 2px;
    }
    .m-lbl-inline {
        display: inline-block !important;
        font-size: 7px;
        color: var(--text-muted);
        font-weight: 800;
        margin-right: 3px;
        letter-spacing: 0.5px;
    }

    .kratos-glass-card {
        padding: 8px 10px;
        margin-bottom: 5px !important;
        width: 100%;
        box-sizing: border-box;
    }
    .kratos-panel-title {
        margin-bottom: 4px;
        padding-bottom: 4px;
    }
    .kratos-panel-label {
        font-size: 9px;
        letter-spacing: 0.5px;
    }

    /* WIDGET: LIVE EQUITY */
    .kratos-equity-wrapper {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 0 10px;
        align-items: center;
    }
    .kratos-main-equity {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        font-size: 24px;
        margin-bottom: 2px;
    }
    .kratos-micro-strip {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        background: transparent;
        border: none;
        padding: 0;
        justify-content: flex-start;
    }
    .kratos-micro-strip span {
        font-size: 8px;
    }
    .kratos-lcd-grid {
        grid-column: 2 / 3;
        grid-row: 1 / 3;
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 0;
    }
    .kratos-lcd-block {
        padding: 5px 6px;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 2px 6px;
    }
    .kratos-lcd-lbl {
        width: 100%;
        font-size: 7px;
        margin-bottom: 0;
    }
    .kratos-lcd-val {
        font-size: 11px;
    }
    .kratos-lcd-pct {
        font-size: 8px;
        padding: 2px 4px;
    }

    /* WIDGET: MACRO QUAD-CORE */
    .mi-ring-wrapper {
        display: none;
    }
    .mi-dashboard {
        display: block;
    }
    .mi-eq-track {
        display: none;
    }
    .mi-eq-wrap {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 10px;
    }
    .mi-eq-row {
        padding: 6px;
        background: rgba(0,0,0,0.2);
        border: 1px solid rgba(255,255,255,0.03);
        border-radius: 4px;
    }
    .mi-eq-top {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .mi-eq-name {
        font-size: 8px;
    }
    .mi-eq-val {
        font-size: 11px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    /* WIDGET: STRATEGIC INTEL */
    .intel-gauge-container {
        margin: 10px 0;
        gap: 10px;
    }
    .intel-gauge-box {
        width: 90px;
    }
    .intel-gauge-box svg {
        transform: scale(0.9);
        transform-origin: bottom center;
    }
    .intel-gauge-val {
        font-size: 16px;
    }
    .intel-perf-row {
        margin: 10px 0 0 0;
        padding-bottom: 0;
        border-bottom: none;
    }

    /* WIDGET: PORTFOLIO LEDGER MOBILE CARDS TRANSFORMER */
    .w-control-dashboard {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    .w-seg-container {
        width: 100%;
        justify-content: space-between;
    }
    .w-seg-btn {
        flex: 1;
        text-align: center;
        padding: 5px 0;
        font-size: 8px;
    }
    .w-select-sort, 
    .w-text-search {
        width: 100%;
        font-size: 9px;
        padding: 6px 8px;
    }

    .q-global-table thead {
        display: none !important;
    }
    .w-cluster-tbody {
        display: block;
        margin-bottom: 6px;
        background: rgba(15, 23, 42, 0.4);
        border: 1px solid rgba(255,255,255,0.05);
        border-radius: 6px;
        overflow: hidden;
    }
    
    .q-stream-node-row {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        gap: 4px 8px !important;
        padding: 8px 10px !important;
        align-items: center !important;
    }

    .q-stream-node-row td:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 2; padding: 0 !important; border: none !important; }
    .q-stream-node-row td:nth-child(2) { display: none !important; }
    .q-stream-node-row td:nth-child(3) { grid-column: 2 / 3; grid-row: 1 / 2; text-align: right !important; padding: 0 !important; border: none !important; font-size: 12px !important; }
    .q-stream-node-row td:nth-child(4) { grid-column: 1 / 2; grid-row: 2 / 3; text-align: left !important; padding: 0 !important; border: none !important; font-size: 9px !important; }
    .q-stream-node-row td:nth-child(5) { grid-column: 2 / 3; grid-row: 2 / 3; text-align: right !important; padding: 0 !important; border: none !important; }
    .q-stream-node-row td:nth-child(6) { display: none !important; }
    .q-stream-node-row td:nth-child(7) { display: none !important; } 

    /* SUB-LOTTI MOBILE */
    .qs-detail-container-row.open {
        display: block !important;
        width: 100% !important;
    }
    .qs-detail-td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 6px !important;
    }
    .qs-sub-ledger-wrapper {
        border-left: none !important;
        padding-left: 0 !important;
        width: 100% !important;
    }
    .qs-sub-ledger-table {
        display: block !important;
        width: 100% !important;
        border: none !important;
        background: transparent !important;
    }
    .qs-sub-ledger-table thead {
        display: none !important;
    }
    .qs-sub-ledger-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        width: 100% !important;
    }
    
    .qs-sub-row { 
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 4px 6px !important;
        padding: 8px 10px !important;
        background: rgba(11, 15, 25, 0.8) !important;
        border: 1px solid rgba(255,255,255,0.08) !important;
        border-radius: 5px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .qs-sub-row td {
        display: block !important;
        padding: 0 !important;
        border: none !important;
        white-space: nowrap !important;
    }

    .qs-sub-row td:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 2; font-size: 10px !important; font-weight: 900 !important; color: var(--accent-blue) !important; text-align: left !important; }
    .qs-sub-row td:nth-child(2) { grid-column: 2 / 3; grid-row: 1 / 2; font-size: 9px !important; color: var(--text-muted) !important; text-align: center !important; }
    .qs-sub-row td:nth-child(3) { grid-column: 3 / 4; grid-row: 1 / 2; font-size: 9px !important; font-weight: 800 !important; color: #fff !important; text-align: right !important; }
    .qs-sub-row td:nth-child(4), 
    .qs-sub-row td:nth-child(5) { display: none !important; }
    .qs-sub-row td:nth-child(6) { grid-column: 1 / 2; grid-row: 2 / 3; font-size: 9px !important; color: #cbd5e1 !important; text-align: left !important; }
    .qs-sub-row td:nth-child(7) { grid-column: 2 / 3; grid-row: 2 / 3; font-size: 9px !important; font-weight: 800 !important; text-align: center !important; }
    .qs-sub-row td:nth-child(8) { grid-column: 3 / 4; grid-row: 2 / 3; font-size: 10px !important; font-weight: 900 !important; text-align: right !important; }

    .portfolio-cyber-chassis > div:last-of-type {
        flex-direction: column;
        gap: 10px;
        align-items: stretch !important;
        text-align: center;
    }
    .portfolio-cyber-chassis > div:last-of-type > div {
        justify-content: space-between;
        width: 100%;
    }

    /* ASSET DETAIL HEADER MOBILE OVERRIDE */
    .ah-mobile-title-bar { display: flex !important; }
    .ah-chassis-inner { flex-direction: column; align-items: stretch; gap: 12px; }
    .ah-ticker-block { flex-direction: column; align-items: flex-start; gap: 2px; }
    .ah-ticker { font-size: 20px; }
    .ah-name { font-size: 11px; }
    .ah-goals-block { justify-content: space-between; gap: 10px; width: 100%; border-top: 1px dashed rgba(255,255,255,0.05); padding-top: 8px; }
    .ah-goal-item { align-items: flex-start; }
    .ah-desktop-fav { display: none !important; }

    /* ASSET DETAIL METRICS MOBILE OVERRIDE */
    .ad-top-metrics { flex-direction: row; justify-content: space-between; gap: 10px; }
    .ad-score-big { font-size: 34px; }
    .ad-bottom-metrics { flex-direction: column; align-items: stretch; border-top: none; padding-top: 0; }
    .ad-kgr-legend { border-left: none; padding-left: 0; border-top: 1px dashed rgba(255,255,255,0.05); padding-top: 10px; flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
    .k-leg-item { width: 48%; margin-bottom: 4px; }

    /* ASSET SNIPER CHART MOBILE OVERRIDE */
    .adc-header { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 12px; }
    .adc-tf-container { width: 100%; display: flex; justify-content: space-between; gap: 4px; }
    .adc-tf-btn { flex: 1; text-align: center; padding: 6px 0; }
    .sniper-chart-wrapper { height: 260px; } 
    .adc-legend { gap: 4px; justify-content: center; margin-top: 10px; padding-top: 10px; }
    .adc-leg-pill { width: auto !important; justify-content: center; font-size: 7px; padding: 4px 6px; }

    /* ACTIVE LOTS LEDGER MOBILE OVERRIDE (Ultra-Compact Cards) */
    .adl-header { justify-content: center; }
    .adl-seg-container { width: 100%; display: flex; justify-content: space-between; }
    .adl-seg-btn { flex: 1; text-align: center; }
    .adl-totals-bar { flex-direction: column; gap: 10px; align-items: stretch; text-align: center; }
    .adl-totals-bar > div { justify-content: space-between; }

    .adl-table thead { display: none; }
    .adl-table tbody { display: flex; flex-direction: column; gap: 8px; } /* Gap tra i lotti ridotto */
    
    .adl-row { 
        display: grid !important; 
        grid-template-columns: 1fr 1fr 1fr !important; 
        background: rgba(11, 15, 25, 0.8) !important; 
        border: 1px solid rgba(255,255,255,0.05) !important; 
        border-radius: 6px !important; /* Raggio più piccolo */
        padding: 8px 10px !important;  /* Padding quasi dimezzato */
        gap: 4px 8px !important;       /* Spaziatura griglia ridotta */
    }
    .adl-row td { display: block; padding: 0 !important; border: none !important; text-align: left !important; white-space: normal !important; line-height: 1.2 !important; }
    
    /* 1. Lot ID */
    .adl-row td:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 2; font-size: 11px !important; display: flex; align-items: center; }
    
    /* 2. LED (Nascosto) */
    .adl-row td:nth-child(2) { display: none !important; }
    
    /* 3. Data & Badges */
    .adl-row td:nth-child(3) { grid-column: 2 / 4; grid-row: 1 / 2; display: flex !important; justify-content: flex-end; align-items: center; gap: 6px; }
    .adl-row td:nth-child(3) span:first-child { display: inline-block !important; margin: 0 !important; font-size: 9px !important; }
    .adl-row td:nth-child(3) div { margin: 0 !important; }

    /* 4. Broker */
    .adl-row td:nth-child(4) { grid-column: 1 / 4; grid-row: 2 / 3; color: var(--text-muted) !important; font-size: 9px !important; border-bottom: 1px solid rgba(255,255,255,0.05) !important; padding-bottom: 6px !important; margin-bottom: 2px !important; }

    /* 5, 6, 7. Metriche numeriche */
    .adl-row td:nth-child(5) { grid-column: 1 / 2; grid-row: 3 / 4; font-size: 10px !important; }
    .adl-row td:nth-child(5)::before { content: 'QTY'; color: var(--text-muted); font-size: 7px; display: block; margin-bottom: 1px; }
    
    .adl-row td:nth-child(6) { grid-column: 2 / 3; grid-row: 3 / 4; text-align: center !important; font-size: 10px !important; }
    .adl-row td:nth-child(6)::before { content: 'PRICE'; color: var(--text-muted); font-size: 7px; display: block; margin-bottom: 1px; }
    
    .adl-row td:nth-child(7) { grid-column: 3 / 4; grid-row: 3 / 4; text-align: right !important; font-size: 10px !important; }
    .adl-row td:nth-child(7)::before { content: 'SUNK'; color: var(--text-muted); font-size: 7px; display: block; margin-bottom: 1px; }

    /* 8. Net Profit (Messo Orizzontale per salvare spazio) */
    .adl-row td:nth-child(8) { 
        grid-column: 1 / 3; grid-row: 4 / 5; 
        background: rgba(0,0,0,0.3) !important; 
        border: 1px solid rgba(255,255,255,0.03) !important; 
        padding: 4px 8px !important; border-radius: 4px !important; 
        margin-top: 4px !important; 
        display: flex !important; flex-direction: row !important; align-items: baseline !important; gap: 6px; 
    }
    .adl-row td:nth-child(8) span:first-child { font-size: 11px !important; }
    .adl-row td:nth-child(8) span:last-child { font-size: 8px !important; display: inline-block !important; }

    /* 9. Pulsante Vendi */
    .adl-row td:nth-child(9) { grid-column: 3 / 4; grid-row: 4 / 5; margin-top: 4px !important; display: flex !important; align-items: stretch !important; justify-content: flex-end !important; }
    .adl-row td:nth-child(9) button { width: 100%; font-size: 9px; border-radius: 4px; padding: 0 !important; }
    
    /* ========================================================================
        MACRO INSIGHTS (Mobile Override)
       ======================================================================== */
    .mi-dashboard {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 10px 5px;
    }
    .mi-ring-wrapper {
        display: flex !important; /* Annulla il display: none precedente */
        transform: scale(0.85);
        transform-origin: center top;
        margin-bottom: 5px;
    }
    .mi-eq-wrap {
        width: 100%;
        margin-left: 0;
    }
    /* ======================================================================== */

} /* <-- CHIUSURA DEL BLOCCO MOBILE @media (max-width: 768px) */

/* ========================================================================
   22. WIDGET: LIVE PRICE (Desktop Mini-Gauge)
   ======================================================================== */
.ad-dash-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 15px; }

/* Info Prezzo Lato SX */
.ad-price-val { font-family: var(--font-mono); font-weight: 900; color: #fff; line-height: 1; text-shadow: 0 0 10px rgba(255,255,255,0.1); margin-bottom: 4px; white-space: nowrap; }
.ad-price-eur { font-family: var(--font-mono); font-size: 9px; color: var(--text-muted); margin-bottom: 6px; }
.ad-delta-row { display: flex; align-items: baseline; gap: 6px; }
.ad-delta-val { font-family: var(--font-mono); font-size: 11px; font-weight: 900; }

/* Mini Gauge Lato DX */
.ad-mg-wrapper { display: flex; flex-direction: column; align-items: center; width: 80px; flex-shrink: 0; }
.ad-mg-container { position: relative; width: 80px; height: 40px; overflow: hidden; margin-bottom: 4px; }
.ad-mg-arc {
    position: absolute; top: 0; left: 0; width: 80px; height: 80px; border-radius: 50%;
    background: conic-gradient(from 270deg, #10b981 0%, #f59e0b 25%, #ef4444 50%, transparent 50%);
    -webkit-mask: radial-gradient(transparent 30px, black 31px);
    mask: radial-gradient(transparent 30px, black 31px);
}
.ad-mg-needle {
    position: absolute; bottom: 0; left: 50%; width: 3px; height: 35px; background: #fff;
    transform-origin: bottom center; margin-left: -1.5px; border-radius: 3px 3px 0 0;
    box-shadow: 0 0 5px rgba(0,0,0,0.8); z-index: 2; transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.ad-mg-pin {
    position: absolute; bottom: -5px; left: 50%; width: 10px; height: 10px; background: #0f172a;
    border: 1px solid var(--accent-blue); border-radius: 50%; margin-left: -5px; z-index: 3;
}
.ad-mg-labels { display: flex; justify-content: space-between; width: 100%; font-family: var(--font-mono); font-size: 7px; font-weight: 800; align-items: center; }

/* Bottoni Trade */
.ad-trade-actions { display: grid; gap: 8px; border-top: 1px dashed rgba(255,255,255,0.05); padding-top: 12px; }
.ad-btn-buy { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--accent-green); font-family: var(--font-mono); font-size: 10px; font-weight: 900; padding: 8px 0; border-radius: 4px; cursor: pointer; transition: all 0.2s; }
.ad-btn-buy:hover { background: var(--accent-green); color: #000; box-shadow: 0 0 10px rgba(16, 185, 129, 0.3); }
.ad-btn-sell { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--accent-red); font-family: var(--font-mono); font-size: 10px; font-weight: 900; padding: 8px 0; border-radius: 4px; cursor: pointer; transition: all 0.2s; }
.ad-btn-sell:hover { background: var(--accent-red); color: #fff; box-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }