:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --trade-green: #00b074;
    --trade-red: #ff3b30;
    --primary-brand: #4f46e5;
}

body { 
    background-color: var(--bg-main); 
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* 🔥 NAVBAR ADJUSTMENT: PERFECTLY COMPACT & SLEEK (PATLA HEADER WITH OVERFLOW FIX) */
.navbar { 
    background: linear-gradient(135deg, #0f41b5 0%, #1b166f 50%, #0f41b5 100%) !important; 
    border-bottom: 3px solid #4f46e5; /* Neon Brand Highlight Line */
    padding: 0.35rem 1.5rem !important; /* Padding reduce karke patla kiya */
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.3);
    min-height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important; /* Prevents text from breaking or choking */
    width: 100% !important;
    box-sizing: border-box !important;
}

/* BRAND LOGO ICON & TEXT GLOW EFFECTS */
.navbar-brand {
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    font-size: 1.15rem !important; /* Scaled down slightly to fit the sleek header */
    /* Ultra Vivid Multi-Shade Gradient Text */
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 40%, #34d399 100%);
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    display: flex !important;
    align-items: center !important;
    filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.35));
    white-space: nowrap !important; /* Text ko boundary se bahar latakne se rokta hai */
    margin-right: 1rem !important;
}

.navbar-brand i {
    color: #38bdf8 !important;
    -webkit-text-fill-color: #38bdf8 !important;
    filter: drop-shadow(0 0 6px #38bdf8);
    margin-right: 0.5rem !important;
}

/* USER TEXT PROFILE AND LOGOUT BUTTON RESET FOR DARK BACKGROUND */
.navbar .text-muted.me-3.fs-7 {
    color: #94a3b8 !important; /* Muted silver text for user profile name */
    font-weight: 500;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
}

.navbar .text-muted.me-3.fs-7 i {
    color: #38bdf8 !important; /* Glowing blue user icon */
}

.btn-logout {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #cbd5e1 !important;
    font-weight: 600;
    font-size: 0.75rem !important;
    padding: 3px 12px !important; /* Compact dynamic alignment */
    transition: all 0.2s ease;
    white-space: nowrap !important;
    border-radius: 6px !important;
}

.btn-logout:hover {
    background-color: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

/* Card and Table Layout */
.card { 
    background-color: var(--bg-card); 
    border: 1px solid var(--border-color);
    border-radius: 12px; 
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.table {
    color: var(--text-main);
    margin-bottom: 0;
    vertical-align: middle !important;
}

/* 🔥 UNIFORM CENTER ALIGNMENT FOR BODY CELL CONTENT (NO MORE BIKHRA HUA LOOK) */
.table > :not(caption) > * > * {
    background-color: transparent;
    color: inherit;
    border-bottom-color: var(--border-color);
    padding: 10px 8px !important; /* Compact structure */
    text-align: center !important; /* Horizontally centered data */
    vertical-align: middle !important; /* Vertically centered data */
    font-size: 0.8rem !important; /* Uniform text sizing */
}

/* 🔥 CUSTOM DYNAMIC BLUE TRADING TERMINAL TABLE HEADER STYLE (CENTER ALIGNED) */
.table thead tr {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%) !important; /* Premium Deep Blue to Navy Gradient */
}

.table thead th {
    color: #e2e8f0 !important; /* Soft white-silver text for sharp neon visibility */
    font-weight: 700 !important;
    font-size: 0.68rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    border-bottom: 2px solid #2563eb !important; /* Blue glowing divider accent */
    padding: 11px 8px !important;
    text-align: center !important; /* Header centered tracking */
}

/* Row Hover Interactive Effect */
.table tbody tr:hover {
    background-color: #f8fafc !important;
    transition: background-color 0.15s ease;
}

/* 🔥 TERMINAL RISK ENGINE COLUMNS STYLING */
.share-qty-input {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #ffffff;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.8rem !important;
    text-align: center !important;
    padding: 2px 4px !important;
    height: 28px !important;
    transition: all 0.2s;
}
.share-qty-input:focus {
    border-color: var(--primary-brand);
    outline: 0;
    box-shadow: 0 0 0 2px rgba(79, 79, 233, 0.15);
}
.cell-profit {
    color: var(--trade-green) !important;
    font-weight: 700 !important;
}
.cell-loss {
    color: var(--trade-red) !important;
    font-weight: 700 !important;
}

/* Interactive Search */
.search-container {
    position: relative;
}
.search-container i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.search-input {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding-left: 40px;
    height: 38px;
    border-radius: 8px;
    font-size: 0.85rem;
}
.search-input:focus {
    border-color: var(--primary-brand);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Buttons & Actions */
.btn-action {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.78rem !important;
    padding: 4px 12px !important;
    border-radius: 6px;
    transition: all 0.2s;
}
.btn-action:hover {
    background-color: var(--primary-brand);
    border-color: var(--primary-brand);
    color: #ffffff;
}

/* Market Colors */
.text-up { color: var(--trade-green) !important; font-weight: 600; }
.text-down { color: var(--trade-red) !important; font-weight: 600; }

.badge-trade {
    font-weight: 600;
    font-size: 0.7rem !important;
    padding: 4px 8px !important;
    border-radius: 4px;
    display: inline-block;
}
.bg-trade-buy { background-color: #e6f7f1; color: var(--trade-green); }
.bg-trade-sell { background-color: #fde8e8; color: var(--trade-red); }
.bg-trade-hold { background-color: #fef3c7; color: #d97706; }
.bg-trade-info { background-color: #eff6ff; color: #2563eb; }

/* ==========================================================================
   💡 MASTER TOP SECTION: LEFT SIDE TICKERS & RIGHT SIDE FII/DII LIVE WIDGET
   ========================================================================= */
.top-dashboard-wrapper {
    display: flex !important;
    gap: 16px !important;
    width: 100% !important;
    margin-bottom: 1.5rem !important;
    align-items: stretch !important;
}

/* 5 Tickers Left block container takes 75% width */
.market-gaze-grid {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 8px !important;
    flex: 0 0 75% !important;
    max-width: 75% !important;
}

/* FII DII Right block container takes 25% width */
.fii-dii-live-widget {
    flex: 0 0 25% !important;
    max-width: 25% !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
    transition: all 0.2s ease-in-out !important;
}
.fii-dii-live-widget::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background-color: #10b981;
}
.fii-dii-live-widget:hover {
    transform: translateY(-2px) !important;
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

.idx-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    padding: 6px 8px !important;
    position: relative !important;
    overflow: hidden !important;
    transition: all 0.2s ease-in-out !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
}

/* Thicker Premium 6px Accent Bars */
.card-nifty::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background-color: #3b82f6; }
.card-bank::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background-color: #10b981; }
.card-midcap::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background-color: #8b5cf6; }
.card-smallcap::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background-color: #f97316; }
.card-sensex::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background-color: #ec4899; }

.idx-card:hover {
    transform: translateY(-2px) !important;
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05) !important;
}

.idx-title-text {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
    line-height: 1 !important;
    text-transform: uppercase;
}

.idx-date-sub {
    font-size: 0.6rem !important;
    color: var(--text-muted) !important;
    margin: 1px 0 2px 0 !important;
    line-height: 1 !important;
}

.idx-price-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    margin-top: 2px !important;
}

.idx-main-price {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    margin: 0 !important;
    line-height: 1 !important;
}

.idx-change-text {
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* FII / DII Internal Spacing Layout */
.fii-dii-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin: 2px 0 !important;
}
.fii-dii-label {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
}
.fii-dii-value {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
}