/* ===== لوحتي ===== (shares .sd-* panels, KPIs and bars with the owner's sales dashboard) */
.md { display: flex; flex-direction: column; gap: 16px; }
.md-who { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: .82rem; }
.md-who select { border: 1.5px solid var(--line); border-radius: 10px; padding: .35rem .6rem; font-family: inherit; font-weight: 700; max-width: 220px; }

.md-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(260px, 340px); gap: 20px; align-items: center;
  background: linear-gradient(135deg, #1d1a14 0%, #2b2418 55%, #3a2c14 100%); color: #fff; border-radius: 18px; padding: 22px 24px; box-shadow: var(--shadow); }
.md-hero__rank { width: 112px; height: 112px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .08); border: 3px solid rgba(255, 255, 255, .25); }
.md-hero__rank b { font-size: 2.6rem; line-height: 1; font-weight: 900; }
.md-hero__rank small { font-size: .74rem; font-weight: 800; opacity: .85; }
.md-hero__rank.is-gold { background: var(--grad); color: #231a08; border-color: #ffd889; box-shadow: 0 0 0 6px rgba(247, 147, 30, .25); }
.md-hero__rank.is-top { border-color: var(--orange); }
.md-hero__rank.is-low { border-color: #f87171; background: rgba(225, 29, 72, .18); }
.md-hero__main h2 { font-size: 1.05rem; font-weight: 800; opacity: .85; margin-bottom: 2px; }
.md-hero__sale b { font-size: 2.4rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.md-hero__sale span { font-weight: 800; opacity: .8; font-size: .9rem; }
.md-hero p { margin-top: 6px; font-size: .88rem; font-weight: 700; line-height: 1.7; opacity: .92; }
.md-hero p b { color: #ffc56b; }
.md-hero .md-hero__m { opacity: .7; font-size: .8rem; }
.md-hero .sd-delta small { color: rgba(255, 255, 255, .65); }
.md-hero .sd-delta.is-up { color: #4ade80; }
.md-hero .sd-delta.is-down { color: #fb7185; }

.md-target { background: #fff; color: var(--ink); border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.md-target ul { list-style: none; flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.md-target li { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.md-target li b { color: var(--ink); }
.md-target li.is-bad b { color: var(--red); }
.md-target li.is-good b { color: var(--green); }
/* No published target: the box is left out and the hero has two columns. */
.md-hero.md-hero--solo { grid-template-columns: auto minmax(0, 1fr); }
.md-gauge svg { width: 120px; display: block; }
.md-g-bg, .md-g-fg { fill: none; stroke-width: 14; stroke-linecap: round; }
.md-g-bg { stroke: #eef1f5; }
.md-gauge.is-ok .md-g-fg { stroke: var(--green); }
.md-gauge.is-late .md-g-fg { stroke: var(--red); }
.md-g-mark { fill: var(--ink); stroke: #fff; stroke-width: 2; }
.md-g-v { font-size: 22px; font-weight: 900; fill: var(--ink); font-family: "Cairo", sans-serif; }
.md-g-s { font-size: 10px; font-weight: 700; fill: var(--muted); font-family: "Cairo", sans-serif; }

.md-alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.md-alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 10px 14px; font-weight: 800; font-size: .86rem; line-height: 1.7; border: 1px solid; }
.md-alert svg { flex: 0 0 auto; margin-top: 3px; }
.md-alert.is-bad { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.md-alert.is-warn { background: #fff8e6; border-color: #fde68a; color: #92400e; }
.md-alert.is-good { background: #ecfdf3; border-color: #bbf7d0; color: #166534; }

.md-ln { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.md-ln.is-me { stroke: var(--orange); stroke-width: 4; }
.md-ln.is-prev { stroke: #94a3b8; stroke-dasharray: 6 5; }
.md-ln.is-rival { stroke: var(--red); }
.md-ln.is-avg { stroke: var(--blue); stroke-dasharray: 2 5; }
.md-area { fill: rgba(247, 147, 30, .12); }
.md-pt { stroke: #fff; stroke-width: 2; }
.md-pt.is-me { fill: var(--orange); } .md-pt.is-prev { fill: #94a3b8; } .md-pt.is-rival { fill: var(--red); } .md-pt.is-avg { fill: var(--blue); }
.md-legend { flex-wrap: wrap; }
.md-legend i.is-me { background: var(--orange); } .md-legend i.is-prev { background: #94a3b8; } .md-legend i.is-rival { background: var(--red); } .md-legend i.is-avg { background: var(--blue); }
.md-legend b { color: var(--ink); }

.md-board { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.md-board li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: .82rem; color: var(--muted); font-weight: 700; }
.md-board__p { width: 24px; height: 24px; border-radius: 50%; background: #f4f6fa; display: grid; place-items: center; font-weight: 900; font-size: .74rem; }
.md-board__t { height: 10px; background: #f1f3f7; border-radius: 99px; overflow: hidden; }
.md-board__t > div { height: 100%; background: #cbd5e1; border-radius: 99px; }
.md-board li.is-me { color: var(--ink); }
.md-board li.is-me .md-board__p { background: var(--grad); color: #231a08; }
.md-board li.is-me .md-board__t > div { background: var(--grad); }
.md-board li.is-me .md-board__t { height: 14px; outline: 2px solid var(--orange); outline-offset: 1px; }

.md-list { list-style: none; display: flex; flex-direction: column; }
.md-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: .86rem; transition: background .15s; }
.md-list li:hover { background: #fffaf2; }
.md-list li:last-child { border-bottom: 0; }
.md-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 700; }
.md-list li em { font-style: normal; font-weight: 900; }
.md-bad { color: var(--red); }

@media (max-width: 1100px) {
  .md-hero { grid-template-columns: auto minmax(0, 1fr); }
  .md-hero .md-target { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .md-hero, .md-hero.md-hero--solo { grid-template-columns: minmax(0, 1fr); padding: 18px; text-align: center; justify-items: center; }
  .md-hero__rank { width: 92px; height: 92px; }
  .md-hero__rank b { font-size: 2.1rem; }
  .md-hero__sale b { font-size: 2rem; }
  .md-target { width: 100%; text-align: start; }
  .md-alerts { grid-template-columns: minmax(0, 1fr); }
  .md-who select { max-width: 150px; }
}

/* ===== اختصاراتي + المساعد (top of «لوحتي») ===== */
.md-quick { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.md-quick__sc, .md-quick__ask { min-width: 0; }
.msc { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); height: 100%; }
.msc__h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.msc__h h3 { font-size: 1rem; font-weight: 900; }
.msc__h small { display: block; color: var(--muted); font-size: .78rem; font-weight: 700; margin-top: 2px; }
.msc__g { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.msc__t { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: start; padding: 12px;
  background: #fafbfd; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-family: inherit; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s; min-height: 92px; }
.msc__t:hover, .msc__t:focus-visible { border-color: var(--orange); background: #fff; box-shadow: 0 6px 16px rgba(247, 147, 30, .14); transform: translateY(-1px); outline: none; }
.msc__i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #fff4e5; color: var(--orange-d); }
.msc__i svg { width: 18px; height: 18px; }
.msc__t b { font-size: .88rem; font-weight: 900; }
.msc__t small { font-size: .72rem; color: var(--muted); font-weight: 700; line-height: 1.5; }
.msc__t.is-off { opacity: .55; border-style: dashed; }
.msc__t.is-on { border-color: var(--green); background: #f0fdf4; }
.msc__pin { position: absolute; inset-inline-end: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: .75rem; font-weight: 900; background: #fff; border: 1.5px solid var(--line); }
.msc__t.is-on .msc__pin { background: var(--green); border-color: var(--green); color: #fff; }
.md-quick .ha--dock { height: 100%; min-height: 380px; max-height: 470px; max-width: none; border-color: var(--line); box-shadow: var(--shadow); }
@media (max-width: 980px) { .md-quick { grid-template-columns: minmax(0, 1fr); } .md-quick .ha--dock { height: 440px; } }
@media (max-width: 520px) { .msc__g { grid-template-columns: repeat(2, minmax(0, 1fr)); } .msc__t { min-height: 84px; padding: 10px; } }
