@font-face {
  font-family: 'Museo';
  src: local('Museo 300'), local('Museo300-Regular'), url('assets/fonts/Museo300-Regular.otf') format('opentype');
  font-weight: 300;
}

@font-face {
  font-family: 'Museo';
  src: local('Museo 500'), local('Museo500-Regular'), url('assets/fonts/Museo500-Regular.otf') format('opentype');
  font-weight: 500;
}

@font-face {
  font-family: 'Museo';
  src: local('Museo 700'), local('Museo700-Regular'), url('assets/fonts/Museo700-Regular.ttf') format('truetype');
  font-weight: 700;
}

@font-face {
  font-family: 'TWO SS G';
  src: local('GE SS Two Light'), local('GE_SS_Two_Light'), url('assets/fonts/GE_SS_Two_Light.otf') format('opentype');
  font-weight: 300;
}

@font-face {
  font-family: 'TWO SS G';
  src: local('GE SS Two Medium'), local('GE_SS_Two_Medium'), url('assets/fonts/GE_SS_Two_Medium.otf') format('opentype');
  font-weight: 500;
}

@font-face {
  font-family: 'TWO SS G';
  src: local('GE SS Two Bold'), local('GE-SS-Two-Bold'), url('assets/fonts/GE-SS-Two-Bold.otf') format('opentype');
  font-weight: 700;
}

:root {
  --accent: #9b0f63;
  --accent-strong: #7d0c50;
  --accent-soft: #eadce4;
  --gold: #c89b2b;
  --ink: #1f2328;
  --muted: #6b655f;
  --surface: rgba(255, 251, 247, 0.9);
  --surface-strong: #fffdfa;
  --surface-soft: #f4ede7;
  --line: rgba(110, 101, 95, 0.18);
  --grid: rgba(155, 15, 99, 0.06);
  --success: #1c7a58;
  --danger: #bc3942;
  --blue: #3f638e;
  --shadow: 0 18px 42px rgba(45, 27, 35, 0.1);
  --shadow-soft: 0 10px 24px rgba(45, 27, 35, 0.07);
  --font-ar: 'TWO SS G', 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif;
  --font-en: 'Museo', 'Aptos', 'Segoe UI', sans-serif;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --space-page: clamp(16px, 2.5vw, 28px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ar);
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 0%, rgba(155, 15, 99, 0.16), transparent 28%),
    radial-gradient(circle at 8% 8%, rgba(200, 155, 43, 0.14), transparent 24%),
    linear-gradient(180deg, #f7f3ef 0%, #f4eee7 48%, #efe7de 100%);
  overflow-x: hidden;
  font-variant-ligatures: common-ligatures;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: auto;
  width: 34vw;
  height: 34vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.3;
  pointer-events: none;
  z-index: -2;
}

body::before {
  top: -12vw;
  right: -10vw;
  background: rgba(155, 15, 99, 0.22);
}

body::after {
  bottom: -14vw;
  left: -8vw;
  background: rgba(200, 155, 43, 0.18);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.12;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at center, black 55%, transparent 100%);
}

#progress {
  position: fixed;
  inset: 0 0 auto;
  height: 4px;
  width: 0;
  z-index: 100;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  box-shadow: 0 0 24px rgba(155, 15, 99, 0.35);
}

.topbar {
  position: sticky;
  top: 0;
  width: 100%;
  margin: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 10px max(22px, calc((100vw - 1280px) / 2));
  background: rgba(255, 253, 250, 0.86);
  backdrop-filter: blur(16px);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 8px 22px rgba(45, 27, 35, 0.05);
}

.brand {
  display: none;
  align-items: center;
  gap: 12px;
  min-width: 148px;
}

.brand > div {
  display: none;
}

.logo {
  width: 136px;
  height: 40px;
  border-radius: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-ar);
  font-size: 0;
  color: transparent;
  background: url('logo%20.png') center / contain no-repeat;
  box-shadow: none;
  flex: 0 0 auto;
}

.brand strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.brand span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-en);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}

nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: 0.2s ease;
}

nav a svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

nav a:hover {
  color: var(--accent);
  background: rgba(155, 15, 99, 0.08);
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.ghost,
.import {
  padding: 9px 13px;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--font-ar);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ghost:hover,
.import:hover {
  transform: translateY(-1px);
}

.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line);
}

.import {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 14px 24px rgba(125, 12, 80, 0.18);
}

.import input {
  display: none;
}

main {
  width: min(1280px, calc(100% - (var(--space-page) * 2)));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 16px;
  align-items: stretch;
}

.dashboard-intro,
.dashboard-stats,
section.story .wrap,
.chartbox,
.table-wrap,
.insights,
footer {
  background: rgba(255, 253, 250, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.dashboard-intro {
  position: relative;
  min-height: 176px;
  padding: 28px 30px;
  padding-inline-end: 330px;
  border-radius: 16px;
  overflow: hidden;
}

.dashboard-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), transparent 52%),
    radial-gradient(circle at 88% 12%, rgba(155, 15, 99, 0.12), transparent 24%),
    radial-gradient(circle at 10% 100%, rgba(200, 155, 43, 0.12), transparent 30%);
  pointer-events: none;
}

.dashboard-intro > * {
  position: relative;
  z-index: 1;
}

.eyebrow,
.tag,
.brand span {
  font-family: var(--font-en);
}

.dashboard-intro .eyebrow {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(155, 15, 99, 0.08);
  white-space: nowrap;
}

.dashboard-intro h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(32px, 3.5vw, 50px);
  line-height: 1.14;
  letter-spacing: 0;
}

.dashboard-intro p {
  max-width: 70ch;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.dashboard-badges {
  position: absolute;
  inset-block-start: 34px;
  inset-inline-end: 36px;
  width: 260px;
  transform: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: stretch;
  gap: 12px;
  margin-top: 0;
}

.status-badge {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 22px rgba(45, 27, 35, 0.06);
}

.status-badge span {
  display: inline;
  margin-bottom: 0;
  margin-inline-end: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.status-badge strong {
  display: inline;
  font-size: 16px;
  color: var(--accent);
  font-family: var(--font-en);
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: center;
}

.hero-logo {
  width: 100%;
  height: 104px;
  border-radius: 0;
  background: url('logo%20.png') center / 250px auto no-repeat;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  align-content: stretch;
}

.metric-card:has(#contractsTotal),
.dashboard-stats .metric-card:nth-child(3) {
  display: none;
}

.metric-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 118px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.metric-card::before,
.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  inset-inline-start: 0;
  width: auto;
  height: 4px;
  background: var(--accent);
  opacity: 0.72;
}

.metric-card:nth-child(2)::before,
.card:nth-child(2n)::before {
  background: var(--gold);
}

.metric-card:nth-child(3)::before,
.card:nth-child(3n)::before {
  background: var(--blue);
}

.metric-card:nth-child(4)::before,
.card:nth-child(4n)::before {
  background: var(--success);
}

.metric-card:nth-child(5)::before {
  background: var(--danger);
}

.metric-card.wide {
  grid-column: auto;
}

.metric-card span {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  min-height: 0;
  font-size: 12px;
  line-height: 1.7;
}

.metric-card strong {
  display: block;
  font-size: clamp(28px, 2.8vw, 42px);
  color: var(--ink);
  font-family: var(--font-en);
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: right;
}

section.story {
  margin-bottom: 14px;
}

section.story .wrap {
  padding: 20px;
  border-radius: 16px;
}

section.story.soft .wrap {
  background: linear-gradient(180deg, rgba(247, 242, 237, 0.94), rgba(252, 248, 243, 0.96));
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: clamp(19px, 1.6vw, 23px);
  line-height: 1.35;
}

.section-head h2::before {
  content: '';
  width: 10px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--gold));
  flex: 0 0 auto;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(155, 15, 99, 0.08);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

#kpiCards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  position: relative;
  min-height: 122px;
  padding: 15px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.82);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.card::after {
  content: '';
  position: absolute;
  inset-block-end: -28px;
  inset-inline-start: -28px;
  width: 86px;
  height: 86px;
  border: 1px solid rgba(155, 15, 99, 0.08);
  border-radius: 50%;
  opacity: 0.8;
}

.card:hover,
.metric-card:hover,
.chartbox:hover {
  transform: translateY(-2px);
}

.metric-card:hover,
.chartbox:hover {
  box-shadow: 0 20px 44px rgba(45, 27, 35, 0.11);
}

.card:hover {
  background: rgba(255, 255, 255, 0.84);
}

.card-meta,
.card span,
.card small {
  display: block;
}

.card-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.card svg {
  width: 24px;
  height: 24px;
  padding: 5px;
  border-radius: 8px;
  color: var(--accent);
  background: rgba(155, 15, 99, 0.08);
  stroke-width: 2.2;
  box-sizing: content-box;
  flex: 0 0 auto;
}

.card:nth-child(2n) svg {
  color: var(--gold);
  background: rgba(200, 155, 43, 0.12);
}

.card:nth-child(3n) svg {
  color: var(--blue);
  background: rgba(63, 99, 142, 0.1);
}

.card strong {
  position: relative;
  z-index: 1;
  margin: 12px 0 8px;
  font-size: clamp(28px, 2.5vw, 36px);
  color: var(--accent);
  font-family: var(--font-en);
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: right;
}

.num {
  font-family: var(--font-en);
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: right;
}

.latin-digits {
  font-family: var(--font-en);
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: lining-nums;
  text-align: inherit;
}

.card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.grid2,
.grid13 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.region-secondary {
  margin-top: 12px;
}

.chartbox,
.table-wrap,
.insights {
  border-radius: 12px;
}

.chartbox {
  padding: 16px;
  transition: transform 0.2s ease;
}

.chartbox h3 {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.45;
}

.canvas {
  height: clamp(300px, 31vw, 350px);
}

.canvas.tall {
  height: clamp(380px, 42vw, 500px);
}

.table-wrap {
  margin-top: 14px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

table thead {
  background: rgba(155, 15, 99, 0.05);
}

table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-strong);
  box-shadow: 0 1px 0 rgba(107, 101, 95, 0.12);
}

table th,
table td {
  padding: 12px 15px;
  text-align: right;
  border-bottom: 1px solid rgba(107, 101, 95, 0.12);
  vertical-align: middle;
}

table.matrix th:first-child,
table.matrix td:first-child {
  width: 72px;
}

table th {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.04em;
}

table td {
  font-size: 14px;
  background: rgba(255, 255, 255, 0.48);
  line-height: 1.65;
}

table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.32);
}

table tbody tr:hover td {
  background: rgba(155, 15, 99, 0.045);
}

.heat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  font-family: var(--font-en);
  font-size: 12px;
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: center;
}

.rank {
  color: var(--muted);
  font-family: var(--font-en);
  font-size: 12px;
  direction: ltr;
  unicode-bidi: plaintext;
}

.insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  color: var(--ink);
  line-height: 1.6;
  font-size: 14px;
}

.insights b {
  color: var(--accent);
  font-family: var(--font-en);
}

.insight-card {
  position: relative;
  min-height: 138px;
  padding: 16px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 250, 246, 0.72)),
    radial-gradient(circle at 0% 100%, rgba(155, 15, 99, 0.08), transparent 42%);
  border: 1px solid rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

.insight-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.insight-card svg {
  width: 30px;
  height: 30px;
  padding: 7px;
  margin-bottom: 14px;
  border-radius: 10px;
  color: var(--accent);
  background: rgba(155, 15, 99, 0.09);
  stroke-width: 2.1;
  box-sizing: content-box;
}

.insight-card span,
.insight-card strong,
.insight-card em {
  position: relative;
  z-index: 1;
  display: block;
}

.insight-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.insight-card strong {
  margin-top: 6px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
}

.insight-card em {
  margin-top: 10px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.insight-card em b {
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}

footer {
  margin-top: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

footer h2,
footer p,
footer small {
  margin: 0;
}

footer h2 {
  font-size: 16px;
}

footer p {
  color: var(--muted);
  font-size: 13px;
}

footer small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.fade {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.fade.show {
  opacity: 1;
  transform: translateY(0);
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-thumb {
  background: rgba(155, 15, 99, 0.24);
  border-radius: 999px;
  border: 3px solid rgba(0, 0, 0, 0);
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
    position: sticky;
    top: 12px;
    left: auto;
    right: auto;
    width: auto;
    margin: 0;
    padding-inline: var(--space-page);
  }

  main {
    padding-top: 18px;
  }

  nav,
  .actions {
    justify-content: center;
  }

  .dashboard-shell,
  .grid2,
  .grid13 {
    grid-template-columns: 1fr;
  }

  .dashboard-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-intro h1 {
    max-width: 100%;
  }

  .dashboard-intro {
    min-height: 0;
    padding-inline-end: 20px;
  }

  .dashboard-badges {
    position: static;
    width: auto;
    transform: none;
    justify-content: flex-start;
    margin-top: 16px;
  }

  .status-badge {
    width: auto;
    min-width: 190px;
  }

  .hero-logo {
    width: 220px;
    height: 86px;
    background-size: 210px auto;
  }

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

  #kpiCards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  main {
    width: calc(100% - 18px);
    padding-top: 14px;
  }

  .topbar {
    position: sticky;
    top: 8px;
    left: auto;
    right: auto;
    width: auto;
    padding: 12px;
    margin: 8px 9px 0;
  }

  .brand {
    min-width: 0;
  }

  .brand strong {
    white-space: normal;
    line-height: 1.5;
  }

  nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 2px;
  }

  nav a {
    flex: 0 0 auto;
    padding: 8px 11px;
    font-size: 11px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ghost,
  .import {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    text-align: center;
  }

  .dashboard-intro,
  .dashboard-stats,
  section.story .wrap {
    padding: 16px;
  }

  .dashboard-intro {
    padding-inline-end: 16px;
  }

  .dashboard-intro .eyebrow {
    white-space: normal;
  }

  .dashboard-stats,
  .cards {
    grid-template-columns: 1fr;
  }

  #kpiCards {
    grid-template-columns: 1fr;
  }

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

  .metric-card.wide {
    grid-column: span 1;
  }

  .section-head,
  footer {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-intro h1 {
    font-size: 28px;
  }

  .section-head h2 {
    font-size: 20px;
  }

  .tag {
    align-self: flex-start;
  }

  .dashboard-badges {
    display: grid;
  }

  .status-badge {
    width: 100%;
    min-width: 0;
    border-radius: 12px;
  }

  .status-badge span,
  .status-badge strong {
    display: block;
    text-align: right;
  }

  .status-badge span {
    margin: 0 0 6px;
  }

  .hero-logo {
    width: 180px;
    height: 72px;
    background-size: 170px auto;
  }

  .canvas,
  .canvas.tall {
    height: 280px;
  }

  .chartbox,
  .table-wrap,
  .insights {
    border-radius: 16px;
  }

  table {
    min-width: 560px;
  }

  table th,
  table td {
    padding: 10px 12px;
  }
}
