/* صفحة تتبع التذكرة العامة — واجهة جذابة واحترافية */

.stq-page {
  padding: 40px 0 88px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(45, 106, 79, 0.08) 0%, transparent 55%),
    radial-gradient(90% 60% at 0% 100%, rgba(99, 102, 241, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #f0fdf9 0%, #f8fafc 35%, #f1f5f9 100%);
  min-height: 56vh;
}

.stq-container {
  max-width: 680px;
}

.stq-breadcrumb {
  margin-bottom: 18px;
}

.stq-card {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 16px 48px rgba(27, 67, 50, 0.1);
  overflow: hidden;
}

.stq-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 0;
  height: 4px;
  background: linear-gradient(90deg, #1b4332, #2d6a4f, #40916c);
}

.stq-hero {
  margin-bottom: 22px;
}

.stq-hero__badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #166534;
  background: linear-gradient(180deg, #ecfdf5, #d1fae5);
  border: 1px solid #86efac;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.stq-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 3.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f291e;
  line-height: 1.25;
}

.stq-lead {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.75;
  color: #475569;
  max-width: 52ch;
}

.stq-lookup {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 22px;
}

.stq-lookup__field {
  flex: 1;
  min-width: 200px;
}

.stq-input-token {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.88rem;
  direction: ltr;
  text-align: left;
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.stq-input-token:focus {
  outline: none;
  border-color: #2d6a4f;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.12);
}

.stq-lookup .btn-accent {
  padding-inline: 22px;
  border-radius: 14px;
  font-weight: 800;
  min-height: 48px;
}

.stq-thread[hidden] {
  display: none !important;
}

.stq-meta {
  margin-bottom: 20px;
  padding: 18px 20px;
  border-radius: 16px;
  background: linear-gradient(145deg, #f8fafc 0%, #fff 100%);
  border: 1px solid #e8ecf1;
}

.stq-meta__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.stq-meta__id {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  font-weight: 800;
  color: #64748b;
  background: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.stq-meta__subject {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}

.stq-meta__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.stq-pill {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.stq-pill--open { background: #dcfce7; color: #14532d; border-color: #bbf7d0; }
.stq-pill--pending_customer { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.stq-pill--answered { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.stq-pill--closed { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.stq-pill--unk { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.stq-pill--cat {
  background: #fff;
  color: #334155;
  border-color: #e2e8f0;
}

.stq-meta__date {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.stq-msgs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.stq-msg {
  border-radius: 16px;
  padding: 14px 16px 16px;
  border: 1px solid #e8ecf1;
  max-width: 100%;
  animation: stq-fade 0.35s ease-out;
}

@keyframes stq-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.stq-msg--customer {
  background: #fff;
  border-inline-end: 3px solid #2d6a4f;
  margin-inline-end: 12%;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.stq-msg--staff {
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
  border-inline-start: 3px solid #22c55e;
  margin-inline-start: 8%;
  box-shadow: 0 2px 14px rgba(45, 106, 79, 0.08);
}

.stq-msg--system {
  background: #fafafa;
  border-inline-start: 3px solid #cbd5e1;
  font-size: 0.95rem;
}

.stq-msg__head {
  font-size: 0.78rem;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.stq-msg__who {
  color: #1e293b;
  font-weight: 800;
}

.stq-msg__time {
  font-weight: 600;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.stq-msg__body {
  white-space: pre-wrap;
  line-height: 1.75;
  font-size: 0.95rem;
  color: #1e293b;
}

.stq-divider {
  margin: 28px 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0 20%, #e2e8f0 80%, transparent);
}

.stq-reply h2 {
  margin: 0 0 12px;
  font-size: 1.08rem;
  font-weight: 800;
  color: #0f291e;
}

.stq-reply__hint {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 12px;
  line-height: 1.55;
}

.stq-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stq-textarea:focus {
  outline: none;
  border-color: #2d6a4f;
  box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.1);
}

.stq-reply .btn-accent {
  margin-top: 12px;
  border-radius: 14px;
  font-weight: 800;
  padding: 12px 24px;
}

.stq-reply-msg {
  margin-top: 12px;
  font-size: 0.9rem;
  font-weight: 600;
}

.stq-err {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-weight: 700;
  font-size: 0.9rem;
}

.stq-err[hidden] {
  display: none !important;
}

@media (max-width: 520px) {
  .stq-msg--customer { margin-inline-end: 0; }
  .stq-msg--staff { margin-inline-start: 0; }
}
