/* TIER-1 FINTECH PREMIUM AESTHETIC - THE "WOW" UPDATE */
:root {
    /* Deep space HSL tailored palette */
    --bg-main: #060B14;
    --bg-glass: rgba(13, 22, 39, 0.65); /* Elegant dark glass */
    --bg-glass-hover: rgba(19, 32, 57, 0.85);
    
    --border-light: rgba(255, 255, 255, 0.08); /* Frosted edges */
    --border-glow: rgba(59, 130, 246, 0.4);
    
    --text-main: #FFFFFF;
    --text-muted: #8E9BAE;
    
    /* Vibrant gradients for Premium Feel */
    --grad-primary: linear-gradient(135deg, #00C6FF 0%, #0072FF 100%);
    --grad-hover: linear-gradient(135deg, #00b4e6 0%, #0061d9 100%);
    --grad-success: linear-gradient(135deg, #11998E 0%, #38EF7D 100%);
    --grad-danger: linear-gradient(135deg, #FF416C 0%, #FF4B2B 100%);
    
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.15);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 15px rgba(0, 114, 255, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: radial-gradient(circle at top center, #10192b 0%, var(--bg-main) 80%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* TOP NAVIGATION */
.top-nav {
    width: 100%;
    background: rgba(6, 11, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 75px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}
.nav-brand {
    display: flex; align-items: center; gap: 0.8rem;
    font-size: 1.3rem; font-weight: 700; letter-spacing: -0.5px;
}
.brand-icon {
    color: #00C6FF;
    filter: drop-shadow(0 0 8px rgba(0, 198, 255, 0.6));
}
.badge {
    background: var(--grad-primary);
    color: white; font-size: 0.7rem; padding: 3px 8px; border-radius: 6px;
    text-transform: uppercase; font-weight: 800; vertical-align: middle; margin-left: 6px;
    box-shadow: 0 2px 10px rgba(0, 114, 255, 0.3);
    letter-spacing: 0.5px;
}
.nav-actions { display: flex; align-items: center; height: 100%; }

/* MAIN CONTAINER */
.container {
    max-width: 1150px; width: 100%; padding: 3rem 1.5rem;
    display: flex; flex-direction: column; gap: 2.5rem;
}

h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.4rem; letter-spacing: -0.5px; }
h3 { font-size: 1.15rem; font-weight: 600; }
.text-muted { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; }

/* BUTTONS */
.btn {
    font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.95rem;
    padding: 0.7rem 1.4rem; border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; outline: none;
}
.btn-primary {
    background: var(--grad-primary);
    color: white; border: none;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}
.btn-secondary {
    background: var(--bg-glass); border-color: var(--border-light); color: var(--text-main);
    backdrop-filter: blur(4px);
}
.btn-secondary:hover { background: var(--bg-glass-hover); border-color: #00C6FF; }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 0.6rem 1rem;}
.btn-ghost:hover { color: var(--text-main); background: rgba(255,255,255,0.05); }
.btn-danger-outline { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger-outline:hover { background: var(--grad-danger); border-color: transparent; color: white; box-shadow: 0 4px 15px rgba(255, 65, 108, 0.4);}

/* INPUTS */
.input-group { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.2rem; flex: 1; }
label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;}
input {
    background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); padding: 0.85rem 1rem;
    color: var(--text-main); font-family: 'Inter', sans-serif; font-size: 1rem;
    transition: all 0.3s ease; width: 100%; box-sizing: border-box;
}
input:focus {
    border-color: #00C6FF; background: rgba(0, 198, 255, 0.05);
    box-shadow: 0 0 12px rgba(0, 114, 255, 0.2); outline: none;
}

/* DASHBOARD CARDS */
.targets-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.8rem; align-items: stretch;
}
.target-card {
    background: var(--bg-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 1.8rem;
    display: flex; flex-direction: column; justify-content: flex-start; gap: 1.2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: pointer;
    height: 100%; box-shadow: var(--shadow-glass); position: relative; overflow: hidden;
}
.target-card::before { /* Subtle sweeping gradient */
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: var(--grad-primary); opacity: 0; transition: opacity 0.3s ease;
}
.target-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 198, 255, 0.4);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), var(--shadow-glow);
}
.target-card:hover::before { opacity: 1; }
.target-card h3 { color: var(--text-main); font-size: 1.35rem; }

.card-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem;
    font-size: 0.95rem; margin-top: auto;
}
.stat-box { display: flex; flex-direction: column; gap: 0.2rem;}
.stat-box span.label { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px;}
.stat-box span.value { font-weight: 700; color: #fff; }

/* PROGRESS BAR */
.progress-container { width: 100%; height: 6px; background: rgba(0,0,0,0.5); border-radius: 3px; overflow: hidden; margin-top: auto; border: 1px solid var(--border-light);}
.progress-fill { height: 100%; background: var(--grad-primary); width: 0%; transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1); position: relative; }
/* Animated shine on progress */
.progress-fill::after {
    content: ''; position: absolute; top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    animation: shimmer 2s infinite; transform: skewX(-20deg);
}
@keyframes shimmer { 0% { transform: translateX(-100%) skewX(-20deg); } 100% { transform: translateX(200%) skewX(-20deg); } }

/* MARKET INTELLIGENCE WIDGETS */
.intel-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.8rem;
}
.widget-panel {
    background: var(--bg-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light); border-radius: var(--radius-md);
    display: flex; flex-direction: column; height: 500px;
    box-shadow: var(--shadow-glass); overflow: hidden;
}
.widget-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border-light); background: rgba(0,0,0,0.2);
}
.live-indicator {
    font-size: 0.65rem; color: #38EF7D; border: 1px solid #38EF7D;
    padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 800;
    background: rgba(56, 239, 125, 0.1); letter-spacing: 1px;
    animation: pulse 2s infinite; box-shadow: 0 0 10px rgba(56, 239, 125, 0.2);
}
@keyframes pulse { 0% { opacity: 1; box-shadow: 0 0 10px rgba(56, 239, 125, 0.2); } 50% { opacity: 0.5; box-shadow: 0 0 0px rgba(56, 239, 125, 0); } 100% { opacity: 1; box-shadow: 0 0 10px rgba(56, 239, 125, 0.2); } }

.widget-body {
    padding: 1rem; overflow-y: auto; flex: 1;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.widget-body::-webkit-scrollbar { width: 6px; }
.widget-body::-webkit-scrollbar-track { background: transparent; }
.widget-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

/* AI Sentiment Widget */
.ai-grid { display: flex; flex-direction: column; gap: 0.8rem; }
.ai-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.8rem 1rem; background: rgba(0,0,0,0.3); border-radius: var(--radius-sm);
    border: 1px solid var(--border-light); cursor: pointer; transition: all 0.3s ease;
}
.ai-row:hover {
    border-color: #00C6FF; background: rgba(0, 198, 255, 0.05); transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.15);
}
.ai-asset { display: flex; flex-direction: column; }
.ai-asset strong { font-size: 1rem; font-weight: 700;}
.ai-asset small { font-size: 0.75rem; color: var(--text-muted); font-weight: 500;}
.ai-signal {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; padding: 0.3rem 0.6rem; border-radius: 4px; letter-spacing: 0.5px;
}
.signal-buy, .signal-strong_buy { color: #38EF7D; background: rgba(56, 239, 125, 0.1); border: 1px solid rgba(56, 239, 125, 0.3); }
.signal-sell, .signal-strong_sell { color: #FF416C; background: rgba(255, 65, 108, 0.1); border: 1px solid rgba(255, 65, 108, 0.3); }
.signal-neutral { color: var(--text-muted); background: rgba(0,0,0,0.5); border: 1px solid var(--border-light); }

/* Movers Widget */
.widget-tabs { display: flex; gap: 0.5rem; background: rgba(0,0,0,0.4); padding: 4px; border-radius: var(--radius-sm);}
.widget-tab {
    background: transparent; border: none; color: var(--text-muted); font-size: 0.75rem; font-weight: 600;
    cursor: pointer; padding: 0.4rem 0.8rem; border-radius: 4px; transition: all 0.2s;
}
.widget-tab.active { background: var(--grad-primary); color: white; box-shadow: 0 2px 8px rgba(0, 114, 255, 0.3); }
.mover-item {
    display: flex; justify-content: space-between; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border-light);
    align-items: center; cursor: pointer; transition: all 0.3s ease; border-radius: var(--radius-sm); margin-bottom: 0.2rem;
}
.mover-item:hover { background: rgba(255,255,255,0.05); transform: translateX(4px); border-bottom-color: transparent;}
.mover-item:last-child { border-bottom: none; }
.mover-asset { display: flex; flex-direction: column; }
.mover-asset strong { font-size: 1rem; font-weight: 700;}
.mover-vol { color: var(--text-muted); font-size: 0.75rem; }
.mover-stat { display: flex; flex-direction: column; align-items: flex-end; }
.mover-price { font-size: 0.9rem; font-weight: 600;}
.mover-green { color: #38EF7D; font-weight: 700; font-size: 0.85rem; }
.mover-red { color: #FF416C; font-weight: 700; font-size: 0.85rem; }

/* MODALS */
.modal { border: none; background: transparent; margin: auto; padding: 0; top: 50%; transform: translateY(-50%); }
.modal::backdrop { background: rgba(0, 5, 15, 0.85); backdrop-filter: blur(8px); }
.modal-content {
    background: var(--bg-glass); border: 1px solid var(--border-light); backdrop-filter: blur(20px);
    border-radius: var(--radius-lg); width: 440px; max-width: 90vw;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8), inset 0 1px 1px rgba(255,255,255,0.1); display: flex; flex-direction: column;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 1.8rem; border-bottom: 1px solid var(--border-light); }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.6rem; cursor: pointer; transition: 0.2s;}
.modal-close:hover { color: var(--text-main); transform: rotate(90deg);}
.modal-body { padding: 1.8rem; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 1rem; padding: 1.5rem 1.8rem;
    border-top: 1px solid var(--border-light); background: rgba(0,0,0,0.2);
    border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg);
}

/* DETAILS VIEW - RIGID LEDGER BLUEPRINT */
.detail-grid {
    display: grid; grid-template-columns: 320px 1fr; gap: 2.5rem; width: 100%; align-items: start;
}
.detail-sidebar { display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 90px;}
.sidebar-card {
    background: var(--bg-glass); border: 1px solid var(--border-light); border-radius: var(--radius-md);
    padding: 1.5rem; box-shadow: var(--shadow-glass); backdrop-filter: blur(10px);
}
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.9rem;}
.stat-row:last-child { border-bottom: none; }
.stat-row span { color: var(--text-muted); font-weight: 600;}
.highlight { background: var(--grad-success); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.ledger-container {
    background: var(--bg-glass); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass); padding: 2.5rem; backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 1.5rem;
}
.ledger-top { text-align: center; }
.ledger-main-title {
    font-size: 1.6rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase;
    background: linear-gradient(to right, #ffffff, #a5b4fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.ledger-footer { text-align: center; font-size: 0.85rem; color: var(--text-muted); font-style: italic; margin-top: 0.5rem;}

/* RIGID GRID TABLE */
.rigid-table-wrapper { width: 100%; border: 1px solid rgba(255,255,255,0.2); border-radius: 4px; overflow: hidden; }
.rigid-ledger-table { width: 100%; border-collapse: collapse; text-align: center; background: rgba(0,0,0,0.4); }
.rigid-ledger-table th, .rigid-ledger-table td { 
    padding: 0.8rem 0.5rem; border: 1px solid rgba(255,255,255,0.15); font-variant-numeric: tabular-nums;
}
.rigid-ledger-table th {
    background: rgba(255,255,255,0.08); color: var(--text-main); font-size: 0.8rem;
    text-transform: uppercase; font-weight: 800; letter-spacing: 0.5px;
}
.rigid-ledger-table td { font-size: 0.95rem; font-weight: 600; color: #fff;}
.actual-close-input {
    background: transparent; border: 1px dashed rgba(255,255,255,0.2); 
    color: var(--success); font-family: 'Inter', sans-serif; font-weight: 700;
    text-align: center; width: 100px; padding: 4px; border-radius: 4px;
    transition: all 0.2s ease;
}
.actual-close-input:focus {
    background: rgba(16, 185, 129, 0.1); border-color: var(--success);
    outline: none; box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.rigid-ledger-table tbody tr:hover { background: rgba(0, 198, 255, 0.05); }

/* STATUS PILL */
.status-pill {
    display: inline-flex; align-items: center; justify-content: center; padding: 0.5rem 1rem; border-radius: 9999px;
    font-size: 0.75rem; font-weight: 800; cursor: pointer; background: rgba(0,0,0,0.5); border: 1px solid var(--border-light);
    color: var(--text-muted); transition: all 0.3s ease; user-select: none; text-transform: uppercase; letter-spacing: 0.5px;
}
.achievement-cb { display: none; }
.achievement-cb:checked + .status-pill { background: var(--grad-success); border-color: transparent; color: #fff; box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);}
.achievement-cb:not(:checked) + .status-pill:hover { border-color: #00C6FF; color: var(--text-main); background: rgba(0, 198, 255, 0.1); }
.row-achieved td { opacity: 0.5; }
.hidden { display: none !important; }

@media (max-width: 992px) {
    .detail-grid { grid-template-columns: 1fr; }
    .rigid-table-wrapper { overflow-x: auto; }
}
