/* ===== FORM & MODAL – giữ nguyên nhưng làm mềm hơn một chút ===== */
.webo-pt-form,
.webo-pt-modal-content {
  max-width: 720px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.06);
}

/* Hàng ngang trong form */
.webo-pt-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.webo-pt-field {
  margin-bottom: 16px;
  flex: 1;
}

.webo-pt-field > label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #111827;
  font-size: 14px;
}

.webo-pt-field input,
.webo-pt-field select,
.webo-pt-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
  background-color: #f9fafb;
}

.webo-pt-field input:focus,
.webo-pt-field select:focus,
.webo-pt-field textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
  outline: none;
  background-color: #ffffff;
}

/* ===== TABLE LIST TICKETS ===== */
.webo-pt-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 14px;
}

.webo-pt-table th,
.webo-pt-table td {
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  text-align: left;
}

.webo-pt-table th {
  background: #f9fafb;
  font-weight: 600;
  color: #111827;
}

.webo-pt-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.webo-pt-table tbody tr:hover {
  background: #eef2ff;
  transition: background 0.16s ease;
}

/* ===== SEARCHBAR ===== */
.webo-pt-searchbar {
  margin-bottom: 12px;
}

.webo-pt-searchbar input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  font-size: 14px;
  background-color: #f9fafb;
}

/* ===== STATUS / LABEL ===== */
.webo-pt-label {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
      color: #ffffff;
  background: #e5e7eb; /* màu nền default, màu custom từ inline-style vẫn override */
  white-space: nowrap;
}

/* Label nhỏ trong sidebar */
.webo-pt-label.webo-pt-label-sm {
  font-size: 11px;
  padding: 1px 6px;
  margin-left: 4px;
}

/* ===== MESSAGE STATE ===== */
.webo-ok {
  color: #16a34a;
  font-weight: 600;
}
.webo-err {
  color: #dc2626;
  font-weight: 600;
}

/* ===== MODAL ===== */
.webo-pt-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.webo-pt-modal-content {
  width: 100%;
  max-width: 600px;
}

.webo-pt-modal-content .webo-pt-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: flex-end;
}

/* ===================================================================
   VIEW TICKET – LAYOUT & HEADER
   =================================================================== */

/* Bọc toàn bộ layout view ticket */
.webo-ticket-layout {
  max-width: 1120px;
  margin: 0 auto 40px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(260px, 1fr);
  gap: 24px;
  align-items: flex-start;
}

/* Cột trái: nội dung ticket */
.webo-ticket-main {
  min-width: 0;
}

/* Card chính của ticket */
.webo-ticket-view {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  padding: 24px 24px 22px;
  box-shadow: 0 18px 45px rgba(15,23,42,0.07);
}

/* Title ticket */
.webo-ticket-view h2 {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 8px;
  color: #111827;
}

/* Meta hàng dưới title */
.webo-ticket-view .ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 22px;
}

/* Block head "Nội dung & Trả lời", "Trả lời" */
.webo-ticket-view h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 18px 0 10px;
  color: #111827;
}

/* Ngày tháng trong meta */
.webo-date {
  font-size: 12px;
  color: #6b7280;
}

/* ===================================================================
   REPLIES – BUBBLES
   =================================================================== */

#webo-ticket-replies {
  color: #111827 !important;
  margin-top: 6px;
}

/* Bubble base */
.webo-reply {
  position: relative;
  background: #f9fafb;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
  border: 1px solid #e5e7eb;
  transition: box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;
}

.webo-reply p:first-child {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 13px;
  color: #4b5563;
}

.webo-reply strong {
  color: #111827;
}

/* Hover nhẹ cho bubble */
.webo-reply:hover {
  box-shadow: 0 6px 18px rgba(15,23,42,0.06);
  transform: translateY(-1px);
}

/* Main ticket (message đầu tiên) */
.webo-reply.main-ticket {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
}

/* Chủ ticket (khách hàng) */
.webo-reply.owner-ticket {
  background: #ecfdf5;
  border-left: 4px solid #16a34a;
}

/* Attachments */
.webo-attachments {
  margin-top: 8px;
  font-size: 13px;
}

.webo-attachments ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.webo-attachments li {
  margin-bottom: 4px;
}

/* ===================================================================
   REPLY FORM & BUTTONS
   =================================================================== */

#webo-reply-form {
  margin-top: 12px;
}

#webo-reply-message {
  width: 100%;
  min-height: 130px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background-color: #f9fafb;
  font-size: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

#webo-reply-message:focus {
  border-color: #4ade80;
  box-shadow: 0 0 0 2px rgba(74,222,128,0.25);
  outline: none;
  background-color: #ffffff;
}

#reply_attachments {
  margin: 8px 0 12px;
  font-size: 13px;
}

/* Nút WP .button mặc định, mình chỉ chỉnh nhẹ spacing */
.webo-ticket-view .button {
  margin-right: 8px;
}

/* Nút đổi trạng thái */
#webo-change-ticket-status {
  margin-top: 10px;
}

/* ===================================================================
   SIDEBAR – TICKET LIST THEO PHÒNG BAN
   =================================================================== */

.webo-ticket-sidebar {
  max-width: 340px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 18px 40px rgba(15,23,42,0.06);
  position: sticky;
}

.webo-ticket-sidebar h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #111827;
}

.webo-sidebar-dept {
  margin-bottom: 16px;
}

.webo-sidebar-dept h4 {
  margin: 0 0 6px;
  font-size: 13px;
}

/* List ticket trong sidebar */
.webo-sidebar-ticket-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.webo-sidebar-ticket-list li {
  margin-bottom: 6px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.webo-sidebar-ticket-list li a {
  text-decoration: none;
  color: #111827;
  flex: 1;
}

.webo-sidebar-ticket-list li a:hover {
  text-decoration: underline;
}

/* Ticket hiện tại */
.webo-sidebar-ticket-list li.is-current-ticket a {
  font-weight: 600;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */

@media (max-width: 900px) {
  .webo-ticket-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .webo-ticket-sidebar {
    position: static;
    max-width: 100%;
    margin-top: 18px;
  }
}

@media (max-width: 640px) {
  .webo-ticket-view {
    padding: 18px 16px 16px;
    border-radius: 14px;
  }

  .webo-ticket-view h2 {
    font-size: 20px;
  }

  .webo-ticket-view h3 {
    font-size: 16px;
  }
}
