/* تذاكر الدعم — تصميم منعزل بدون تداخل مع أنماط الموقع العام */

.st-page {
  --st-primary: #556253;
  --st-primary-dark: #454e44;
  --st-primary-soft: #eef2ee;
  --st-border: #e5e7eb;
  --st-muted: #6b7280;
  --st-bg: #f4f6f5;
  --st-card: #ffffff;
  --st-radius: 14px;
  --st-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  font-family: 'Tajawal', sans-serif;
  color: #111827;
  line-height: 1.5;
}

.st-page *,
.st-page *::before,
.st-page *::after {
  box-sizing: border-box;
}

.st-page--public {
  background: var(--st-bg);
  padding: 1.25rem 0 2.5rem;
  min-height: 50vh;
}

.st-page--portal {
  padding: 0 0 2rem;
}

.st-container {
  width: min(1080px, 100%);
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 768px) {
  .st-page--public {
    padding: 1.75rem 0 3.5rem;
  }

  .st-container {
    padding-inline: 1.25rem;
  }
}

/* Breadcrumb & header */
.st-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  color: var(--st-muted);
}

.st-breadcrumb a {
  color: var(--st-primary);
  text-decoration: none;
  font-weight: 600;
}

.st-breadcrumb a:hover {
  text-decoration: underline;
}

.st-breadcrumb-sep {
  opacity: 0.45;
}

.st-page-header {
  margin-bottom: 1.25rem;
}

.st-page-title {
  margin: 0;
  font-size: clamp(1.3rem, 2.5vw, 1.65rem);
  font-weight: 800;
  color: #111827;
  line-height: 1.35;
}

.st-page-subtitle {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--st-muted);
  max-width: 40rem;
}

/* Layout — عمود واحد على الجوال والتابلت */
.st-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.st-main,
.st-aside {
  min-width: 0;
  width: 100%;
}

.st-aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 1100px) {
  .st-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.5rem;
    align-items: start;
  }
}

/* Panels */
.st-panel {
  background: var(--st-card);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  box-shadow: var(--st-shadow);
  overflow: hidden;
}

.st-panel--aside .st-card-body {
  padding-top: 0;
}

.st-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #f1f5f3;
  background: linear-gradient(180deg, #fafcfb 0%, #fff 100%);
}

.st-card-head-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  background: var(--st-primary-soft);
  color: var(--st-primary);
  flex-shrink: 0;
}

.st-card-head-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.st-card-head-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
}

.st-card-head-desc {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--st-muted);
  line-height: 1.45;
}

.st-card-body {
  padding: 1.15rem;
}

@media (min-width: 768px) {
  .st-card-body {
    padding: 1.35rem;
  }
}

/* Alerts */
.st-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 0.95rem;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.55;
  margin-bottom: 1rem;
}

.st-alert svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  margin-top: 0.12rem;
}

.st-alert ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.st-alert li + li {
  margin-top: 0.25rem;
}

.st-alert--success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.st-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.st-alert--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

/* Form */
.st-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.st-category-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.st-section-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.st-section-label {
  display: block;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: #374151;
  line-height: 1.4;
}

.st-section-sublabel,
.st-field-sublabel {
  display: block;
  margin: -0.15rem 0 0.4rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--st-muted);
  line-height: 1.3;
}

.st-required {
  color: #dc2626;
}

.st-category-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr;
}

@media (min-width: 520px) {
  .st-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .st-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.st-category-option {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
  font-weight: inherit;
  outline: none;
}

.st-category-option:focus-visible .st-category-card {
  box-shadow: 0 0 0 3px rgba(85, 98, 83, 0.25);
}

.st-category-radio {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}

.st-category-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-height: 6rem;
  padding: 0.9rem 2.1rem 0.9rem 0.9rem;
  border: 2px solid var(--st-border);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

[dir="rtl"] .st-category-card {
  padding: 0.9rem 0.9rem 0.9rem 2.1rem;
}

.st-category-option:hover .st-category-card {
  border-color: #c5cfc4;
}

.st-category-option.is-selected .st-category-card {
  border-color: var(--st-primary);
  background: var(--st-primary-soft);
  box-shadow: 0 0 0 1px rgba(85, 98, 83, 0.1);
}

.st-category-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 9px;
  background: #f3f4f6;
  color: #4b5563;
  flex-shrink: 0;
}

.st-category-option.is-selected .st-category-icon {
  background: var(--st-primary);
  color: #fff;
}

.st-category-icon svg {
  width: 1rem;
  height: 1rem;
}

.st-category-text {
  min-width: 0;
  flex: 1;
}

.st-category-title {
  display: block;
  font-size: 0.84rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.4;
}

.st-category-alt {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #6b7280;
  line-height: 1.35;
}

.st-category-desc {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--st-muted);
  line-height: 1.45;
}

.st-category-check {
  position: absolute;
  top: 0.55rem;
  inset-inline-end: 0.55rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--st-primary);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
}

.st-category-check svg {
  width: 0.65rem;
  height: 0.65rem;
}

.st-category-option.is-selected .st-category-check {
  display: flex;
}

.st-field-grid {
  display: grid;
  gap: 0.9rem;
}

@media (min-width: 640px) {
  .st-field-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.st-field-stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.st-field {
  min-width: 0;
}

.st-field > label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #374151;
}

.st-input,
.st-select,
.st-textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0.62rem 0.8rem;
  font-size: 0.88rem;
  font-family: inherit;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.st-select {
  position: relative;
  z-index: 5;
  min-height: 2.75rem;
  cursor: pointer;
  -webkit-appearance: menulist;
  appearance: menulist;
  background-color: #fff;
  background-image: none;
}

.st-input:focus,
.st-select:focus,
.st-textarea:focus {
  outline: none;
  border-color: var(--st-primary);
  box-shadow: 0 0 0 3px rgba(85, 98, 83, 0.12);
}

.st-textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.6;
}

.st-hint {
  margin: 0.3rem 0 0;
  font-size: 0.74rem;
  color: var(--st-muted);
}

.st-divider {
  height: 1px;
  margin: 0;
  border: 0;
  background: #f1f5f3;
}

/* Upload */
.st-upload {
  position: relative;
  min-height: 7.5rem;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 1.2rem 0.9rem;
  text-align: center;
  background: #fafafa;
  overflow: hidden;
}

.st-upload:hover,
.st-upload.is-dragover {
  border-color: var(--st-primary);
  background: var(--st-primary-soft);
}

.st-upload input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.st-upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  margin-bottom: 0.45rem;
  border-radius: 999px;
  background: #fff;
  color: var(--st-primary);
  border: 1px solid var(--st-border);
  pointer-events: none;
}

.st-upload-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.st-upload-title,
.st-upload-hint,
.st-upload-name {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.st-upload-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #374151;
}

.st-upload-hint {
  margin: 0.2rem 0 0;
  font-size: 0.74rem;
  color: var(--st-muted);
}

.st-upload-name {
  margin-top: 0.45rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--st-primary);
}

/* Actions */
.st-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.65rem;
  align-items: stretch;
  padding-top: 0.15rem;
}

@media (min-width: 640px) {
  .st-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
}

.st-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.72rem 1.2rem;
  border: 0;
  border-radius: 10px;
  background: var(--st-primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 4px 14px rgba(85, 98, 83, 0.22);
}

@media (min-width: 640px) {
  .st-btn-primary {
    width: auto;
    min-width: 10rem;
  }
}

.st-btn-primary:hover {
  background: var(--st-primary-dark);
}

.st-btn-primary svg {
  width: 0.95rem;
  height: 0.95rem;
}

.st-btn-note {
  font-size: 0.76rem;
  color: var(--st-muted);
  text-align: center;
}

@media (min-width: 640px) {
  .st-btn-note {
    text-align: start;
    max-width: 14rem;
  }
}

/* Sidebar tips */
.st-tips-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.st-tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #4b5563;
}

.st-tips-list li svg {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--st-primary);
  flex-shrink: 0;
  margin-top: 0.12rem;
}

.st-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: var(--st-primary-soft);
  color: var(--st-primary);
  font-size: 0.74rem;
  font-weight: 800;
}

.st-stat-pill svg {
  width: 0.85rem;
  height: 0.85rem;
}

/* Tickets */
.st-tickets-panel {
  display: block;
}

.st-tickets-empty {
  text-align: center;
  padding: 1.25rem 0.75rem 1.5rem;
  color: var(--st-muted);
  font-size: 0.8rem;
}

.st-tickets-empty svg {
  display: block;
  width: 1.85rem;
  height: 1.85rem;
  margin: 0 auto 0.45rem;
  opacity: 0.4;
}

.st-ticket-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.st-ticket-item {
  padding: 0.75rem;
  border: 1px solid var(--st-border);
  border-radius: 10px;
  background: #fafcfb;
}

.st-ticket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.st-ticket-ref {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--st-primary);
  font-family: ui-monospace, monospace;
  direction: ltr;
  unicode-bidi: isolate;
}

.st-ticket-date {
  font-size: 0.68rem;
  color: var(--st-muted);
}

.st-ticket-cat {
  margin: 0.3rem 0 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: #6b7280;
}

.st-ticket-summary {
  margin: 0.2rem 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #4b5563;
  word-break: break-word;
}

.st-badge {
  display: inline-flex;
  margin-top: 0.4rem;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 800;
}

.st-badge--open {
  background: #fef3c7;
  color: #92400e;
}

.st-badge--done {
  background: #dcfce7;
  color: #166534;
}

.st-badge--closed {
  background: #e5e7eb;
  color: #374151;
}

/* Portal */
.sp-support-page .sis-profile-main {
  padding-top: 0;
}

.sp-support-page .sis-profile-header {
  margin-bottom: 0.75rem;
}

.st-login-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 0.95rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--st-border);
  font-size: 0.82rem;
  line-height: 1.55;
  color: #4b5563;
}

.st-login-banner a {
  color: var(--st-primary);
  font-weight: 800;
  text-decoration: none;
}

.st-login-banner a:hover {
  text-decoration: underline;
}

[x-cloak] {
  display: none !important;
}

/* منع تأثير Tailwind العام على الأزرار */
.st-page .st-form button.st-btn-primary {
  letter-spacing: normal;
  text-transform: none;
}
