/* Тикеты поддержки — пользователь и модерация */

.ticket-hero {
  background: linear-gradient(135deg, #ecfdf5 0%, #f8fafc 55%, #fff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px 28px;
  margin-bottom: 24px;
}

.ticket-hero__title {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ticket-hero__lead {
  margin: 0 0 20px;
  color: #64748b;
  line-height: 1.55;
  max-width: 560px;
}

.ticket-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ticket-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.ticket-feature {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
}

.ticket-feature__icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.ticket-feature h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.ticket-feature p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}

.ticket-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.ticket-page-head__title {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
}

.ticket-page-head__lead {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ticket-list-item {
  display: block;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.ticket-list-item:hover {
  border-color: #86efac;
  box-shadow: 0 6px 20px rgba(0, 186, 119, 0.1);
  transform: translateY(-1px);
}

.ticket-list-item--unread {
  border-left: 4px solid var(--p24-primary);
  background: linear-gradient(90deg, #f0fdf4 0%, #fff 12%);
}

.ticket-list-item--closed {
  opacity: 0.92;
  background: #fafbfc;
}

.ticket-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.ticket-filters__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.ticket-filters__link:hover {
  border-color: #86efac;
  color: #0f172a;
}

.ticket-filters__link.is-active {
  border-color: var(--p24-primary);
  background: #ecfdf5;
  color: #065f46;
}

.ticket-filters__count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.ticket-filters__link.is-active .ticket-filters__count {
  background: #fff;
  color: #065f46;
}

.ticket-closed-note {
  padding: 14px 16px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.ticket-closed-note p {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

.ticket-list-item__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 6px;
}

.ticket-list-item__id {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
}

.ticket-list-item__subject {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.ticket-list-item__meta {
  font-size: 13px;
  color: #64748b;
}

.ticket-status {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
}

.ticket-status--open {
  background: #fef3c7;
  color: #b45309;
}

.ticket-status--answered {
  background: #dbeafe;
  color: #1d4ed8;
}

.ticket-status--closed {
  background: #f1f5f9;
  color: #64748b;
}

.ticket-status--pulse {
  box-shadow: 0 0 0 0 rgba(0, 186, 119, 0.4);
  animation: ticket-pulse 2s infinite;
}

@keyframes ticket-pulse {
  70% { box-shadow: 0 0 0 6px rgba(0, 186, 119, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 186, 119, 0); }
}

.ticket-priority {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: #fee2e2;
  color: #b91c1c;
}

.ticket-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .ticket-layout {
    grid-template-columns: 1fr;
  }
}

.ticket-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
}

.ticket-panel__head {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfc;
}

.ticket-panel__body {
  padding: 20px;
}

.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: min(60vh, 520px);
  overflow-y: auto;
  padding: 4px 2px 16px;
  margin-bottom: 16px;
}

.ticket-msg {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.ticket-msg--mine {
  align-self: flex-end;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #86efac;
}

.ticket-msg--staff {
  border-color: #93c5fd;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.ticket-msg--other {
  align-self: flex-start;
}

.ticket-msg__head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 12px;
}

.ticket-msg__author {
  color: #0f172a;
}

.ticket-msg__time {
  color: #94a3b8;
  font-weight: 500;
}

.ticket-msg__body {
  font-size: 15px;
  line-height: 1.55;
  color: #1e293b;
  word-break: break-word;
}

.ticket-compose textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}

.ticket-compose textarea:focus {
  outline: 2px solid var(--p24-primary);
  border-color: var(--p24-primary);
}

.ticket-compose__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

.ticket-sidebar-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 12px;
}

.ticket-sidebar-card h3 {
  margin: 0 0 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.ticket-meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

.ticket-meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.ticket-meta-list li:last-child {
  border-bottom: none;
}

.ticket-meta-list span:first-child {
  color: #64748b;
}

.ticket-form .form-row {
  margin-bottom: 16px;
}

.ticket-form label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.ticket-form input[type="text"],
.ticket-form select,
.ticket-form textarea {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
}

.ticket-form textarea {
  min-height: 160px;
  resize: vertical;
}

.ticket-empty {
  text-align: center;
  padding: 48px 24px;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
}

.ticket-empty__icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* .mod-tabs / .mod-ticket-filters — стили кнопок-вкладок в app.css */

.mod-ticket-queue .ticket-list-item {
  cursor: pointer;
}

.mod-ticket-user-link {
  font-size: 13px;
  color: var(--p24-primary);
  font-weight: 600;
}
