/* ==========================================================================
   TKT-25 — صفحات الدعم الفني للعميل (فتح التذكرة + الأسئلة الشائعة + صفحة التذكرة)
   بنفس لغة مكتب الدعم (nh-desk.css): المتغيرات --d-* والزوايا 10–14px.
   يُحمَّل مع nh-desk.css. مستقل عن ملف Tailwind المبني.
   ========================================================================== */

.nhs { max-width: 80rem; margin: 0 auto; padding: 8px 16px 48px; }
@media (min-width: 640px) { .nhs { padding: 8px 24px 56px; } }
@media (min-width: 1024px) { .nhs { padding: 8px 32px 64px; } }
.nhs [hidden] { display: none !important; }

/* مسار التنقل */
.nhs-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 18px; font-size: 13px; color: var(--d-fg-3); }
.nhs-crumbs a { color: var(--d-fg-2); text-decoration: none; }
.nhs-crumbs a:hover { color: var(--d-accent); }
.nhs-crumbs [aria-current] { color: var(--d-fg); font-weight: 600; max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── TKT-24: رأس صفحة الدعم — البحث أولاً ─────────────────────────────── */
.nhs-hero { background: var(--d-soft); border: 1px solid var(--d-line); border-radius: 16px; padding: 28px 20px; margin-bottom: 28px; text-align: center; }
@media (min-width: 768px) { .nhs-hero { padding: 40px 32px; } }
.nhs-hero h1 { margin: 0; font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.01em; color: var(--d-fg); }
.nhs-hero p { margin: 8px auto 0; max-width: 40rem; font-size: 14px; line-height: 1.7; color: var(--d-fg-2); }
.nhs-search { position: relative; max-width: 42rem; margin: 20px auto 0; text-align: start; }
.nhs-search input { width: 100%; height: 52px; padding: 0 18px; padding-inline-start: 46px; font: inherit; font-size: 15px; color: var(--d-fg); background: var(--d-bg); border: 1px solid var(--d-line); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.nhs-search input:focus { outline: 0; border-color: var(--d-accent); box-shadow: 0 0 0 3px rgba(81,186,116,.18); }
.nhs-search > i { position: absolute; inset-inline-start: 17px; top: 26px; transform: translateY(-50%); color: var(--d-fg-3); font-size: 15px; }
.nhs-search__docs { margin-top: 8px; background: var(--d-bg); border: 1px solid var(--d-line); border-radius: 12px; overflow: hidden; }
.nhs-search__docs p { margin: 0; padding: 10px 14px 6px; font-size: 12px; font-weight: 600; color: var(--d-fg-3); }
.nhs-search__docs a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 13.5px; color: var(--d-fg); text-decoration: none; border-top: 1px solid var(--d-line); }
.nhs-search__docs a:hover { background: var(--d-hover); color: var(--d-accent); }
.nhs-search__docs a i { color: var(--d-fg-3); font-size: 12px; }
.nhs-hero__meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 16px; font-size: 12.5px; color: var(--d-fg-2); }
.nhs-hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
.nhs-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--d-fg-3); }
.nhs-dot--on { background: var(--d-accent); }
.nhs-hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }

/* ── الأقسام ─────────────────────────────────────────────────────────── */
.nhs-section { margin-bottom: 28px; scroll-margin-top: 90px; }
.nhs-section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.nhs-section__head h2 { margin: 0; font-size: 18px; font-weight: 800; color: var(--d-fg); }
.nhs-section__head p { margin: 4px 0 0; font-size: 13px; color: var(--d-fg-2); }

/* الأسئلة الشائعة */
.nhs-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.nhs-cats button { padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--d-fg-2); background: var(--d-bg); border: 1px solid var(--d-line); border-radius: 999px; cursor: pointer; }
.nhs-cats button:hover { border-color: var(--d-accent); color: var(--d-fg); }
.nhs-cats button[aria-pressed="true"] { background: var(--d-primary); border-color: var(--d-primary); color: #fff; }
.nhs-faq { display: grid; grid-template-columns: 1fr; gap: 8px 16px; }
@media (min-width: 1024px) { .nhs-faq { grid-template-columns: 1fr 1fr; align-items: start; } }
.nhs-q { background: var(--d-bg); border: 1px solid var(--d-line); border-radius: 12px; }
.nhs-q[open] { border-color: rgba(81,186,116,.5); }
.nhs-q summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font-size: 14px; font-weight: 600; color: var(--d-fg); }
.nhs-q summary::-webkit-details-marker { display: none; }
.nhs-q summary::after { content: '\f107'; font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free'; font-weight: 900; font-size: 12px; color: var(--d-fg-3); transition: transform .15s; }
.nhs-q[open] summary::after { transform: rotate(180deg); color: var(--d-accent); }
.nhs-q summary:focus-visible { outline: 2px solid var(--d-accent); outline-offset: 2px; border-radius: 12px; }
.nhs-q__a { padding: 0 16px 14px; font-size: 13.5px; line-height: 1.85; color: var(--d-fg-2); }
.nhs-q__a a { color: var(--d-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.nhs-vote { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--d-line); font-size: 12px; color: var(--d-fg-3); }
.nhs-vote button { padding: 3px 10px; font: inherit; font-size: 12px; color: var(--d-fg-2); background: var(--d-bg); border: 1px solid var(--d-line); border-radius: 8px; cursor: pointer; }
.nhs-vote button:hover { border-color: var(--d-accent); }
.nhs-vote a { color: var(--d-accent); font-weight: 600; }
.nhs-empty { padding: 14px 16px; font-size: 13px; color: var(--d-fg-2); background: var(--d-soft); border: 1px dashed var(--d-line); border-radius: 12px; }

/* ── نموذج التذكرة ───────────────────────────────────────────────────── */
.nhs-form { padding: 20px; }
@media (min-width: 768px) { .nhs-form { padding: 28px; } }
.nhs-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) { .nhs-grid--2 { grid-template-columns: 1fr 1fr; } }
.nhs-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nhs-field + .nhs-field, .nhs-grid + .nhs-field, .nhs-field + .nhs-grid, .nhs-grid + .nhs-grid { margin-top: 16px; }
.nhs-label { font-size: 13px; font-weight: 600; color: var(--d-fg); }
.nhs-label .req { color: #d92d20; }
.nhs-input, .nhs-select, .nhs-textarea { width: 100%; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--d-fg); background: var(--d-bg); border: 1px solid var(--d-line); border-radius: 10px; }
.nhs-input:focus, .nhs-select:focus, .nhs-textarea:focus { outline: 0; border-color: var(--d-accent); box-shadow: 0 0 0 3px rgba(81,186,116,.18); }
.nhs-input:disabled, .nhs-select:disabled { opacity: .6; }
.nhs-textarea { min-height: 150px; resize: vertical; line-height: 1.7; }
.nhs-hint { margin: 0; font-size: 12px; color: var(--d-fg-3); }
.nhs-error { margin: 0; font-size: 12.5px; font-weight: 600; color: #d92d20; }
.nhs-extra { margin-top: 16px; padding: 16px; background: var(--d-soft); border: 1px solid var(--d-line); border-radius: 12px; }
.nhs-extra legend { padding: 0; font-size: 13px; font-weight: 700; color: var(--d-fg); }
.nhs-extra .nhs-hint { margin: 2px 0 12px; }
.nhs-sugg { margin-top: 4px; padding: 10px 12px; font-size: 13px; background: var(--d-soft); border-radius: 10px; }
.nhs-sugg p { margin: 0 0 4px; font-weight: 600; color: var(--d-fg); }
.nhs-sugg ul { margin: 0; padding-inline-start: 18px; }
.nhs-sugg a { color: var(--d-accent); font-weight: 600; }
.nhs-drop { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px dashed var(--d-line); border-radius: 12px; cursor: pointer; }
.nhs-drop:hover { border-color: var(--d-accent); background: var(--d-hover); }
.nhs-drop i { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(81,186,116,.12); color: var(--d-accent); }
.nhs-drop strong { display: block; font-size: 13.5px; color: var(--d-fg); }
.nhs-drop span { font-size: 12px; color: var(--d-fg-3); }
.nhs-files { font-size: 12.5px; font-weight: 600; color: var(--d-accent); word-break: break-all; }
.nhs-form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--d-line); }
.nhs-form__foot small { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--d-fg-3); }
.nhs-btn-lg { padding: 11px 22px; font-size: 14px; font-weight: 600; }
.nhs-btn-lg[disabled] { opacity: .6; cursor: wait; }
.nhs-auth { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 10px 12px; background: var(--d-soft); border-radius: 12px; }
.nhs-auth__avatar { width: 36px; height: 36px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 999px; background: var(--d-primary); color: #fff; font-weight: 700; }
.nhs-auth__avatar img { width: 100%; height: 100%; object-fit: cover; }
.nhs-auth b { display: block; font-size: 13.5px; color: var(--d-fg); }
.nhs-auth span { font-size: 12px; color: var(--d-fg-3); }

/* تنبيهات */
.nhs-note { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.65; color: var(--d-fg); background: #f0faf4; border: 1px solid #cdebd8; border-radius: 12px; }
.nhs-note i { margin-top: 3px; color: var(--d-accent); }
.nhs-note a { color: var(--d-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.nhs-note--warn { background: #fffaeb; border-color: #fde7b0; }
.nhs-note--warn i { color: #b54708; }
.dark .nhs-note { background: rgba(81,186,116,.1); border-color: rgba(81,186,116,.3); }
.dark .nhs-note--warn { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); }
.nhs-note__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ── TKT-26: شريط حالة التذكرة ───────────────────────────────────────── */
.nhs-steps { display: flex; margin: 0; padding: 16px 20px 18px; list-style: none; border-top: 1px solid var(--d-line); counter-reset: step; }
.nhs-step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; color: var(--d-fg-3); }
.nhs-step::before { content: ''; position: absolute; top: 11px; inset-inline-start: calc(-50% + 14px); inset-inline-end: calc(50% + 14px); height: 2px; background: var(--d-line); }
.nhs-step:first-child::before { display: none; }
.nhs-step__dot { position: relative; z-index: 1; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--d-bg); border: 2px solid var(--d-line); color: var(--d-fg-3); }
.nhs-step.is-done { color: var(--d-fg-2); }
.nhs-step.is-done::before, .nhs-step.is-current::before { background: var(--d-accent); }
.nhs-step.is-done .nhs-step__dot { background: var(--d-accent); border-color: var(--d-accent); color: #fff; }
.nhs-step.is-current { color: var(--d-fg); font-weight: 700; }
.nhs-step.is-current .nhs-step__dot { border-color: var(--d-accent); color: var(--d-accent); box-shadow: 0 0 0 4px rgba(81,186,116,.15); }
.nhs-step.is-waiting .nhs-step__dot { border-color: #f79009; color: #b54708; box-shadow: 0 0 0 4px rgba(247,144,9,.15); }
.nhs-steps__hint { margin: 0; padding: 0 20px 16px; font-size: 13px; text-align: center; color: var(--d-fg-2); }
@media (max-width: 520px) { .nhs-step span:last-child { font-size: 10.5px; } }

/* رأس صفحة التذكرة */
.nhs-head { padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; }
.nhs-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; color: var(--d-fg-3); }
.nhs-head h1 { margin: 0; font-size: 20px; font-weight: 700; color: var(--d-fg); word-break: break-word; }
.nhs-head__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nhs-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nhs-btn-danger { color: #b42318; }
.nhs-btn-danger i { color: #b42318 !important; }
.nhs-closed { display: flex; align-items: center; gap: 8px; padding: 10px 20px; font-size: 13px; color: var(--d-fg-2); background: var(--d-soft); border-top: 1px solid var(--d-line); }

/* ── TKT-27: الجوال ─────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .nhs { padding-inline: 12px; }
    .nhs-hero { border-radius: 12px; }
    /* المواضيع سطر واحد يُمرَّر أفقياً بدل ثلاثة أسطر */
    .nhs-cats { flex-wrap: nowrap; overflow-x: auto; margin-inline: -12px; padding: 0 12px 4px; scrollbar-width: none; }
    .nhs-cats::-webkit-scrollbar { display: none; }
    .nhs-cats button { flex-shrink: 0; }
    .nhs-search input { height: 48px; font-size: 16px; } /* 16px يمنع تكبير iOS عند التركيز */
    .nhs-input, .nhs-select, .nhs-textarea { font-size: 16px; }
    .nhs-head { padding: 14px; }
    .nhs-head__actions { width: 100%; }
    .nhs-head__actions > * { flex: 1; }
    .nhs-head__actions .nhd-btn { width: 100%; justify-content: center; }
    .nhs-steps { padding: 14px 8px 16px; }
    .nhs-form__foot { flex-direction: column-reverse; align-items: stretch; }
    .nhs-form__foot .nhd-btn { justify-content: center; }
}
