@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

.apd-dashboard {
  --apd-red: #a61f25;
  --apd-red-dark: #7f1419;
  --apd-green: #168a49;
  --apd-down: #cf3038;
  --apd-yellow: #c99112;
  --apd-ink: #17191d;
  --apd-muted: #6f747c;
  --apd-line: #e6e8eb;
  --apd-soft: #f5f6f7;
  direction: rtl;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  isolation: isolate;
  padding: 26px;
  border: 1px solid var(--apd-line);
  border-radius: 8px;
  background: #fff;
  color: var(--apd-ink);
  box-shadow: 0 18px 44px rgba(25, 28, 33, .08);
  font-family: Vazirmatn, Inter, "Segoe UI", Tahoma, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.apd-dashboard * { box-sizing: border-box; letter-spacing: 0; }
.apd-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.apd-heading-copy { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; }
.apd-header h2 { margin: 0; color: var(--apd-title-color, var(--apd-ink)); font-size: 24px; line-height: 1.45; font-weight: 800; }
.apd-eyebrow { display: block; margin-top: 5px; color: var(--apd-subtitle-color, var(--apd-red)); font-size: 12px; line-height: 1.7; font-weight: 750; }
.apd-live { display: flex; align-items: center; gap: 9px; color: var(--apd-muted); font-size: 12px; white-space: nowrap; }
.apd-live i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--apd-green); box-shadow: 0 0 0 5px rgba(22, 138, 73, .12); animation: apd-pulse 2s infinite; }

.apd-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 20px;
  padding: 6px;
  border: 1px solid #e9eaec;
  border-radius: 8px;
  background: var(--apd-soft);
}

.apd-tab-indicator {
  position: absolute;
  z-index: 0;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 6px;
  background: var(--apd-red);
  box-shadow: 0 8px 18px rgba(166, 31, 37, .22);
  transform: translate3d(var(--apd-tab-x, 0), var(--apd-tab-y, 0), 0);
  transition: transform .46s cubic-bezier(.22, 1.25, .36, 1), width .36s ease, height .36s ease;
  will-change: transform, width;
}

.apd-tabs button {
  position: relative;
  z-index: 1;
  appearance: none;
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4e535a;
  cursor: pointer;
  font: 700 13px/1.65 Vazirmatn, Inter, "Segoe UI", Tahoma, Arial, sans-serif;
  transition: color .25s ease, transform .25s ease;
}

.apd-tabs button:hover { color: var(--apd-red); transform: translateY(-1px); }
.apd-tabs button[aria-selected="true"] { color: #fff; }
.apd-tabs button[aria-selected="true"]:hover { color: #fff; }
.apd-tabs button:focus-visible { outline: 3px solid rgba(166, 31, 37, .2); outline-offset: 2px; }
.apd-panel { display: grid; grid-template-columns: minmax(225px, 28%) minmax(0, 1fr); gap: 18px; animation: apd-panel-in .45s cubic-bezier(.2, .75, .25, 1) both; }
.apd-panel[hidden] { display: none; }

.apd-summary { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid var(--apd-line); border-radius: 8px; background: #fff; }
.apd-finish-image { position: relative; min-height: 178px; background: #e8eaed; background-position: center; background-size: cover; }
.apd-finish-image span { position: absolute; right: 14px; bottom: 14px; max-width: calc(100% - 28px); padding: 6px 9px; border-radius: 5px; background: rgba(20, 22, 26, .72); color: #fff; font-size: 12px; font-weight: 700; }
.apd-price-block { padding: 19px; }
.apd-price-block > span { display: block; margin-bottom: 5px; color: var(--apd-muted); font-size: 12px; }
.apd-price { display: block; overflow-wrap: anywhere; font-size: 30px; line-height: 1.35; font-weight: 850; }
.apd-price-block small { display: block; margin-top: 2px; color: var(--apd-muted); font-size: 11px; }
.apd-change { display: flex; align-items: center; gap: 7px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--apd-line); font-size: 11px; font-weight: 700; }
.apd-change b { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: currentColor; color: inherit; font-size: 0; }
.apd-change b::after { color: #fff; font-size: 15px; content: "-"; }
.apd-change.apd-up b::after { content: "\2197"; }
.apd-change.apd-down b::after { content: "\2198"; }
.apd-up { color: var(--apd-green); }
.apd-down { color: var(--apd-down); }
.apd-flat { color: var(--apd-yellow); }

.apd-chart-card { min-width: 0; padding: 19px; border: 1px solid var(--apd-line); border-radius: 8px; background: #fff; }
.apd-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 10px; }
.apd-chart-head > div:first-child span { display: block; color: var(--apd-muted); font-size: 11px; }
.apd-chart-head strong { font-size: 14px; font-weight: 750; }
.apd-legend { display: flex; flex-wrap: wrap; gap: 13px; color: var(--apd-muted); font-size: 10px; }
.apd-legend span { display: flex; align-items: center; gap: 5px; }
.apd-legend i { width: 9px; height: 9px; border-radius: 2px; }
.apd-legend .up { background: var(--apd-green); }
.apd-legend .down { background: var(--apd-down); }
.apd-legend .flat { background: var(--apd-yellow); }
.apd-chart { position: relative; width: 100%; height: 285px; direction: ltr; }
.apd-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.apd-grid-line { stroke: #ebedef; stroke-width: 1; }
.apd-axis-label { fill: #858b93; font: 10px Vazirmatn, Inter, "Segoe UI", Tahoma, Arial, sans-serif; }
.apd-line { fill: none; stroke-width: 3; stroke-linecap: round; }
.apd-dot { cursor: pointer; stroke: #fff; stroke-width: 2; transition: r .2s ease; }
.apd-dot:hover, .apd-dot:focus { r: 7; outline: none; }
.apd-empty { display: grid; height: 100%; place-items: center; border: 1px dashed #dfe1e4; border-radius: 6px; background: #fafbfb; color: var(--apd-muted); text-align: center; }
.apd-tooltip { position: absolute; z-index: 2; pointer-events: none; opacity: 0; transform: translate(-50%, calc(-100% - 8px)); padding: 7px 9px; border-radius: 5px; background: #1d2024; color: #fff; font-size: 10px; white-space: nowrap; transition: opacity .15s ease; }
.apd-tooltip.is-visible { opacity: 1; }

@keyframes apd-panel-in { from { opacity: 0; transform: translateY(10px) scale(.995); } to { opacity: 1; transform: none; } }
@keyframes apd-pulse { 50% { box-shadow: 0 0 0 8px rgba(22, 138, 73, 0); } }

@media (max-width: 840px) {
  .apd-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apd-panel { grid-template-columns: 1fr; }
  .apd-summary { display: grid; grid-template-columns: minmax(180px, 40%) 1fr; }
  .apd-finish-image { min-height: 190px; }
}

@media (max-width: 560px) {
  .apd-dashboard { padding: 15px; }
  .apd-header, .apd-chart-head { align-items: flex-start; flex-direction: column; }
  .apd-header h2 { font-size: 20px; }
  .apd-tabs { display: flex; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: thin; }
  .apd-tabs button { flex: 0 0 148px; }
  .apd-summary { display: block; }
  .apd-chart { height: 245px; }
  .apd-price { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  .apd-dashboard *, .apd-tab-indicator { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
