/* =========================================================
   DAILY MARKET DASHBOARD — REFERENCE STYLE
   Designed to closely match the supplied 10-section dashboard:
   navy + white cards, compact financial typography, responsive.
   ========================================================= */

:root {
  --dm-navy: #08265f;
  --dm-navy-2: #0d347d;
  --dm-blue: #0b5ed7;
  --dm-text: #101828;
  --dm-muted: #667085;
  --dm-border: #d9e1ec;
  --dm-soft: #f5f8fc;
  --dm-green: #078a2f;
  --dm-green-soft: #edf9f0;
  --dm-red: #e21d2a;
  --dm-red-soft: #fff0f1;
  --dm-orange: #f58220;
  --dm-purple: #5b3aa7;
  --dm-shadow: 0 3px 12px rgba(8, 38, 95, .08);
  --dm-radius: 8px;
}

.daily-update-page {
  background:
    radial-gradient(circle at 15% 0%, rgba(13,52,125,.045), transparent 28rem),
    linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
  color: var(--dm-text);
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  min-height: 100vh;
  padding: 0 0 28px;
}

.daily-update-page *,
.daily-update-page *::before,
.daily-update-page *::after {
  box-sizing: border-box;
}

.daily-update-page .container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

/* ---------- Title ---------- */

.daily-title-wrap {
  background: #fff;
  border-bottom: 1px solid var(--dm-border);
  padding: 18px 0 13px;
}

.daily-title-wrap h1 {
  margin: 0;
  color: var(--dm-navy);
  font-size: clamp(28px, 3.2vw, 43px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -.8px;
}

.daily-title-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 11px;
  color: #344054;
  font-size: 14px;
}

.daily-title-meta span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.daily-title-meta i {
  color: var(--dm-navy);
}

.daily-title-meta strong {
  font-weight: 500;
}

/* ---------- Dashboard grid ---------- */

.daily-dashboard {
  padding-top: 12px;
}

.daily-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.daily-box {
  min-width: 0;
  background: rgba(255,255,255,.97);
  border: 1px solid var(--dm-border);
  border-radius: var(--dm-radius);
  box-shadow: var(--dm-shadow);
  padding: 10px 11px 12px;
  overflow: hidden;
}

.daily-box-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 35px;
  margin-bottom: 9px;
}

.daily-number {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(145deg, var(--dm-navy-2), var(--dm-navy));
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(8,38,95,.2);
}

.daily-box-title h2 {
  flex: 1;
  margin: 0;
  color: var(--dm-navy);
  font-size: 17px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: .05px;
}

.daily-box-title h2 small {
  font-size: 14px;
  font-weight: 700;
  color: #344054;
}

.daily-unit {
  margin-left: auto;
  color: #344054;
  font-size: 14px;
  white-space: nowrap;
}

/* ---------- Section 01: indices ---------- */

.index-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.index-card {
  position: relative;
  min-height: 128px;
  padding: 14px 14px 11px;
  border: 1px solid var(--dm-border);
  border-radius: 6px;
  background:
    linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
  overflow: hidden;
}

.index-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 47%;
  opacity: .12;
  background: linear-gradient(180deg, transparent, #ef3340);
  clip-path: polygon(0 55%, 8% 45%, 16% 53%, 24% 48%, 31% 64%, 40% 54%, 49% 67%, 58% 60%, 66% 73%, 75% 64%, 84% 78%, 92% 69%, 100% 82%, 100% 100%, 0 100%);
}

.index-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 6px;
  text-align: center;
  color: #08752b;
  font-size: 14px;
  font-weight: 800;
}

.index-close {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #101828;
  font-size: 27px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.5px;
}

.index-change {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  text-align: center;
  color: var(--dm-red);
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Section 02: flow table ---------- */

.flow-table-wrap {
  overflow-x: auto;
}

.flow-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--dm-border);
  border-radius: 6px;
  overflow: hidden;
  font-size: 14px;
}

.flow-table th,
.flow-table td {
  padding: 9px 10px;
  border-right: 1px solid var(--dm-border);
  border-bottom: 1px solid var(--dm-border);
  text-align: right;
  white-space: nowrap;
}

.flow-table th:first-child {
  text-align: left;
}

.flow-table thead th {
  background: linear-gradient(180deg, #123b7e, #08265f);
  color: #fff;
  border-color: #b9c7dc;
  font-weight: 800;
}

.flow-table tbody th {
  color: #344054;
  background: #fff;
}

.flow-table tbody td {
  color: var(--dm-green);
  font-weight: 700;
}

.flow-table tbody td[id$="-sell"],
.flow-table tbody td[id="fii-sell"],
.flow-table tbody td[id="dii-sell"] {
  color: var(--dm-red);
}

.flow-table tr:last-child th,
.flow-table tr:last-child td {
  border-bottom: 0;
}

.flow-table th:last-child,
.flow-table td:last-child {
  border-right: 0;
}

.flow-total th,
.flow-total td {
  background: #eef4fb !important;
  font-weight: 800 !important;
}

.flow-total td {
  color: var(--dm-red) !important;
}

/* ---------- Section 03: global markets ---------- */

.global-market-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.global-market-grid > *,
.market-region,
.global-market-card {
  min-width: 0;
}

.global-market-grid > * {
  border: 1px solid var(--dm-border);
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
}

.global-market-grid > *:nth-child(3n+1) {
  --region-color: #0753a8;
}
.global-market-grid > *:nth-child(3n+2) {
  --region-color: #5b3aa7;
}
.global-market-grid > *:nth-child(3n) {
  --region-color: #f58220;
}

.global-market-grid h3,
.global-market-grid .region-title {
  margin: 0;
  padding: 7px 8px;
  background: var(--region-color, var(--dm-navy));
  color: #fff;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.global-market-grid .market-item,
.global-market-grid .index-item,
.global-market-grid article,
.global-market-grid li {
  padding: 6px 9px;
}

.global-market-grid .market-item + .market-item,
.global-market-grid .index-item + .index-item {
  border-top: 1px solid #edf0f5;
}

.global-market-grid strong,
.global-market-grid b {
  font-weight: 800;
}

.global-market-grid .negative,
.global-market-grid .down,
.global-market-grid [class*="negative"],
.global-market-grid [class*="down"] {
  color: var(--dm-red);
}

.global-market-grid .positive,
.global-market-grid .up,
.global-market-grid [class*="positive"],
.global-market-grid [class*="up"] {
  color: var(--dm-green);
}

/* ---------- Section 04: commodities ---------- */

.commodity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.commodity-grid > * {
  min-width: 0;
  border: 1px solid var(--dm-border);
  border-radius: 6px;
  background: linear-gradient(180deg,#fff,#fbfcfe);
  padding: 9px 6px;
  text-align: center;
}

.commodity-grid h3,
.commodity-grid .commodity-name {
  margin: 0 0 7px;
  color: #1d2939;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.commodity-grid .commodity-value,
.commodity-grid .price {
  color: #101828;
  font-size: 17px;
  font-weight: 800;
}

.commodity-grid .positive,
.commodity-grid .up,
.commodity-grid [class*="positive"],
.commodity-grid [class*="up"] {
  color: var(--dm-green);
}

.commodity-grid .negative,
.commodity-grid .down,
.commodity-grid [class*="negative"],
.commodity-grid [class*="down"] {
  color: var(--dm-red);
}

/* USD/INR cards generated below the commodity row */
.currency-card,
.usd-inr,
#usd-inr,
.currency-strip {
  margin-top: 7px;
  border: 1px solid var(--dm-border);
  border-radius: 6px;
  background: linear-gradient(100deg, #f1f6ff, #fff);
}

/* ---------- Section 05: GIFT Nifty ---------- */

.gift-content {
  position: relative;
  min-height: 151px;
  padding: 11px 14px 0;
  border: 1px solid var(--dm-border);
  border-radius: 6px;
  background:
    linear-gradient(160deg, #fff 35%, #f5fbf6 100%);
  overflow: hidden;
}

.gift-content::after {
  content: "";
  position: absolute;
  left: 28%;
  right: 3%;
  top: 22%;
  height: 62%;
  opacity: .16;
  background: linear-gradient(180deg, transparent, #1a9a3f);
  clip-path: polygon(0 78%, 7% 70%, 14% 73%, 22% 56%, 29% 65%, 36% 46%, 44% 58%, 52% 34%, 60% 48%, 68% 25%, 76% 38%, 84% 15%, 92% 27%, 100% 4%, 100% 100%, 0 100%);
}

.gift-price,
.gift-change,
.gift-time,
.gift-bias {
  position: relative;
  z-index: 1;
}

.gift-price {
  color: var(--dm-green);
  font-size: 28px;
  font-weight: 800;
}

.gift-change {
  margin-top: 2px;
  color: var(--dm-green);
  font-size: 15px;
  font-weight: 800;
}

.gift-time {
  margin-top: 21px;
  color: #344054;
  font-size: 13px;
}

.gift-bias {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #d6ead9;
  border-radius: 5px;
  background: var(--dm-green-soft);
  text-transform: uppercase;
  font-size: 14px;
}

.gift-bias span {
  color: var(--dm-green);
  font-size: 16px;
  font-weight: 800;
}

/* ---------- Section 06: movers ---------- */

.movers-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.movers-side {
  min-width: 0;
  border: 1px solid var(--dm-border);
  border-radius: 6px;
  overflow: hidden;
}

.movers-side h3 {
  margin: 0;
  padding: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--dm-green);
}

.movers-side:last-child h3 {
  color: var(--dm-red);
}

.movers-side > div {
  padding: 0 8px 6px;
}

.mover-row,
.mover-item,
.movers-side li {
  display: grid;
  grid-template-columns: 25px minmax(0,1fr) auto auto;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  border-top: 1px solid #edf0f5;
  font-size: 13px;
}

.movers-side .positive,
.movers-side .gain,
.movers-side [class*="gain"] {
  color: var(--dm-green);
  font-weight: 800;
}

.movers-side .negative,
.movers-side .loss,
.movers-side [class*="loss"] {
  color: var(--dm-red);
  font-weight: 800;
}

/* ---------- Section 07: events ---------- */

.events-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.event-column {
  min-width: 0;
  border: 1px solid var(--dm-border);
  border-radius: 6px;
  padding: 10px 12px 8px;
  background: #fff;
}

.event-column h3 {
  margin: 0 0 8px;
  text-align: center;
  color: var(--dm-green);
  font-size: 14px;
  font-weight: 800;
}

.event-column + .event-column h3 {
  color: #083bc1;
}

.event-column ul {
  margin: 0;
  padding-left: 17px;
}

.event-column li {
  margin: 0 0 8px;
  color: #1d2939;
  font-size: 14px;
  line-height: 1.25;
}

/* ---------- Section 08: sectors ---------- */

.sector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.sector-grid > * {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr);
  align-items: center;
  gap: 7px;
  min-height: 50px;
  padding: 6px 8px;
  border: 1px solid var(--dm-border);
  border-radius: 6px;
  background: #fff;
}

.sector-grid h3,
.sector-grid .sector-name {
  margin: 0;
  color: #0638a7;
  font-size: 14px;
  font-weight: 800;
}

.sector-grid p,
.sector-grid .sector-text {
  margin: 2px 0 0;
  color: #1d2939;
  font-size: 14px;
  line-height: 1.15;
}

/* ---------- Section 09: sentiment ---------- */

.sentiment-layout {
  display: grid;
  grid-template-columns: 52% 48%;
  align-items: center;
  min-height: 145px;
  border: 1px solid var(--dm-border);
  border-radius: 6px;
  background: #fff;
  padding: 7px 11px;
}

.gauge-wrap {
  text-align: center;
  border-right: 1px solid var(--dm-border);
  padding-right: 12px;
}

.gauge {
  position: relative;
  width: 190px;
  height: 102px;
  margin: 0 auto 3px;
  overflow: hidden;
}

.gauge-scale {
  position: absolute;
  inset: 4px 8px 0;
  border-radius: 190px 190px 0 0;
  background: conic-gradient(
    from 270deg,
    #ef1d1d 0deg 52deg,
    #ff6b12 52deg 92deg,
    #f0c400 92deg 132deg,
    #83bd16 132deg 166deg,
    #16a044 166deg 180deg,
    transparent 180deg 360deg
  );
}

.gauge-scale::after {
  content: "";
  position: absolute;
  inset: 18px 18px 0;
  border-radius: 170px 170px 0 0;
  background: #fff;
}

.gauge-needle {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 77px;
  transform-origin: 50% 100%;
  transform: translateX(-50%) rotate(58deg);
  border-radius: 4px;
  background: var(--dm-navy);
  box-shadow: 0 0 2px rgba(0,0,0,.25);
  z-index: 2;
}

.gauge-centre {
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 16px;
  height: 16px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--dm-navy);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  z-index: 3;
}

.gauge-wrap > strong {
  display: block;
  color: #101828;
  font-size: 23px;
  line-height: 1;
}

.gauge-wrap > span {
  display: block;
  margin-top: 6px;
  color: var(--dm-orange);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.sentiment-text {
  padding-left: 13px;
}

.sentiment-text p {
  margin: 0;
  color: #1d2939;
  font-size: 14px;
  line-height: 1.4;
}

/* ---------- Section 10: factors ---------- */

.factors-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.factor-column {
  border: 1px solid var(--dm-border);
  border-radius: 6px;
  padding: 9px 12px;
  background: #fff;
}

.factor-column h3 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.factor-column.positive h3 {
  color: var(--dm-green);
}

.factor-column.negative h3 {
  color: var(--dm-red);
}

.factor-column ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.factor-column li {
  position: relative;
  margin: 0 0 7px;
  padding-left: 17px;
  color: #1d2939;
  font-size: 14px;
  line-height: 1.25;
}

.factor-column.positive li::before,
.factor-column.negative li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 900;
}

.factor-column.positive li::before {
  content: "✓";
  color: var(--dm-green);
}

.factor-column.negative li::before {
  content: "×";
  color: var(--dm-red);
}

/* ---------- Overall view ---------- */

.overall-view-strip {
  display: grid;
  grid-template-columns: 205px 205px minmax(0,1fr);
  align-items: stretch;
  min-height: 62px;
  margin-top: 2px;
  border: 1px solid #cdd7e5;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(100deg, #fff 0%, #fff7f2 100%);
}

.overall-view-icon {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--dm-navy);
  font-size: 29px;
}

.overall-view-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 14px;
  border-right: 1px solid #9ba9bd;
}

.overall-view-copy strong {
  color: #17366f;
  font-size: 14px;
}

.overall-view-copy span {
  color: var(--dm-orange);
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
}

.overall-view-note {
  display: flex;
  align-items: center;
  padding: 9px 16px;
  color: #1d2939;
  font-size: 16px;
  line-height: 1.35;
}

/* ---------- Footer ---------- */

.daily-data-footer {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 7px 11px;
  border-radius: 5px;
  background: var(--dm-navy);
  color: #fff;
  font-size: 12px;
}

.daily-data-footer > * {
  min-width: 0;
}

.daily-data-footer > :nth-child(2) {
  text-align: center;
}

.daily-data-footer > :last-child {
  text-align: right;
  font-weight: 700;
}

/* ---------- Common generated-content helpers ---------- */

.daily-update-page img {
  max-width: 100%;
}

.daily-update-page table {
  max-width: 100%;
}

.daily-update-page a {
  color: inherit;
}

.daily-update-page .positive,
.daily-update-page .up,
.daily-update-page .gain,
.daily-update-page .bullish {
  color: var(--dm-green) !important;
}

.daily-update-page .negative,
.daily-update-page .down,
.daily-update-page .loss,
.daily-update-page .bearish {
  color: var(--dm-red) !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .daily-row {
    grid-template-columns: 1fr;
  }

  .daily-title-wrap h1 {
    font-size: 30px;
  }

  .overall-view-strip {
    grid-template-columns: 100px 180px minmax(0,1fr);
  }
}

@media (max-width: 640px) {
  .daily-update-page .container {
    width: min(100% - 18px, 1180px);
  }

  .daily-title-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .daily-title-wrap {
    padding-top: 13px;
  }

  .daily-title-wrap h1 {
    font-size: 25px;
  }

  .daily-box {
    padding: 8px;
  }

  .daily-box-title {
    gap: 7px;
  }

  .daily-number {
    flex-basis: 31px;
    width: 31px;
    height: 31px;
    font-size: 16px;
  }

  .daily-box-title h2 {
    font-size: 14px;
  }

  .index-pair,
  .movers-columns,
  .events-columns,
  .factors-columns {
    grid-template-columns: 1fr;
  }

  .global-market-grid {
    grid-template-columns: 1fr 1fr;
  }

  .commodity-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sector-grid {
    grid-template-columns: 1fr;
  }

  .sentiment-layout {
    grid-template-columns: 1fr;
  }

  .gauge-wrap {
    border-right: 0;
    border-bottom: 1px solid var(--dm-border);
    padding: 0 0 9px;
    margin-bottom: 9px;
  }

  .sentiment-text {
    padding: 0 3px 4px;
  }

  .overall-view-strip {
    grid-template-columns: 65px 1fr;
  }

  .overall-view-note {
    grid-column: 1 / -1;
    border-top: 1px solid #d4dbe6;
  }

  .daily-data-footer {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .daily-data-footer > :nth-child(2),
  .daily-data-footer > :last-child {
    text-align: center;
  }

  .flow-table {
    min-width: 470px;
  }
}
