/* ================= بوابة خدمة ما بعد البيع ================= */

.sup-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 85% 5%, rgba(25, 155, 180, 0.07), transparent 60%),
    var(--cream);
}

.sup-header { position: sticky; top: 0; z-index: 40; }
.sup-header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px 16px;
  max-width: 760px; margin: 0 auto;
}
.sup-header h1 { color: #fff; font-size: 1.5rem; }

.sup-main { max-width: 760px; margin: 0 auto; padding: 26px 16px 80px; }
.sup-card { margin-bottom: 16px; }
.sup-card h2 { font-size: 1.5rem; margin-bottom: 4px; }

.sup-who {
  display: flex; align-items: baseline; gap: 8px;
  padding-bottom: 10px; margin-bottom: 12px;
  border-bottom: 1px solid var(--cream-2);
}
#who-name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--night); }

/* ---------- التنويه الإلزامي ---------- */

.notice-box {
  background: var(--coral-soft);
  border: 1.5px solid var(--coral);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.notice-title { font-weight: 700; color: var(--coral); margin-bottom: 4px; font-size: 1.05rem; }
.notice-box p { color: #7d2f1c; font-weight: 600; line-height: 1.7; }
.notice-accept {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; font-weight: 700; color: var(--night);
  cursor: pointer;
}
.notice-accept input { width: 20px; height: 20px; accent-color: var(--coral); }

/* ---------- أنواع الشكاوى ---------- */

.type-grid { display: grid; gap: 10px; }
.type-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  align-items: center;
  text-align: right;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: inherit;
  transition: all 0.15s;
}
.type-card:hover { border-color: var(--brass); background: var(--brass-pale); }
.type-card .ico { grid-row: 1 / 3; font-size: 1.9rem; }
.type-card b { font-size: 1.08rem; color: var(--night); }
.type-card small { color: var(--ink-soft); font-size: 0.85rem; }

/* ---------- اختيار منتج من الفاتورة ---------- */

.inv-pick { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.inv-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  cursor: pointer;
  background: #fff;
}
.inv-item.on { border-color: var(--brass); background: var(--brass-pale); }
.inv-item input { width: 18px; height: 18px; accent-color: var(--brass); }
.inv-item .nm { font-weight: 700; font-size: 0.96rem; }
.inv-item .mt { font-size: 0.8rem; color: var(--ink-soft); }

.img-preview {
  width: 100%; max-height: 260px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin-top: 8px;
  background: var(--cream-2);
}

/* ---------- لوحة التتبع ---------- */

.track-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.track-head h2 { font-size: 1.6rem; }

.tr-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}
.tr-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap;
  background: var(--cream-2);
  padding: 10px 14px;
}
.tr-code { font-family: var(--font-num); font-weight: 700; color: var(--night); }
.tr-body { padding: 12px 14px; }
.tr-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 2px; }
.tr-img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

/* خط المراحل */
.tr-steps { display: flex; flex-direction: column; gap: 0; margin-top: 12px; }
.tr-step {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
}
.tr-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  display: grid; place-items: center;
  font-size: 0.72rem;
  color: var(--ink-soft);
  position: relative;
}
.tr-step.done .tr-dot { background: var(--mint); border-color: var(--mint); color: #fff; }
.tr-step.current .tr-dot {
  border-color: var(--brass);
  background: var(--brass);
  color: #3d2506;
  box-shadow: 0 0 0 4px rgba(226, 138, 37, 0.25);
}
.tr-line {
  grid-column: 1;
  width: 2px; height: 16px;
  background: var(--line);
  margin: 0 auto;
}
.tr-step.done + .tr-line, .tr-line.done { background: var(--mint); }
.tr-label { font-size: 0.94rem; padding-top: 1px; }
.tr-step.current .tr-label { font-weight: 700; color: var(--night); }
.tr-step:not(.done):not(.current) .tr-label { color: var(--ink-soft); }

.tr-rejected {
  background: var(--coral-soft);
  color: var(--coral);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-weight: 700;
  margin-top: 10px;
}
.tr-adminnote {
  background: var(--brass-pale);
  color: #8a4d0e;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.9rem;
  margin-top: 10px;
}

@media (max-width: 560px) {
  .type-card { grid-template-columns: 38px 1fr; }
  .sup-header h1 { font-size: 1.2rem; }
}


/* ═══════════════ دردشة الشكوى — جانب الطالب ═══════════════ */
.ch-bar {
  display: flex; align-items: center; gap: .6em; flex-wrap: wrap;
  margin-top: .7em; padding: .5em .7em;
  border-radius: var(--radius-sm); font-size: .9rem;
}
.ch-bar.closed { background: #f2f5f7; color: #6b7f92; border: 1px dashed #ccd8e2; }
.ch-bar.open { background: #e3f3f7; color: #14707f; border: 1px solid #b9e2ea; }
.ch-bar button { margin-inline-start: auto; }
.ch-badge {
  display: inline-block; background: #fff; color: var(--brass);
  border-radius: 999px; padding: 0 .45em; font-weight: 800; font-size: .78rem;
}
.ch-box {
  margin-top: .6em; padding: .7em;
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius);
}
.ch-thread {
  height: 300px; overflow-y: auto; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .7em; display: flex; flex-direction: column; gap: .5em;
}
.ch-empty { margin: auto; color: var(--ink-soft); font-size: .9rem; }
.ch-msg { display: flex; }
.ch-msg.mine { justify-content: flex-start; }
.ch-msg.theirs { justify-content: flex-end; }
.ch-bubble {
  max-width: min(80%, 430px); background: #f4f8fa;
  border: 1px solid var(--line); border-radius: 14px; padding: .55em .75em;
}
.ch-msg.mine .ch-bubble { background: var(--night); color: #fff; border-color: transparent; }
.ch-msg.mine .ch-meta { color: rgba(255,255,255,.72); }
.ch-text { white-space: pre-wrap; line-height: 1.55; word-break: break-word; }
.ch-meta { font-size: .7rem; color: var(--ink-soft); margin-top: .3em; }
.ch-img {
  display: block; max-width: 100%; max-height: 200px;
  border-radius: 10px; margin-bottom: .4em; cursor: zoom-in; background: #fff;
}
.ch-note { font-size: .76rem; color: var(--ink-soft); margin: .4em 0; text-align: center; }
.ch-compose { display: flex; flex-direction: column; gap: .5em; }
.ch-compose textarea { resize: vertical; width: 100%; }
.ch-actions { display: flex; gap: .5em; justify-content: flex-end; align-items: center; }
.ch-file { cursor: pointer; }
.ch-preview {
  max-height: 100px; align-self: flex-start;
  border-radius: 10px; border: 1px solid var(--line); background: #fff;
}
