
 /* ============== indexes ================ */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Syne:wght@400;600;700&display=swap');


/* =========================================================
   SECTION WRAPPERS
========================================================= */

.indices-section {
    width: 100%;
    padding: 72px 72px 80px;
    box-sizing: border-box;
}

.tabs-section {
    /* background: #fefcf7; */
    padding: 20px 28px;
    border-radius: 16px;
    max-width: 1362px;
    margin: auto;
}

/* =========================================================
   HEADER
========================================================= */

.v2-ind-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    width: 92%;
    max-width: 1200px;

    margin: auto;
    padding: 26px 0 8px;
}

.v2-sec-label {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 2px;
    text-transform: uppercase;

    color: var(--primary);

    margin-bottom: 8px;
}

.v2-sec-label-line {
    width: 22px;
    height: 2px;
    background: #1e2a78;
    border-radius: 10px;
}

.v2-sec-label-txt {
    font-family: "Quicksand", sans-serif;
}

.v2-sec-title {
    margin: 0;
    font-family: "Quicksand", sans-serif;
}

.v2-sec-title--nowrap {
    font-size: 25px;
    font-weight: 600;
    line-height: 1.2;
    color: #1e2a78;
    letter-spacing: -0.3px;
}

.v2-ind-head-right {
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.6;
    max-width: 220px;
    text-align: right;
}




/* =======================================================
   CONTAINER
======================================================= */
.indices-container {
    width: 92%;
    max-width: 1200px;
    margin: 20px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* =======================================================
   CARD
======================================================= */
.index-item {
    flex: 0 0 190px;
    width: 190px;
    min-width: 190px;

    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 4px;

    padding: 14px 16px 12px;

    transition: 0.25s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

/* Corner accent pip */
.index-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 44px;
    height: 44px;
    border-radius: 0 0 44px 0;
    transition: 0.25s ease;
}

.index-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

/* =======================================================
   POSITIVE / NEGATIVE STATES
======================================================= */
.index-item.up   { border-top: 3px solid #16A34A; }
.index-item.down { border-top: 3px solid #DC2626; }

.index-item.up::before   { background: rgba(22, 163, 74, 0.07); }
.index-item.down::before { background: rgba(220, 38, 38, 0.06); }

.bottom-row.up   { color: #16A34A; }
.bottom-row.down { color: #DC2626; }

/* =======================================================
   LABEL
======================================================= */
.mi-label {
    font-size: 10px;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 5px;
    padding-left: 24px; /* clears the corner pip */
}

/* =======================================================
   PRICE
======================================================= */
.price {
    font-size: 21px;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    font-variant-numeric: tabular-nums;
}

/* =======================================================
   SPARK
======================================================= */
.mi-spark {
    width: 100%;
    height: 36px;
    margin: 6px 0;
    display: block;
}

/* =======================================================
   BOTTOM ROW
======================================================= */
.bottom-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    margin-top: auto;
}

.bottom-row span:last-child {
    opacity: 0.65;
}

/* =======================================================
   RESPONSIVE
======================================================= */
@media (max-width: 768px) {
    .indices-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        width: 100%;
    }
    .index-item {
        width: 100%;
        min-width: unset;
    }
}

@media (max-width: 480px) {
    .indices-container {
        grid-template-columns: 1fr;
    }
}



/* ============================ tabs ============================ */


.v2-tabs-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
  width: 92%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding:28px 0px 0px;
}

.v2-sec-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}

.v2-sec-label-line {
  width: 24px;
  height: 2px;
  background: #1E2A78;
  border-radius: 2px;
}

.v2-sec-label-txt {
  font-family: "Quicksand", sans-serif;
}

.v2-sec-title {
  font-family: "Quicksand", sans-serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: #1e2a78;
  margin: 0;
  font-style: normal; /* ensure upright */
  letter-spacing: -0.3px;
}

.v2-sec-title--nowrap {
  white-space: nowrap;
}

.v2-tabs-head-right {
  color: #9ca3af;
  font-size: 13px;
  line-height: 1.65;
  max-width: 260px;
  text-align: right;
}

/* Tabs Wrapper */
.tabs-wrapper {
    font-family: "Quicksand", sans-serif;
    width: 100%;
    max-width: 1250px;
    margin: 32px auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    padding: 24px;
}
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(30,42,120,0.1);
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: black;
    border-radius: 10px 10px 0 0;
    transition: all 0.2s;
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-bottom: none;
    position: relative;
    bottom: -1px;
    background: transparent;
}
.tab-label i { font-size: 15px; }
.tab-label:hover { color: #0d1340; background: #f4f8ff; }
.tab-label.active {
    background: #1E2A78;
    color: #fff;
    border-color: rgba(30,42,120,0.1);
    border-bottom: 2px solid #fff;
}
.tab-panel {
    display: none;
    padding: 20px;
    background: #f9fafb;
    border-radius: 0 12px 12px 12px;
    border: 1px solid rgba(30,42,120,0.08);
    animation: fadeIn 0.3s ease;
}
.tab-panel.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
    .tab-label { padding: 9px 13px; font-size: 12px; }
}

















/* ============== MOVING AVERAGE ================ */
.tab-content { padding: 0px; }

.nifty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    padding: 4px 0;
}

.nifty {
    background: #fff;
    border: 1px solid #eaecf5;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.15s, border-color 0.15s;
    margin-bottom: 0;
}

.nifty:hover {
    border-color: #c7d2f0;
    box-shadow: 0 4px 16px rgba(30,42,120,0.08);
}

/* top accent line */
.nifty::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #e0e0e0;
    border-radius: 12px 12px 0 0;
}
.nifty.highlight-green::before { background: #22c55e; }
.nifty.highlight-red::before   { background: #ef4444; }
.nifty.highlight-green { background: #f0fdf4; border-color: #bbf7d0; }
.nifty.highlight-red   { background: #fef2f2; border-color: #fecaca; }

/* top row: name + badge */
.nifty-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.name-indice {
    font-size: 13px;
    font-weight: 700;
    color: #1e2a78;
    line-height: 1.3;
    padding-left: 0;
    min-width: unset;
}

/* data cells */
.data-indice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: unset;
}

.data-indice > div {
    background: #f8f9ff;
    border: 1px solid #eaecf5;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nifty.highlight-green .data-indice > div { background: #f0fdf4; border-color: #dcfce7; }
.nifty.highlight-red   .data-indice > div { background: #fef2f2; border-color: #fecaca; }

.data-name {
    font-size: 9px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.data-value {
    font-size: 13px;
    font-weight: 700;
    color: #0d1340;
    font-variant-numeric: tabular-nums;
    margin-left: 0;
}

.nifty.highlight-green .data-value { color: #15803d; }
.nifty.highlight-red   .data-value { color: #b91c1c; }

/* badges */
.trend-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.badge-green   { background: #dcfce7; color: #15803d; }
.badge-red     { background: #fee2e2; color: #b91c1c; }
.badge-neutral { background: #f1f5f9; color: #64748b; }

@media (max-width: 768px) {
    .nifty-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
@media (max-width: 480px) {
    .nifty-grid { grid-template-columns: 1fr; }
}


/* ================================   panel2 =========================== */


/* --- 1. MAIN CONTAINER --- */
.bulkdeals {
    width: 100%;
    height: 520px; 
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 24px;
}

/* --- 2. HEADER & DROPDOWN --- */
.bulk-deal-heading {
    width: 100%;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: #1E2A78;
    border-bottom: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.bulk-deal-heading p {
    font-size: 15px;
    font-weight: 800;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
}

/* Accent blue indicator */
/* .bulk-deal-heading p::before {
    content: "";
    width: 4px;
    height: 16px;
    background: white;
    margin-right: 10px;
    border-radius: 2px;
} */

.dropdown-select {
    appearance: none;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 30px 6px 12px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    transition: all 0.2s;
}

/* --- 3. DATA GRID (BULK DEALS) --- */
.bulk-deal-data {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: auto;
    padding: 0; /* Clean edges */
}

.bulk-deal-header {
    display: flex;
    background-color: #f1f5f9; /* Professional soft grey */
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0; 
    z-index: 10;
    border-bottom: 2px solid #e2e8f0;
}

.bulk-deal-header > div, 
.bulk-deal-row > div {
    flex: 1;
    padding: 12px 10px;
    font-size: 12px;
    text-align: center;
    border-right: 1px solid #f1f5f9;
    color:black;
}

.bulk-deal-row {
    display: flex;
    background-color: #ffffff;
    transition: background 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

.bulk-deal-row:hover { background-color: #f8fafc; }

/* --- 4. BLOCK SECTION (SIDE-BY-SIDE OR INDEPENDENT) --- */
.block-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.blockdata h2 {
    background: #1E2A78; /* Darker, sophisticated navy */
    color: white;
    padding: 12px;
    font-size: 13px;
    text-align: left;
    font-weight: 700;
    margin: 0;
}

/* Row Alignment Logic - Ensuring columns never collapse */
.blockdata-row {
    display: flex;
    min-width: 800px; 
    border-bottom: 1px solid #f1f5f9;
}

.blockdata-row.header {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 5;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    font-size: 10px;
}

.blockdata-cell {
    padding: 12px 10px;
    font-size: 12px;
    color: #334155;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Column weight tuning */
.blockdata-row .blockdata-cell:nth-child(2) { flex: 1.5; font-weight: 700; color: #2563eb; } /* Company Name highlight */
.blockdata-row .blockdata-cell:nth-child(3) { flex: 2; justify-content: flex-start; text-align: left; } /* Client/Investor */

/* --- 5. AUTH & GLASS OVERLAY --- */
.dummy-table-wrapper { position: relative; height: 100%; }

#panel2 .login-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px); /* Modern glass effect */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

#panel2 .login-text {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

#panel2 .prev-login {
    padding: 8px 20px;
    background: #1e293b;
    color: #FFC107 !important;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* --- 6. RESPONSIVE --- */
@media (max-width: 768px) {
    .bulk-deal-heading {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        height: auto;
        gap: 10px;
    }
    
    .bulkdeals { height: 480px; }
    
    .blockdata-row, .bulk-deal-header, .bulk-deal-row {
        min-width: 650px; /* Horizontal scroll kicks in here */
    }
}




/* ============================= fii-dii / pivots ====================== */
/* Container: Clean & Professional */
#panel3 {
  padding: 24px;
  background: #f8fafc;
  border-radius: 16px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Section Cards: Sleek Elevation */
#panel3 .fii-dii-flex,
#panel3 .pivot-wrapper {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
}

/* Headings: Sharp & Branded */
#panel3 #panel3-fii-dii-heading,
#panel3 .pivot-heading {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

#panel3 #panel3-fii-dii-heading::before,
#panel3 .pivot-heading::before {
  content: "";
  width: 4px;
  height: 18px;
  background: #2563eb; /* Professional Blue */
  margin-right: 12px;
  border-radius: 2px;
}

/* FII–DII Table: Compact & Readable */
#panel3 .fii-dii-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#panel3 .fii-dii-table th {
  text-align: left;
  padding: 8px 12px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
}

#panel3 .fii-dii-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

#panel3 .fii-dii-table tr:hover td {
  background: #f8fafc;
}

#panel3 .label-cell { font-weight: 500; }
#panel3 .value-cell { 
  text-align: right; 
  font-weight: 700; 
  color: #0f172a;
  font-family: 'JetBrains Mono', monospace; 
}

/* Pivot Table: Structured High-Density Grid */
#panel3 .pivot-table {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

#panel3 .pivot-header {
  background: #f1f5f9; /* Soft grey header */
  border-bottom: 2px solid #e2e8f0;
}

#panel3 .pivot-header .pivot-cell {
  font-weight: 700;
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
}

#panel3 .pivot-row {
  display: grid;
  grid-template-columns: 0.6fr 1fr 1fr 1fr 1.2fr; /* Optimized spacing */
  background: #fff;
}

#panel3 .pivot-cell {
  padding: 12px;
  font-size: 13px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
}

#panel3 .pivot-row:not(.pivot-header):hover {
  background: #f0f7ff;
}

/* Color Coding for Levels (Optional but Recommended) */
#panel3 .pivot-row:nth-child(n+2):nth-child(-n+4) .pivot-cell:first-child { color: #dc2626; font-weight: 700; } /* Resistances Red */
#panel3 .pivot-row:nth-child(n+6) .pivot-cell:first-child { color: #16a34a; font-weight: 700; } /* Supports Green */

/* Login Overlay: Glassmorphism */
#panel3 .dummy-table-wrapper { position: relative; }
#panel3 .blur-table { filter: blur(4px); opacity: 0.4; }

#panel3 .login-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

#panel3 .prev-login {
  padding: 8px 20px;
  background: #1e293b;
  color: #fff !important;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.2s;
}

#panel3 .prev-login:hover { background: #0f172a; }

/* Side-by-Side Layout Rigidity */
#panel3 .fii-dii-flex { float: left; width: 34%; margin-right: 2%; }
#panel3 .pivot-wrapper { float: left; width: 64%; }
#panel3::after { content: ""; display: block; clear: both; }

@media (max-width: 1024px) {
  #panel3 .fii-dii-flex, #panel3 .pivot-wrapper { float: none; width: 100%; margin-right: 0; margin-bottom: 20px; }
}







/* ===================== SECTOR INSIGHTS & HEATMAP REDESIGN ===================== */

#panel6 {
    background: #ffffff;
    padding: 2rem;
    border-radius: 1.5rem;
    color: #1f2937; /* Darker text for readability */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

/* ==================== SECTOR FILTER SELECTION ==================== */
.sector-select-container {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

#sector-select {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #1f2937;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

#sector-select:focus {
    outline: none;
    border-color: #1E2A78;
    box-shadow: 0 0 0 3px rgba(30, 42, 120, 0.15);
}

/* ==================== PROFIT / LOSS COLORS ==================== */
.profit, .positive-change { color: #16a34a; font-weight: 700; }
.loss, .negative-change { color: #dc2626; font-weight: 700; }
.neutral { color: #6b7280; font-weight: 600; }

.sector-box.positive {
    background: linear-gradient(135deg, #16a34a 0%, #059669 100%);
}
.sector-box.negative {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}
.sector-box.neutral-bg {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}

/* ==================== TABLE REFINEMENTS ==================== */
.company-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 12px;
    font-weight: 600;
    color: #1f2937;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.company-table th {
    background-color: #1E2A78;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px;
    text-align: center;
}

.company-table td {
    padding: 12px;
    font-size: 13px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

/* Badge Styling */
.company-symbol {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.sector-badge {
    background-color: #1E2A78;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ==================== SCROLLBAR FOR PERFORMANCE DATA ==================== */
#performance-data::-webkit-scrollbar {
    width: 6px;
}
#performance-data::-webkit-scrollbar-track { background: #f3f4f6; }
#performance-data::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
#performance-data::-webkit-scrollbar-thumb:hover { background: #94a3b8; }


/* ==================== MOBILE RESPONSIVE STYLES ==================== */

@media screen and (max-width: 768px) {
    /* 1. Container Adjustments */
    #panel6 {
        padding: 1rem; /* Reduce padding on small screens */
        border-radius: 1rem;
    }

    /* 2. Stack the Filters */
    .sector-select-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        font-size: 16px;
    }

    #sector-select {
        width: 100%; /* Full width dropdown for easy tapping */
    }

    /* 3. Make Table Scrollable (Prevents layout breaking) */
    .insights_sector {
        width: 100%;
        overflow-x: auto; /* Adds horizontal scroll to the table only */
        -webkit-overflow-scrolling: touch;
        margin-bottom: 30px;
    }

    .company-table {
        min-width: 600px; /* Ensures table columns don't collapse */
    }

    /* 4. Heatmap Grid: 1 Column on Mobile */
    .sector-heatmap-container {
        grid-template-columns: 1fr; 
        gap: 1rem;
    }

    .sector-box {
        padding: 16px;
        min-height: 110px;
    }

    .sector-name {
        font-size: 1.1rem;
    }

    /* 5. Popup Adjustments for Touch */
    #sectorPopup {
        width: 90%; /* Larger width for easier viewing */
        left: 5% !important; /* Center it roughly on screen */
        pointer-events: auto; /* Allow scrolling inside popup on mobile */
    }

    /* 6. Login Prompt */
    .login-prompt {
        width: 85%;
        padding: 1.5rem;
    }
}

/* Extra Small Phones */
@media screen and (max-width: 480px) {
    #panel6 {
        padding: 0.75rem;
    }

    .company-table th, .company-table td {
        padding: 8px;
        font-size: 12px;
    }
}




/* =======================================================
   FILTER BAR
======================================================= */
.ipo-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ipo-filter-bar select {
    padding: 7px 12px;
    border-radius: 4px;
    border: 1px solid #d0d5dd;
    background: #ffffff;
    font-size: 12px;
    font-weight: 500;
    color: #344054;
    cursor: pointer;
    min-width: 120px;
    transition: border-color 0.2s ease;
    appearance: auto;
}

.ipo-filter-bar select:hover {
    border-color: #1E2A78;
}

.ipo-filter-bar select:focus {
    outline: none;
    border-color: #1E2A78;
    box-shadow: 0 0 0 2px rgba(30, 42, 120, 0.12);
}

/* =======================================================
   GRID CONTAINER
======================================================= */
.iposcrp {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    position: relative;
}

/* =======================================================
   CARD
======================================================= */
.ipospcrd {
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 4px;
    padding: 13px 14px 11px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

/* Corner accent pip — same pattern as index cards */
.ipospcrd::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border-radius: 0 0 40px 0;
}

.ipospcrd:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

/* =======================================================
   POSITIVE / NEGATIVE CARD STATES
   Applied by the filter JS on .ipospcrd
======================================================= */
.ipospcrd.positive-card {
    border-top: 3px solid #16A34A;
}
.ipospcrd.positive-card::before {
    background: rgba(22, 163, 74, 0.07);
}

.ipospcrd.negative-card {
    border-top: 3px solid #DC2626;
}
.ipospcrd.negative-card::before {
    background: rgba(220, 38, 38, 0.06);
}

/* =======================================================
   COMPANY NAME
======================================================= */
.ipo-company {
    font-size: 12px;
    font-weight: 700;
    color: #1E2A78;
    margin: 0 0 5px 0;
    padding-left: 22px;       /* clears the corner pip */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =======================================================
   PRICE ROW
======================================================= */
.ipo-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}

.ipo-price {
    font-size: 17px;
    font-weight: 700;
    color: #0F172A;
    font-variant-numeric: tabular-nums;
}

.ipo-change {
    font-size: 11px;
    font-weight: 600;
}

/* =======================================================
   DETAILS TABLE
======================================================= */
.ipo-details {
    border-top: 1px solid #f1f5f9;
    padding-top: 7px;
    margin-bottom: 7px;
}

.ipo-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
    font-size: 11px;
}

.ipo-label {
    color: #64748B;
    font-weight: 600;
}

.ipo-value {
    color: #1e293b;
    font-weight: 600;
}

/* =======================================================
   GAIN VALUE CLASSES
   .positive / .negative applied by Django template tag
======================================================= */
.positive {
    color: #16A34A;
    font-weight: 700;
}

.negative {
    color: #DC2626;
    font-weight: 700;
}

.ipo-listing-gain.positive { color: #16A34A; font-weight: 700; }
.ipo-listing-gain.negative { color: #DC2626; font-weight: 700; }
.ipo-since-gain.positive   { color: #16A34A; font-weight: 700; }
.ipo-since-gain.negative   { color: #DC2626; font-weight: 700; }

/* =======================================================
   FOOTER / DATE BADGE
======================================================= */
.ipo-footer {
    margin-top: auto;
    padding-top: 6px;
    text-align: right;
}

.ipo-date {
    font-size: 10px;
    color: #1E2A78;
    background: rgba(30, 42, 120, 0.08);
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
}

/* =======================================================
   LOGIN OVERLAY & BLUR
======================================================= */
#panel4 .dummy-table-wrapper {
    position: relative;
}

#panel4 .blur-table {
    filter: blur(3px);
    pointer-events: none;
}

#panel4 .login-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    z-index: 10;
    border-radius: 8px;
}

#panel4 .login-text {
    font-size: 15px;
    font-weight: 500;
    color: #111827;
}

#panel4 .prev-login {
    padding: 7px 20px;
    background: #1E2A78;
    color: #FFC107;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.2s;
}

#panel4 .prev-login:hover {
    opacity: 0.88;
}

/* =======================================================
   IPO HEADING (inside grid)
======================================================= */
.ipo-heading {
    grid-column: 1 / -1;
    font-size: 1rem;
    font-weight: 700;
    color: #1E2A78;
    margin-bottom: 4px;
    padding-left: 4px;
}

/* =======================================================
   RESPONSIVE
======================================================= */
@media (max-width: 768px) {

    #panel4 {
        padding: 12px;
    }

    .iposcrp {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .ipo-filter-bar {
        justify-content: center;
    }

    .ipospcrd {
        padding: 14px;
    }

    .ipo-company {
        font-size: 13px;
    }

    .ipo-price {
        font-size: 1.2rem;
    }

    .ipo-change {
        font-size: 12px;
    }

    .ipo-detail-row {
        font-size: 12px;
        margin-bottom: 5px;
    }

    #panel4 .login-overlay {
        padding: 20px;
        text-align: center;
    }

    #panel4 .login-text {
        font-size: 14px;
        line-height: 1.4;
    }
}

@media (max-width: 360px) {
    .ipo-price-row {
        flex-direction: column;
        gap: 2px;
    }
    .ipo-price {
        font-size: 1.1rem;
    }
}





/* ============ adr-gdr ==================== */
/* =========================
   ADR / GDR MODERN UI
========================= */

:root{
    --adr-primary:#1E2A78;
    --adr-bg:#f8fafc;
    --adr-card:#ffffff;
    --adr-border:#e2e8f0;
    --adr-text:#0f172a;
    --adr-muted:#64748b;
    --adr-green:#10b981;
    --adr-red:#ef4444;
    --adr-shadow:0 6px 20px rgba(15,23,42,0.06);
}

/* =========================
   SECTION
========================= */

.insights-fourthpart{
    margin:24px 0;
    padding:22px;
    border:1px solid var(--adr-border);
    border-radius:22px;
    background:linear-gradient(to bottom,#ffffff,#f8fafc);
    box-shadow:var(--adr-shadow);
}

/* =========================
   HEADER
========================= */

.adr-gdr-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    margin-bottom:20px;
    padding-bottom:18px;
    border-bottom:1px solid rgba(148,163,184,0.18);
}

.adr-gdr-title {
    font-size:14px;
    font-weight:500;
    color:red;
    letter-spacing:-0.3px;
    margin:0;
}

.h2{
    font-size:16px;
    font-weight:500;
    color:black;
    letter-spacing:-0.3px;
    margin:0;
}
/* =========================
   TOGGLE BUTTON
========================= */

.adr-gdr-btn{
    border:none;
    outline:none;
    cursor:pointer;
    padding:9px 18px;
    border-radius:12px;
    background:var(--adr-primary);
    color:#fff;
    font-size:13px;
    font-weight:600;
    transition:0.25s ease;
    box-shadow:0 4px 12px rgba(30,42,120,0.15);
}

.adr-gdr-btn:hover{
    transform:translateY(-1px);
    background:#16205f;
}

/* =========================
   VISIBILITY
========================= */

#adrGdrTableContainer,
#adrGdrCardContainer{
    display:none;
}

#adrGdrTableContainer.active{
    display:block;
}

#adrGdrCardContainer.active{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
    gap:16px;
}

/* =========================
   MODERN CARDS
========================= */

.adr-gdr-card-item{
    position:relative;
    overflow:hidden;
    background:rgba(255,255,255,0.85);
    backdrop-filter:blur(10px);
    border:1px solid rgba(226,232,240,0.8);
    border-radius:20px;
    padding:18px;
    transition:0.28s ease;
    box-shadow:0 4px 14px rgba(15,23,42,0.05);
}

.adr-gdr-card-item::before{
    content:"";
    position:absolute;
    inset:0;
    background:linear-gradient(
        135deg,
        rgba(30,42,120,0.03),
        transparent 45%
    );
    pointer-events:none;
}

.adr-gdr-card-item:hover{
    transform:translateY(-4px);
    border-color:rgba(30,42,120,0.15);
    box-shadow:0 12px 28px rgba(15,23,42,0.10);
}

/* =========================
   COMPANY TITLE
========================= */

.adr-gdr-card-item > strong:first-child{
    display:flex;
    align-items:center;
    justify-content:space-between;
    font-size:15px;
    font-weight:700;
    color:var(--adr-primary);
    margin-bottom:14px;
    padding-bottom:12px;
    border-bottom:1px dashed rgba(148,163,184,0.25);
    text-transform:uppercase;
    letter-spacing:0.4px;
}

/* =========================
   DATA ROWS
========================= */

.adr-gdr-card-item p{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    margin:10px 0;
    font-size:13px;
    line-height:1.4;
    color:var(--adr-text);
}

.adr-gdr-card-item p strong{
    font-weight:500;
    color:var(--adr-muted);
    font-size:12px;
}

/* =========================
   VALUE COLORS
========================= */

.val-positive{
    color:var(--adr-green) !important;
    font-weight:700;
}

.val-negative{
    color:var(--adr-red) !important;
    font-weight:700;
}

/* =========================
   TABLE STYLING
========================= */

.adr-gdr-table-container{
    overflow-x:auto;
    border:1px solid rgba(226,232,240,0.8);
    border-radius:18px;
    background:#fff;
}

.adr-gdr-table{
    width:100%;
    border-collapse:collapse;
    min-width:700px;
}

.adr-gdr-table thead{
    background:#1E2A78;
}

.adr-gdr-table th{
    padding:14px 16px;
    font-size:12px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:0.5px;
    color:white;
    border-bottom:1px solid rgba(226,232,240,0.8);
}

.adr-gdr-table td{
    padding:16px;
    font-size:13px;
    color:var(--adr-text);
    border-bottom:1px solid rgba(241,245,249,0.9);
}

.adr-gdr-table tbody tr{
    transition:0.2s ease;
}

.adr-gdr-table tbody tr:hover{
    background:#f8fafc;
}

/* =========================
   LOGIN OVERLAY
========================= */

#panel5 .dummy-table-wrapper{
    position:relative;
}

#panel5 .blur-table{
    filter:blur(3px);
    pointer-events:none;
}

#panel5 .login-overlay{
    position:absolute;
    inset:0;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:14px;
    background:rgba(255,255,255,0.82);
    backdrop-filter:blur(10px);
    border-radius:18px;
    z-index:10;
}

#panel5 .login-text{
    font-size:15px;
    font-weight:600;
    color:var(--adr-text);
}

#panel5 .prev-login{
    text-decoration:none;
    padding:10px 18px;
    border-radius:12px;
    background:var(--adr-primary);
    color:#fff;
    font-size:13px;
    font-weight:600;
    transition:0.25s ease;
}

#panel5 .prev-login:hover{
    transform:translateY(-2px);
    background:#16205f;
}

/* =========================
   RESPONSIVE
========================= */

@media(max-width:768px){

    .insights-fourthpart{
        padding:16px;
        border-radius:18px;
    }

    .adr-gdr-header{
        flex-direction:column;
        align-items:flex-start;
        gap:14px;
    }

    .adr-gdr-btn{
        width:100%;
        text-align:center;
    }

    #adrGdrCardContainer.active{
        grid-template-columns:1fr;
    }

    .adr-gdr-card-item{
        padding:16px;
        border-radius:18px;
    }

    .adr-gdr-table{
        min-width:600px;
    }

    .adr-gdr-table th,
    .adr-gdr-table td{
        padding:12px;
        font-size:12px;
    }
}

@media(max-width:480px){

    .adr-gdr-title{
        font-size:16px;
    }

    .adr-gdr-card-item p{
        font-size:12px;
    }

    .adr-gdr-card-item p strong{
        font-size:11px;
    }
}
</style>


<style>
    /* ===============================PANEL 7 – GAINERS & LOSERS ============================== */

#panel7 {
    padding:15px;
    background: white;
}

/* CONTAINER */
/* #panel7 .table-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
} */

/* HEADER */
#panel7 .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

#panel7 .table-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

/* TOP TABS */
#panel7 .tab-buttons {
    display: flex;
    gap: 8px;
}

#panel7 .tab-button {
    padding: 8px 16px;
    font-size: 10px;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.25s ease;
}

#panel7 .tab-button:hover {
    background: #1e3b7823;
}

#panel7 .tab-button.active {
    background: #1E2A78;
    color: #ffffff;
    border-color: #1E2A78;
}

/* TAB CONTENT VISIBILITY (DO NOT CHANGE LOGIC) */
#panel7 .tab-content {
    display: none;
    margin-top: 14px;
}

#panel7 .tab-content.active {
    display: block;
}

/* SECTION BUTTONS */
#panel7 .section-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

#panel7 .section-button {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

#panel7 .section-button:hover {
    background: #1e3b7823;
}

#panel7 .section-button.active {
    background: #1E2A78;
    color: #ffffff;
    border-color: #111827;
}

/* DATA GRID */
#panel7 .data-grid {
    width: 100%;
    overflow-x: auto;
}

/* TABLE */
#panel7 .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#panel7 .data-table thead {
    background: #f1f5f9;
}

#panel7 .data-table th {
    padding: 10px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    background-color: #1e3b7823;
}

#panel7 .data-table td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

#panel7 .data-table tbody tr:hover {
    background: #f9fafb;
}

/* VALUE COLORS */
#panel7 .positive {
    color: #16a34a;
    font-weight: 600;
}

#panel7 .negative {
    color: #dc2626;
    font-weight: 600;
}

/* LOADING */
#panel7 .loading {
    padding: 20px;
    text-align: center;
    color: #6b7280;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    /* 1. Stack the Header and Title */
    #panel7 .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    #panel7 .table-header h3 {
        font-size: 18px;
    }

    /* 2. Horizontal Scroll for Top Pill Tabs */
    #panel7 .tab-buttons {
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        display: flex;
        padding-bottom: 5px; /* Space for hidden scrollbar */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    #panel7 .tab-buttons::-webkit-scrollbar {
        display: none;
    }

    #panel7 .tab-button {
        flex: 0 0 auto; /* Prevent pills from shrinking */
        padding: 6px 14px;
        font-size: 13px;
    }

    /* 3. Horizontal Scroll for Section Buttons (Near/Next/Far) */
    #panel7 .section-buttons {
        width: 100%;
        overflow-x: auto;
        display: flex;
        flex-wrap: nowrap !important; /* Force single row */
        gap: 8px;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    #panel7 .section-button {
        flex: 0 0 auto;
        padding: 5px 12px;
        font-size: 12px;
    }

    /* 4. The Data Table: Horizontal Swipe */
    #panel7 .data-grid {
        margin-top: 10px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
    }

    #panel7 .data-table {
        min-width: 550px; /* Ensures columns like 'Price' and '% Change' stay aligned */
    }

    #panel7 .data-table th, 
    #panel7 .data-table td {
        padding: 12px 8px; /* Slightly larger touch target */
        font-size: 13px;
    }

    /* 5. Container Adjustment */
    #panel7 .table-container {
        padding: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* Lighter shadow for mobile */
    }
}

/* Specific fix for very small devices */
@media (max-width: 400px) {
    #panel7 .data-table {
        min-width: 500px;
    }
    
    #panel7 .table-header h3 {
        font-size: 16px;
    }
}
</style>







/* ==================== FIXED HEATMAP GRID ==================== */


/* This div ensures the parent doesn't force a single column */
.insig {
    display: block !important;
    width: 100% !important;
}

.sector-heatmap-container {
    display: grid !important;
    /* This creates columns of 250px. NO MORE LONG BARS. */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
    margin-top: 0px;
    /* Prevents the container from stretching cards to fill height */
    align-items: start !important;
}

.sector-box {
    width: 100% !important;
    max-width: 300px !important;
    min-height: 130px;
    padding: 18px;
    border-radius: 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    background: #ffffff !important;
    border: 1.5px solid rgba(30,42,120,0.1);
}

.sector-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.sector-detail {
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    color: black;
    margin: 2px 0;

}

/* MOBILE FIX */
@media (max-width: 768px) {
    .sector-heatmap-container {
        grid-template-columns: 1fr 1fr !important; /* Forces 2 per row on mobile */
        gap: 10px !important;
    }
    .sector-box {
        max-width: 100% !important; /* Allow it to take half the screen */
    }
}

/* ==================== SECTOR POPUP ==================== */
#sectorPopup {
    position: absolute; /* Keeps compatibility with your e.pageY script */
    z-index: 10000;
    width: 180px;
     max-height: 70vh; /* <-- Add this to limit height */
    overflow-y: auto;  /* <-- Make it scrollable vertically */
    background: #1e3b7823;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    pointer-events: none; /* Prevents flickering */
    color: #fff;
    font-size: 0.75rem;

}

/* Companies List inside Popup */
.sector-popup-card {
    background: #f9fafb;
    border-left: 4px solid #1E2A78;
    padding: 5px 8px;
    margin-bottom: 4px;
    border-radius: 6px;
    animation: slideIn 0.2s ease-out forwards;
}

.sector-popup-card strong {
    color: #1E2A78;
    font-weight: 600;
}

/* Smooth Animation for Popup Cards */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Custom Scrollbar for Popup */
#sectorPopup::-webkit-scrollbar {
    width: 6px;
}
#sectorPopup::-webkit-scrollbar-thumb {
    background: rgba(30, 42, 120, 0.3);
    border-radius: 10px;
}
#sectorPopup::-webkit-scrollbar-thumb:hover {
    background: #1E2A78;
}

/* ==================== NON-LOGGED USER BLUR ==================== */
.blur-wrapper {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
}

.blur {
    filter: blur(12px) grayscale(0.5);
    pointer-events: none;
}

.login-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    z-index: 50;
    color: #111827;
}

.login-button {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 30px;
    background: #1E2A78;
    color: #FFC107;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(30, 42, 120, 0.3);
}


