/* ===== DASHBOARD.CSS — WordPress Version ===== */

.dash-main {
  min-height: 100vh;
  padding-top: 96px;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: #f3f4f6;
  align-items: start;
  padding-bottom: 80px;
}

/* ── Sidebar ── */
.dash-sidebar {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  padding: 28px 0 24px;
  margin: 24px 10px 24px 16px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  align-self: start;
}

/* Profile */
.dash-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 24px;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 16px;
}

.dash-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #C8102E, #9b0b22);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-profile-info strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  color: #111827;
}

.dash-profile-info span {
  font-size: 0.75rem;
  color: #9ca3af;
  direction: ltr;
  display: block;
  text-align: right;
}

/* Nav */
.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
  flex: 1;
}

.dash-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  border: none;
  background: none;
  font-family: 'Kalameh', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  text-align: right;
  transition: all 0.2s ease;
  width: 100%;
  text-decoration: none;
}

.dash-nav-btn:hover {
  background: #f9fafb;
  color: #111827;
}

.dash-nav-btn.active,
.dash-nav-btn.current-section {
  background: #fff2f3;
  color: #C8102E;
}

.dash-nav-btn svg {
  flex-shrink: 0;
}

.dash-nav-badge {
  margin-right: auto;
  background: #C8102E;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 50px;
}

/* Logout */
.dash-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 12px 0;
  padding: 11px 14px;
  border-radius: 12px;
  color: #C8102E;
  font-family: 'Kalameh', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: calc(100% - 24px);
}


/* ── Content ── */
.dash-content {
  padding: 36px 40px 36px 24px;
  background: transparent;
}

/* ── Panel / Sections ── */
.dash-panel {
  display: none;
}

.dash-panel.active {
  display: block;
  animation: dashFadeIn 0.3s ease;
}

@keyframes dashFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dash-panel-head {
  margin-bottom: 28px;
}

.dash-panel-head h2 {
  font-size: 1.3rem;
  font-weight: 900;
  color: #111827;
  margin-bottom: 4px;
}

.dash-panel-head p {
  font-size: 0.85rem;
  color: #9ca3af;
}

/* ── Stats Grid ── */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.dash-stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dash-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-stat-icon--blue {
  background: #eff6ff;
  color: #3b82f6;
}

.dash-stat-icon--green {
  background: #f0fdf4;
  color: #16a34a;
}

.dash-stat-icon--red {
  background: #fff2f3;
  color: #C8102E;
}

.dash-stat-icon--orange {
  background: #fff7ed;
  color: #f97316;
}

.dash-stat-num {
  font-size: 1.5rem;
  font-weight: 900;
  color: #111827;
  line-height: 1;
}

.dash-stat-label {
  font-size: 0.75rem;
  color: #9ca3af;
  font-weight: 600;
  margin-top: 3px;
}

/* ── Section Header ── */
.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f3f4f6;
}

.dash-section-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #374151;
}

/* ── Recent Grid ── */
.dash-recent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 24px;
}

.dash-recent-col {
  display: flex;
  flex-direction: column;
}

.dash-recent-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* ── Request Card ── */
.dash-request-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 0;
}

.dash-request-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 4px;
}

.dash-request-meta {
  font-size: 0.78rem;
  color: #9ca3af;
}

/* ── Recent Items (داشبورد) ── */
.dash-recent-item {
  background: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 10px;
  transition: background 0.15s;
}

.dash-recent-item:last-child {
  margin-bottom: 0;
}

.dash-recent-item:hover {
  background: #fafafa;
}

.dash-recent-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #111827;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-recent-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.dash-recent-date {
  font-size: 0.75rem;
  color: #9ca3af;
  font-weight: 600;
  direction: ltr;
}

/* ── View More ── */
.dash-view-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-family: 'Kalameh', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #6b7280;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}

.dash-view-more-btn:hover {
  border-color: #C8102E;
  color: #C8102E;
  background: #fff2f3;
}

.dash-view-more-btn svg {
  transform: scaleX(-1);
}

/* ── Badges ── */
.dash-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.dash-badge--progress {
  background: #eff6ff;
  color: #3b82f6;
}

.dash-badge--done {
  background: #f0fdf4;
  color: #16a34a;
}

.dash-badge--pending {
  background: #fff7ed;
  color: #f97316;
}

.dash-badge--reviewing {
  background: #eff6ff;
  color: #3b82f6;
}

/* ── Tickets ── */
.ticket-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.ticket-status-tabs {
  display: flex;
  gap: 8px;
}

.ticket-status-tab {
  padding: 7px 18px;
  border-radius: 50px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-family: 'Kalameh', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ticket-status-tab:hover {
  border-color: #C8102E;
  color: #C8102E;
}

.ticket-status-tab.active {
  background: #C8102E;
  border-color: #C8102E;
  color: #fff;
}

.ticket-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 50px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  margin-right: 4px;
}

.ticket-status-tab.active .ticket-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.ticket-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1.5px solid #C8102E;
  background: #C8102E;
  color: #fff;
  font-family: 'Kalameh', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ticket-create-btn:hover {
  background: #9b0b22;
  border-color: #9b0b22;
}

.tickets-list {
  display: flex;
  flex-direction: column;
}

.ticket-item {
  display: block;
  padding: 20px 24px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 10px;
  transition: background-color 0.2s;
}

.ticket-item:hover {
  background-color: #fafafa;
}

.ticket-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.ticket-item-subject {
  flex: 1;
}

.ticket-item-subject strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 4px;
}

.ticket-item-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ticket-item-department {
  font-size: 0.73rem;
  font-weight: 600;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 2px 10px;
  border-radius: 50px;
  display: inline-block;
}

.ticket-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.ticket-status-open {
  background: #fee2e2;
  color: #C8102E;
}

.ticket-status-answered {
  background: #d1fae5;
  color: #059669;
}

.ticket-status-closed {
  background: #e5e7eb;
  color: #6b7280;
}

.ticket-status-in-progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.ticket-item-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding-top: 10px;
  border-top: 1px solid #f3f4f6;
  flex-wrap: wrap;
}

.ticket-item-cell {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.ticket-item-label {
  font-size: 0.73rem;
  font-weight: 600;
  color: #9ca3af;
}

.ticket-item-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: #374151;
}

/* ── Ticket Modal ── */
.ticket-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ticket-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.ticket-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
}

.ticket-modal-overlay.active .ticket-modal {
  transform: translateY(0) scale(1);
}

.ticket-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f3f4f6;
}

.ticket-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
  margin: 0;
}

.ticket-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ticket-modal-close:hover {
  background: #fee2e2;
  color: #C8102E;
}

.ticket-modal-form {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-family: 'Kalameh', sans-serif;
  font-size: 0.85rem;
  color: #1f2937;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #C8102E;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-cancel {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-family: 'Kalameh', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel:hover {
  border-color: #C8102E;
  color: #C8102E;
}

.btn-submit {
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  background: #C8102E;
  color: #fff;
  font-family: 'Kalameh', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-submit:hover {
  background: #9b0b22;
}

/* ── Custom Select ── */
.custom-select {
  position: relative;
}

.custom-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-family: 'Kalameh', sans-serif;
  font-size: 0.85rem;
  color: #1f2937;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
  user-select: none;
}

.custom-select.open .custom-select__trigger {
  border-color: #C8102E;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.custom-select__value--placeholder {
  color: #9ca3af;
}

.custom-select__arrow {
  transition: transform 0.2s;
}

.custom-select.open .custom-select__arrow {
  transform: rotate(180deg);
}

.custom-select__list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  overflow: hidden;
}

.custom-select.open .custom-select__list {
  display: block;
}

.custom-select__item {
  padding: 10px 14px;
  font-family: 'Kalameh', sans-serif;
  font-size: 0.85rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s;
}

.custom-select__item:hover {
  background: #fff2f3;
  color: #C8102E;
}

.custom-select__item.selected {
  background: #fff2f3;
  color: #C8102E;
  font-weight: 700;
}

/* ── Profile Form ── */
.dash-profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 100%;
}

.dash-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.dash-form-row--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.dash-divider {
  font-size: 0.78rem;
  font-weight: 800;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 8px 0 4px;
  border-top: 1.5px solid #f3f4f6;
  margin-top: 4px;
}

/* ── Auth input in dashboard ── */
.auth-input-wrap select {
  width: 100%;
  padding: 11px 40px 11px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-family: 'Kalameh', sans-serif;
  font-size: 0.88rem;
  color: #1f2937;
  background: #fff;
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input-wrap select:focus {
  border-color: #C8102E;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}

.dash-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-family: 'Kalameh', sans-serif;
  font-size: 0.88rem;
  color: #1f2937;
  background: #fff;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}

.dash-textarea:focus {
  border-color: #C8102E;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}

/* ── Scrollable Status Tabs (tickets) ── */
.ticket-status-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-wrap: nowrap;
  padding-bottom: 4px;
}

.ticket-status-tabs::-webkit-scrollbar {
  display: none;
}

.ticket-status-tab {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .dash-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-content {
    padding: 28px 24px;
  }

  .dash-recent-grid {
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .dash-main {
    display: flex;
    flex-direction: column;
    padding-top: 70px;
  }

  /* ── Sidebar: full width, no longer sticky ── */
  .dash-sidebar {
    position: static;
    width: 100%;
    max-height: none;
    height: auto;
    margin: 12px 0 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 20px 0 16px;
  }

  /* Nav: vertical full-width list */
  .dash-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: unset;
    padding: 0 12px;
    gap: 4px;
  }

  .dash-nav-btn {
    width: 100%;
    flex: none;
    white-space: normal;
    padding: 11px 14px;
    font-size: 0.88rem;
  }

  /* Logout button full width */
  .dash-logout-btn {
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  /* ── Content: full width, under sidebar ── */
  .dash-content {
    width: 100%;
    padding: 20px 14px 40px;
  }

  .dash-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .dash-form-row {
    grid-template-columns: 1fr;
  }

  .dash-form-row--3 {
    grid-template-columns: 1fr;
  }

  .dash-recent-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Ticket header: stack vertically */
  .ticket-header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .ticket-create-btn {
    align-self: flex-start;
  }

  /* Request panel toolbar: stack */
  .req-panel-toolbar {
    flex-direction: column;
    gap: 12px;
  }

  .form-group-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .dash-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-stat-card {
    padding: 14px;
    gap: 10px;
  }

  .dash-stat-num {
    font-size: 1.2rem;
  }
}