/* ═════════════════════════════════════════════════════════
   FATHER Optimizer — Admin App + Dashboard Orbital Widget
   ═════════════════════════════════════════════════════════ */

/* ─── Admin Overlay (matches PlatformSecurity / SystemCare / UserManagement) ─── */
.fo-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(6, 10, 19, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: foFadeIn 0.2s ease-out;
}
@keyframes foFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Panel ────────────────────────────────────────────────────────────── */
.fo-panel {
    width: calc(100% - 48px);
    max-width: 1100px;
    height: calc(100vh - 64px);
    max-height: 820px;
    min-width: 360px; min-height: 300px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg, 14px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: foSlideUp 0.25s ease-out;
    position: relative;
    resize: both;
}
@keyframes foSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.fo-panel.fo-closing {
    animation: foSlideDown 0.2s ease-in forwards;
}
@keyframes foSlideDown {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(18px) scale(0.97); }
}

/* ── Header ───────────────────────────────────────────────────────────── */
.fo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-default, #2d3548);
    background: var(--bg-base, #0a0e17);
    flex-shrink: 0;
    cursor: move;
}
.fo-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.fo-header-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--accent-purple-dim, rgba(168, 85, 247, 0.12));
    color: var(--accent-purple, #a855f7);
    font-size: 0.9rem;
}
.fo-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary, #e0e0e0);
    letter-spacing: 0.02em;
    margin: 0;
}
.fo-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.fo-pin-active { color: var(--accent-cyan) !important; }

/* ── Header Buttons ────────────────────────────────────────────────────── */
.fo-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid var(--border-default, #2d3548);
    border-radius: 6px;
    background: var(--bg-base, #0a0e17);
    color: var(--text-secondary, #94a3b8);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}
.fo-header-btn:hover { border-color: var(--accent-purple, #a855f7); color: var(--text-primary, #e0e0e0); }
.fo-close { border: none; background: none; font-size: 1rem; }
.fo-close:hover { color: var(--color-danger, #ef4444) !important; border-color: transparent !important; }

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.fo-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-default, #2d3548);
    background: var(--bg-base, #0a0e17);
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.fo-tabs::-webkit-scrollbar { display: none; }
.fo-tab {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}
.fo-tab:hover { color: var(--text-primary, #e0e0e0); background: rgba(255,255,255,0.04); }
.fo-tab.active {
    color: var(--accent-purple, #a855f7) !important;
    background: var(--accent-purple-dim, rgba(168, 85, 247, 0.12)) !important;
}
.fo-tab i { font-size: 0.72rem; }

/* Content area */
.fo-content {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: var(--space-lg);
    display: flex; flex-direction: column; gap: var(--space-md);
}

/* Cards */
.fo-card {
    background: var(--bg-elevated); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); overflow: hidden;
}
.fo-card-head {
    display: flex; align-items: center; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-xs); font-weight: var(--weight-bold);
    color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}
.fo-card-head i:first-child { color: var(--accent-purple); font-size: 10px; }
.fo-card-body { padding: var(--space-md); }

/* Grid layouts */
.fo-grid { display: grid; gap: 1px; background: var(--border-subtle); }
.fo-grid-3 { grid-template-columns: repeat(3, 1fr); }
.fo-grid-4 { grid-template-columns: repeat(4, 1fr); }
.fo-grid-auto { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

/* Metric cells */
.fo-metric {
    display: flex; flex-direction: column; gap: 2px;
    padding: var(--space-sm) var(--space-md); background: var(--bg-elevated);
}
.fo-metric-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.fo-metric-value {
    font-size: var(--text-md); font-weight: var(--weight-bold);
    font-family: var(--font-mono); color: var(--text-primary);
}
.fo-metric-value.profit { color: var(--color-profit); }
.fo-metric-value.loss { color: var(--color-loss); }
.fo-metric-value.accent { color: var(--accent-purple); }
.fo-metric-hint { font-size: 9px; color: var(--text-muted); }

/* Toggle switch for enable/disable */
.fo-toggle-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-md);
    background: var(--bg-elevated); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}
.fo-toggle-info { display: flex; flex-direction: column; gap: 2px; }
.fo-toggle-title { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary); }
.fo-toggle-desc { font-size: var(--text-xs); color: var(--text-muted); }
.fo-switch {
    position: relative; width: 44px; height: 24px;
    background: var(--bg-deepest); border: 1px solid var(--border-subtle);
    border-radius: 12px; cursor: pointer; transition: all var(--transition-fast);
    flex-shrink: 0;
}
.fo-switch.active { background: var(--color-profit-dim); border-color: var(--color-profit); }
.fo-switch::after {
    content: ''; position: absolute;
    top: 2px; left: 2px; width: 18px; height: 18px;
    border-radius: 50%; background: var(--text-muted);
    transition: all var(--transition-fast);
}
.fo-switch.active::after { left: 22px; background: var(--color-profit); }

/* Status badges */
.fo-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px; border-radius: var(--radius-full);
    font-size: var(--text-xs); font-weight: var(--weight-bold);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.fo-badge-active { background: var(--color-profit-dim); color: var(--color-profit); border: 1px solid var(--color-profit); }
.fo-badge-off { background: var(--color-loss-dim); color: var(--color-loss); border: 1px solid var(--color-loss); }
.fo-badge-idle { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border-subtle); }

/* Progress bars */
.fo-bar-track { flex: 1; height: 6px; background: var(--bg-surface); border-radius: 3px; overflow: hidden; }
.fo-bar-fill { height: 100%; border-radius: 3px; transition: width var(--transition-normal); }
.fo-bar-profit { background: var(--color-profit); }
.fo-bar-loss { background: var(--color-loss); }
.fo-bar-amber { background: var(--accent-amber); }
.fo-bar-purple { background: var(--accent-purple); }

/* Tables */
.fo-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-height: 360px; overflow-y: auto; }
.fo-table { width: 100%; border-collapse: collapse; font-size: var(--text-xs); font-family: var(--font-mono); }
.fo-table th {
    text-align: left; padding: var(--space-xs) var(--space-sm);
    color: var(--text-muted); font-weight: var(--weight-medium);
    border-bottom: 1px solid var(--border-subtle); text-transform: uppercase; font-size: 9px;
    position: sticky; top: 0; background: var(--bg-elevated); z-index: 1;
}
.fo-table td { padding: var(--space-xs) var(--space-sm); color: var(--text-primary); border-bottom: 1px solid var(--border-subtle); }

/* Config form */
.fo-config-field {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}
.fo-config-field:last-child { border-bottom: none; }
.fo-config-label { font-size: var(--text-xs); color: var(--text-secondary); }
.fo-config-hint { font-size: 9px; color: var(--text-muted); }
.fo-config-input {
    width: 100px; padding: 4px 8px; border-radius: var(--radius-sm);
    background: var(--bg-deepest); border: 1px solid var(--border-subtle);
    color: var(--text-primary); font-size: var(--text-xs);
    font-family: var(--font-mono); text-align: right;
}
.fo-config-input:focus { border-color: var(--accent-purple); outline: none; }

/* Actions */
.fo-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.fo-btn {
    display: inline-flex; align-items: center; gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md); border-radius: var(--radius-sm);
    font-size: var(--text-xs); font-weight: var(--weight-medium);
    cursor: pointer; transition: all var(--transition-fast);
    border: 1px solid var(--border-subtle); background: var(--bg-surface);
    color: var(--text-secondary);
}
.fo-btn:hover { border-color: var(--border-default); background: var(--bg-hover); }
.fo-btn-danger:hover { color: var(--color-loss); border-color: var(--color-loss-dim); background: var(--color-loss-dim); }
.fo-btn-primary { border-color: var(--accent-purple-dim); color: var(--accent-purple); }
.fo-btn-primary:hover { background: var(--accent-purple-dim); }

/* Mini card (minimized state — matches other admin app cards: 260px, 12px gap, 36px icon) */
.fo-mini-card {
    position: fixed; bottom: 20px; right: 20px;
    background: var(--bg-surface); border: 1px solid var(--border-default);
    border-radius: 12px; padding: 12px 16px;
    box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 12px;
    width: 260px;
    z-index: 9100; cursor: default;
    transform: translateY(16px) scale(0.95); opacity: 0;
    transition: opacity 0.25s ease-out, transform 0.25s ease-out, border-color 0.3s;
}
.fo-mini-card.fo-mini-visible { transform: translateY(0) scale(1); opacity: 1; }
.fo-mini-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--accent-purple-dim, rgba(168, 85, 247, 0.12));
    color: var(--accent-purple, #a855f7);
    font-size: 1rem;
    flex-shrink: 0;
    cursor: pointer;
}
.fo-mini-info { flex: 1; min-width: 0; cursor: pointer; }
.fo-mini-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    line-height: 1.2;
}
.fo-mini-status {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 2px;
}
.fo-mini-dot-active .fo-mini-status, .fo-mini-status.active { color: var(--color-profit); }
.fo-mini-dot-inactive .fo-mini-status { color: var(--color-loss); }
.fo-mini-actions { display: flex; gap: 4px; flex-shrink: 0; }
.fo-mini-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-default, #2d3548);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
}
.fo-mini-btn:hover { border-color: var(--accent-purple, #a855f7); color: var(--text-primary, #e0e0e0); }
.fo-mini-close:hover { border-color: var(--color-danger, #ef4444); color: var(--color-danger, #ef4444); }

/* Strategy selector pills */
.fo-strat-pills {
    display: flex; gap: var(--space-xs); flex-wrap: wrap;
    padding: var(--space-sm) 0;
}
.fo-strat-pill {
    padding: 4px 12px; border-radius: var(--radius-full);
    font-size: var(--text-xs); font-weight: var(--weight-medium);
    border: 1px solid var(--border-subtle); background: var(--bg-elevated);
    color: var(--text-muted); cursor: pointer; transition: all var(--transition-fast);
    display: flex; align-items: center; gap: var(--space-xs);
}
.fo-strat-pill:hover { border-color: var(--border-default); color: var(--text-secondary); }
.fo-strat-pill.active {
    border-color: var(--accent-purple); background: var(--accent-purple-dim);
    color: var(--accent-purple);
}
.fo-strat-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-muted);
}
.fo-strat-pill.active .fo-strat-dot { background: var(--color-profit); }

/* Impact bars (analysis tab) */
.fo-impact-row { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) 0; }
.fo-impact-key { font-size: 10px; color: var(--text-muted); text-transform: uppercase; width: 120px; flex-shrink: 0; text-align: right; }
.fo-impact-bar-wrap { flex: 1; height: 5px; background: var(--bg-surface); border-radius: 3px; overflow: hidden; }
.fo-impact-bar { height: 100%; border-radius: 3px; }
.fo-impact-val { font-size: var(--text-xs); font-family: var(--font-mono); width: 50px; text-align: right; }

/* Pattern rows */
.fo-pattern-row { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border-subtle); }
.fo-pattern-row:last-child { border-bottom: none; }
.fo-pattern-name { font-size: var(--text-xs); color: var(--text-secondary); min-width: 120px; word-break: break-all; }
.fo-pattern-stats { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--text-xs); font-family: var(--font-mono); flex: 1; }
.fo-rec { padding: 1px 6px; border-radius: var(--radius-sm); font-size: 9px; font-weight: var(--weight-bold); }
.fo-rec-go { background: var(--color-profit-dim); color: var(--color-profit); }
.fo-rec-caution { background: var(--color-warning-dim); color: var(--accent-amber); }
.fo-rec-stop { background: var(--color-loss-dim); color: var(--color-loss); }

/* ═════════════════════════════════════════════════════════
   DASHBOARD — FATHER Orbital Widget
   ═════════════════════════════════════════════════════════ */

.father-orbit-container {
    position: relative;
    width: 100%;
    min-height: 340px;
    height: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-deepest);
    border: 1px solid var(--border-subtle);
}

/* Sky */
.fo-sky {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 50% 120%, rgba(168,85,247,0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(99,102,241,0.04) 0%, transparent 50%),
        var(--bg-deepest);
    overflow: hidden;
}

/* Stars (reuse luna pattern) */
.fo-star {
    position: absolute; width: 2px; height: 2px;
    border-radius: 50%; background: rgba(200,210,230,0.5);
    animation: luna-twinkle 3s ease-in-out infinite alternate;
}

/* Core brain */
.fo-brain-wrap {
    position: absolute; top: 42%; left: 50%;
    width: 92px; height: 92px;
    margin-left: -46px; margin-top: -46px;
    z-index: 2;
}
.fo-brain {
    width: 92px; height: 92px; border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, rgba(192,132,252,0.25) 0%, transparent 50%),
        radial-gradient(circle at 70% 65%, rgba(99,102,241,0.15) 0%, transparent 45%),
        radial-gradient(circle at 35% 35%,
            rgba(168,85,247,0.3) 0%, rgba(99,102,241,0.2) 40%, rgba(30,41,59,0.9) 100%);
    box-shadow:
        0 0 30px rgba(168,85,247,0.25),
        0 0 60px rgba(99,102,241,0.12),
        0 0 2px 1px rgba(168,85,247,0.15),
        inset 0 0 20px rgba(168,85,247,0.08),
        inset -6px -4px 12px rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: rgba(192,132,252,0.9);
    animation: fo-brain-float 5s ease-in-out infinite;
    transition: box-shadow 0.6s ease, color 0.6s ease;
    position: relative;
    overflow: hidden;
}
/* Inner neural shimmer layer */
.fo-brain::before {
    content: '';
    position: absolute; inset: 0; border-radius: 50%;
    background:
        radial-gradient(ellipse 40% 30% at 25% 40%, rgba(192,132,252,0.12) 0%, transparent 100%),
        radial-gradient(ellipse 30% 40% at 65% 55%, rgba(99,102,241,0.1) 0%, transparent 100%);
    animation: fo-brain-shimmer 4s ease-in-out infinite alternate;
    pointer-events: none;
}
/* Outer rim highlight */
.fo-brain::after {
    content: '';
    position: absolute; inset: 0; border-radius: 50%;
    border: 1px solid rgba(192,132,252,0.12);
    box-shadow: inset 0 0 6px rgba(192,132,252,0.06);
    pointer-events: none;
}
/* FA icon depth: text shadow for production glow */
.fo-brain > i {
    position: relative; z-index: 1;
    filter: drop-shadow(0 0 6px rgba(168,85,247,0.5)) drop-shadow(0 0 12px rgba(99,102,241,0.25));
    transition: filter 0.6s ease;
}
@keyframes fo-brain-shimmer {
    0%   { opacity: 0.5; transform: rotate(0deg); }
    100% { opacity: 1; transform: rotate(8deg); }
}
@keyframes fo-brain-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.fo-brain.glow-profit {
    box-shadow: 0 0 30px rgba(16,185,129,0.4), 0 0 60px rgba(16,185,129,0.15), inset -6px -4px 12px rgba(0,0,0,0.4);
}
.fo-brain.glow-loss {
    box-shadow: 0 0 30px rgba(239,68,68,0.4), 0 0 60px rgba(239,68,68,0.15), inset -6px -4px 12px rgba(0,0,0,0.4);
}
/* Absorption complete — bright flash when data orbs reach brain */
.fo-brain.fo-absorb-flash {
    box-shadow:
        0 0 40px rgba(168,85,247,0.6),
        0 0 80px rgba(99,102,241,0.3),
        inset -6px -4px 12px rgba(0,0,0,0.4);
    animation: fo-brain-flash 0.6s ease-out;
}
/* Signal emission glow — when sending cross-widget projectile */
.fo-brain.fo-signal-emit {
    box-shadow:
        0 0 50px rgba(168,85,247,0.7),
        0 0 100px rgba(99,102,241,0.35),
        inset -6px -4px 12px rgba(0,0,0,0.4);
    animation: fo-brain-emit 1.0s ease-out;
}
@keyframes fo-brain-flash {
    0%   { filter: brightness(1); }
    30%  { filter: brightness(1.8); }
    100% { filter: brightness(1); }
}
@keyframes fo-brain-emit {
    0%   { filter: brightness(1); }
    15%  { filter: brightness(1.6); }
    50%  { filter: brightness(1.2); }
    100% { filter: brightness(1); }
}

/* Orbit ring — sized to match orbital dot radius (82px from center) */
.fo-orbit-ring {
    position: absolute; top: 42%; left: 50%;
    width: 170px; height: 170px;
    margin-left: -85px; margin-top: -85px;
    border: 1px solid rgba(168,85,247,0.12);
    border-radius: 50%;
    pointer-events: none;
}

/* Strategy orbital dots — 170px matches 82px radius + 28px dot overflow */
.fo-orbit-dots {
    position: absolute; top: 42%; left: 50%;
    width: 200px; height: 200px;
    margin-left: -100px; margin-top: -100px;
    animation: fo-orbit-spin 45s linear infinite;
}
@keyframes fo-orbit-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fo-orbit-dot {
    position: absolute;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--border-subtle);
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    /* Counter-rotate so text stays upright */
    animation: fo-counter-spin 45s linear infinite;
    z-index: 3;
}
@keyframes fo-counter-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(-360deg); }
}
.fo-orbit-dot:hover { transform: rotate(0deg) scale(1.15); border-color: var(--accent-purple); }
.fo-orbit-dot.active {
    border-color: var(--accent-purple);
    background: var(--accent-purple-dim);
    color: var(--accent-purple);
    box-shadow: 0 0 12px rgba(168,85,247,0.3);
}
.fo-orbit-dot.healthy { border-color: var(--color-profit); }
.fo-orbit-dot.warning { border-color: var(--accent-amber); }
.fo-orbit-dot.unhealthy { border-color: var(--color-loss); }

/* Pulse ring */
.fo-pulse-ring {
    position: absolute; top: 42%; left: 50%;
    width: 80px; height: 80px;
    margin-left: -40px; margin-top: -40px;
    border-radius: 50%;
    border: 2px solid transparent;
    pointer-events: none; opacity: 0;
}
.fo-pulse-ring.pulse-active {
    border-color: var(--accent-purple);
    animation: fo-pulse 1.2s ease-out forwards;
}
@keyframes fo-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* HUD (bottom metrics) */
.fo-hud {
    position: absolute;
    bottom: 12px; left: 16px; right: 16px;
    display: flex; justify-content: space-between;
    align-items: flex-end; pointer-events: none; opacity: 0.9;
    z-index: 4;
}
.fo-hud-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.fo-hud-label {
    font-size: 0.55rem; font-weight: 500;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
}
.fo-hud-value {
    font-size: 0.78rem; font-weight: 700;
    color: var(--text-primary); font-family: var(--font-mono);
}
.fo-hud-value.profit { color: var(--color-profit); }
.fo-hud-value.loss { color: var(--color-loss); }

/* Toast */
.fo-toast {
    position: absolute; top: 12px; left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 4px 14px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 600;
    color: #fff; opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none; white-space: nowrap;
    z-index: 5;
}
.fo-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.fo-toast.tune { background: rgba(168,85,247,0.85); }
.fo-toast.profit { background: rgba(16,185,129,0.85); }
.fo-toast.loss { background: rgba(239,68,68,0.85); }
.fo-toast.info { background: rgba(99,102,241,0.85); }

/* Title badge */
.fo-title-badge {
    position: absolute; top: 10px; left: 14px;
    display: flex; align-items: center; gap: 6px;
    font-size: 0.6rem; font-weight: 600;
    color: var(--accent-purple); opacity: 0.7;
    pointer-events: none; z-index: 4;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.fo-title-badge i { font-size: 9px; }

/* Secondary orbit ring (inner) */
.fo-orbit-ring-inner {
    position: absolute; top: 42%; left: 50%;
    width: 110px; height: 110px;
    margin-left: -55px; margin-top: -55px;
    border: 1px dashed rgba(168,85,247,0.07);
    border-radius: 50%;
    pointer-events: none;
    animation: fo-orbit-spin 120s linear infinite reverse;
}

/* Nebula particles */
.fo-nebula {
    position: absolute; border-radius: 50%;
    pointer-events: none; filter: blur(20px);
    animation: fo-nebula-drift 20s ease-in-out infinite alternate;
}
.fo-nebula-1 {
    width: 80px; height: 80px; top: 15%; left: 10%;
    background: radial-gradient(circle, rgba(168,85,247,0.08) 0%, transparent 70%);
}
.fo-nebula-2 {
    width: 60px; height: 60px; bottom: 20%; right: 8%;
    background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
    animation-delay: -8s;
}
.fo-nebula-3 {
    width: 50px; height: 50px; top: 50%; left: 65%;
    background: radial-gradient(circle, rgba(168,85,247,0.05) 0%, transparent 70%);
    animation-delay: -14s;
}
@keyframes fo-nebula-drift {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(8px, -6px) scale(1.15); }
    100% { transform: translate(-5px, 4px) scale(0.9); }
}

/* Signal strength bars */
.fo-signal-bars {
    position: absolute; top: 10px; right: 14px;
    display: flex; align-items: flex-end; gap: 2px;
    height: 16px; pointer-events: none; z-index: 4;
    opacity: 0.7;
}
.fo-signal-bar {
    width: 3px; border-radius: 1px;
    background: var(--text-muted);
    transition: background 0.4s, height 0.4s;
}
.fo-signal-bar:nth-child(1) { height: 4px; }
.fo-signal-bar:nth-child(2) { height: 7px; }
.fo-signal-bar:nth-child(3) { height: 10px; }
.fo-signal-bar:nth-child(4) { height: 14px; }
.fo-signal-bars.signal-strong .fo-signal-bar { background: var(--color-profit); }
.fo-signal-bars.signal-medium .fo-signal-bar:nth-child(4) { background: var(--text-muted); }
.fo-signal-bars.signal-medium .fo-signal-bar:nth-child(-n+3) { background: var(--accent-amber); }
.fo-signal-bars.signal-weak .fo-signal-bar:nth-child(n+3) { background: var(--text-muted); }
.fo-signal-bars.signal-weak .fo-signal-bar:nth-child(-n+2) { background: var(--color-loss); }
.fo-signal-bars.signal-off .fo-signal-bar { background: var(--text-muted); opacity: 0.3; }

/* Idle — text label only (brain is already visible) */
.fo-idle-msg {
    position: absolute;
    left: 0; right: 0;
    top: calc(42% + 52px); /* below the brain center */
    display: flex;
    align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.45;
    z-index: 4;
    pointer-events: none;
}

/* ─── Recommendation Cards (Analysis tab) ─── */
.fo-rec-card {
    background: var(--bg-base);
    border-radius: var(--radius-sm, 6px);
    padding: 8px 10px;
    display: flex; flex-direction: column; gap: 5px;
    transition: border-color 0.2s;
}
.fo-rec-card:hover { background: var(--bg-surface-hover, rgba(255,255,255,0.03)); }
.fo-rec-card-head {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.78rem;
}
.fo-rec-priority {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 9px; font-weight: 700;
    padding: 2px 6px; border-radius: 3px;
    text-transform: uppercase; letter-spacing: 0.3px;
    flex-shrink: 0;
}
.fo-rec-param {
    font-weight: 600; color: var(--text-primary);
    font-size: 0.78rem;
}
.fo-rec-card-vals {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.72rem; font-family: var(--font-mono);
}
.fo-rec-val-old {
    color: var(--text-muted); text-decoration: line-through;
    opacity: 0.7;
}
.fo-rec-val-new {
    color: var(--accent-cyan); font-weight: 600;
}
.fo-rec-impact {
    font-size: 9px; color: var(--text-muted);
    margin-left: auto; font-style: italic;
}
.fo-rec-card-reason {
    font-size: 0.72rem; color: var(--text-secondary);
    line-height: 1.4; padding-left: 2px;
}
.fo-rec-card-meta {
    display: flex; align-items: center; gap: 8px;
    margin-top: 2px;
}
.fo-gap-pill {
    font-size: 8px; font-weight: 600;
    padding: 1px 6px; border-radius: 8px;
    text-transform: capitalize;
    background: var(--accent-purple-dim, rgba(168,85,247,0.12));
    color: var(--accent-purple, #a855f7);
    letter-spacing: 0.3px;
}

/* ─── Best Performer Card (Overview tab) ─── */
.fo-best-performer-card {
    border: 1px solid rgba(234,179,8,0.2) !important;
    background: linear-gradient(135deg, rgba(234,179,8,0.04), transparent) !important;
}
.fo-best-trophy {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(234,179,8,0.15), rgba(234,179,8,0.05));
    color: #eab308; font-size: 1rem;
    animation: fo-trophy-pulse 2s ease-in-out infinite;
}
@keyframes fo-trophy-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234,179,8,0.2); }
    50% { transform: scale(1.05); box-shadow: 0 0 12px 4px rgba(234,179,8,0.15); }
}

/* ─── Best Performer Crown on Orbital Dot ─── */
.fo-orbit-dot.fo-best {
    border-color: #eab308 !important;
    box-shadow: 0 0 8px rgba(234,179,8,0.4), 0 0 20px rgba(234,179,8,0.15);
    animation: fo-best-glow 2s ease-in-out infinite;
}
.fo-crown-icon {
    position: absolute; top: -8px; left: 50%;
    transform: translateX(-50%);
    font-size: 8px; color: #eab308;
    filter: drop-shadow(0 0 3px rgba(234,179,8,0.6));
    animation: fo-crown-bob 1.5s ease-in-out infinite;
}
@keyframes fo-best-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(234,179,8,0.4), 0 0 20px rgba(234,179,8,0.15); }
    50% { box-shadow: 0 0 12px rgba(234,179,8,0.6), 0 0 28px rgba(234,179,8,0.25); }
}
@keyframes fo-crown-bob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-2px); }
}

/* ═════════════════════════════════════════════════════════════
   FATHER Orbital Widget — Enhanced Visual System
   Data particles, scan line, brain aura, magnetic absorption
   ═════════════════════════════════════════════════════════════ */

/* ── Data Particles (ambient floating data around brain) ── */
.fo-data-particles {
    position: absolute; top: 42%; left: 50%;
    width: 180px; height: 180px;
    margin-left: -90px; margin-top: -90px;
    pointer-events: none; z-index: 2;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.fo-data-particles.fo-particles-active {
    opacity: 1;
}
.fo-data-particle {
    position: absolute;
    width: var(--size, 2px); height: var(--size, 2px);
    border-radius: 50%;
    background: var(--color, #a855f7);
    box-shadow: 0 0 4px var(--color, #a855f7);
    opacity: 0;
    animation: fo-particle-orbit var(--dur, 5s) linear infinite;
    animation-delay: var(--delay, 0s);
}
@keyframes fo-particle-orbit {
    0% {
        transform: rotate(var(--angle, 0deg)) translateX(var(--orbit-r, 60px)) rotate(calc(-1 * var(--angle, 0deg)));
        opacity: 0.1;
    }
    10% { opacity: 0.65; }
    50% {
        transform: rotate(calc(var(--angle, 0deg) + 180deg)) translateX(calc(var(--orbit-r, 60px) - 5px)) rotate(calc(-1 * (var(--angle, 0deg) + 180deg)));
        opacity: 0.5;
    }
    90% { opacity: 0.65; }
    100% {
        transform: rotate(calc(var(--angle, 0deg) + 360deg)) translateX(var(--orbit-r, 60px)) rotate(calc(-1 * (var(--angle, 0deg) + 360deg)));
        opacity: 0.1;
    }
}

/* ── Scan Line (radar sweep showing analysis) ── */
.fo-scan-line {
    position: absolute; top: 42%; left: 50%;
    width: 180px; height: 180px;
    margin-left: -90px; margin-top: -90px;
    border-radius: 50%;
    pointer-events: none; z-index: 1;
    opacity: 0;
    overflow: hidden;
}
.fo-scan-line.fo-scanning {
    opacity: 1;
}
.fo-scan-line::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 50%; height: 2px;
    transform-origin: left center;
    background: linear-gradient(to right, rgba(168,85,247,0.4), transparent);
    animation: fo-scan-sweep 7s linear infinite;
}
@keyframes fo-scan-sweep {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Scan line fade trail */
.fo-scan-line::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(168,85,247,0.06) 30deg,
        transparent 60deg
    );
    animation: fo-scan-sweep 7s linear infinite;
}

/* ── Brain Aura (pulses on new observations) ── */
.fo-brain-aura {
    position: absolute; inset: -8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    border: 1px solid rgba(168,85,247,0.2);
}
.fo-brain-aura.fo-aura-pulse {
    animation: fo-aura-expand 1.4s ease-out forwards;
}
@keyframes fo-aura-expand {
    0%   { transform: scale(0.8); opacity: 0.8; border-color: rgba(168,85,247,0.5); box-shadow: 0 0 15px rgba(168,85,247,0.3); }
    50%  { opacity: 0.4; }
    100% { transform: scale(2.0); opacity: 0; border-color: rgba(99,102,241,0.1); box-shadow: none; }
}

/* ── Magnetic Absorption Layer ── */
.fo-absorb-layer {
    position: absolute; inset: 0;
    pointer-events: none; z-index: 6;
    overflow: hidden;
}

/* Data orbs that fly into brain center */
.fo-absorb-orb {
    position: absolute;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--orb-color, #a855f7);
    box-shadow: 0 0 6px var(--orb-color, #a855f7), 0 0 12px var(--orb-color, #a855f720);
    animation: fo-absorb-fly 1.0s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 6;
}
/* Importance-based sizing */
.fo-absorb-critical { width: 8px; height: 8px; }
.fo-absorb-high { width: 7px; height: 7px; }
.fo-absorb-medium { width: 5px; height: 5px; }
.fo-absorb-low { width: 4px; height: 4px; }
.fo-absorb-info { width: 3px; height: 3px; }

/* Trail behind absorb orb */
.fo-absorb-orb::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 20px; height: 2px;
    transform: translateY(-50%);
    background: linear-gradient(to left, var(--orb-color, #a855f7), transparent);
    border-radius: 2px;
    opacity: 0.5;
}

@keyframes fo-absorb-fly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    70% {
        transform: translate(var(--target-x, 0), var(--target-y, 0)) scale(0.8);
        opacity: 0.9;
    }
    90% {
        transform: translate(var(--target-x, 0), var(--target-y, 0)) scale(1.5);
        opacity: 0.5;
    }
    100% {
        transform: translate(var(--target-x, 0), var(--target-y, 0)) scale(0);
        opacity: 0;
    }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .fo-panel {
        width: calc(100% - 16px);
        height: calc(100vh - 24px);
        max-height: none;
        border-radius: 10px;
    }
    .fo-content { padding: var(--space-md); gap: var(--space-sm); }
    .fo-header { padding: 8px 12px; }
    .fo-header h2 { font-size: 0.85rem; }
    .fo-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .fo-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .fo-grid-auto { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .fo-tabs { gap: 1px; }
    .fo-tab { padding: 5px 8px; font-size: 0.72rem; }
    .father-orbit-container { min-height: 260px; }
    .fo-brain-wrap { width: 68px; height: 68px; margin-left: -34px; margin-top: -34px; }
    .fo-brain { width: 68px; height: 68px; font-size: 20px; }
    .fo-orbit-ring { width: 150px; height: 150px; margin-left: -75px; margin-top: -75px; }
    .fo-orbit-ring-inner { width: 85px; height: 85px; margin-left: -42px; margin-top: -42px; }
    .fo-orbit-dots { width: 150px; height: 150px; margin-left: -75px; margin-top: -75px; }
    .fo-orbit-dot { width: 24px; height: 24px; font-size: 8px; }
    .fo-pulse-ring { width: 68px; height: 68px; margin-left: -34px; margin-top: -34px; }
    .fo-mini-card { right: 10px; width: 220px; }
    .fo-signal-bars { display: none; }
}
