/* ═══════════════════════════════════════════════════════════
   SUPPORT  —  Sunset Orange Brand
   ═══════════════════════════════════════════════════════════ */

/* ── Ticket Panel ───────────────────────────────────────── */
.ticket-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ticket-panel__header {
  padding: 1rem 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.ticket-panel__actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.ticket-panel__title { font-size: 1.25rem; font-weight: 600; color: var(--text-main); }

.search-wrapper { position: relative; width: 280px; }

.search-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 10px 10px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color .18s;
}

.search-input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-soft); }

/* Tabs */
.ticket-tabs {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
  flex-wrap: wrap;
}

.tab {
  cursor: pointer;
  background: transparent;
  outline: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 0.5rem;
  transition: color 0.2s ease;
  position: relative;
}

.tab.active {
  color: var(--brand-primary);
  border-bottom: 3px solid var(--brand-primary);
}

.tab-count {
  background: var(--brand-primary-soft);
  color: var(--brand-primary-deep);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.6rem;
  font-weight: 700;
}

/* New ticket button */
.btn-new-ticket {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-deep));
  color: var(--white);
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: var(--glow-orange);
  transition: all .18s;
}

.btn-new-ticket:hover { background: var(--brand-primary-deep); transform: translateY(-1px); }

/* ── Ticket Table ───────────────────────────────────────── */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.ticket-table { width: 100%; border-collapse: collapse; min-width: 900px; }

.ticket-table th {
  background: var(--bg-main);
  padding: 12px 20px;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.ticket-table td {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}

.ticket-table tr:hover td { background: var(--brand-primary-soft); }

/* Cell styles */
.id-cell { font-weight: 600; color: var(--brand-primary); }

.subject-text { font-weight: 600; color: var(--text-main); margin-bottom: 2px; font-size: 0.88rem; }
.agent-info   { font-size: 0.7rem; color: var(--text-muted); }

/* Priority */
.priority { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.8rem; }
.priority::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }

.priority--urgent { color: #EF4444; }
.priority--urgent::before { background: #EF4444; box-shadow: 0 0 8px rgba(239,68,68,.4); }

.priority--high { color: var(--brand-primary); }
.priority--high::before { background: var(--brand-primary); }

/* Status pills */
.status-pill { padding: 6px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }

.status-pill--progress { background: var(--brand-primary-soft); color: var(--brand-primary-deep); border: 1px solid rgba(242, 166, 90, 0.25); }
.status-pill--waiting  { background: #F5F3FF; color: #7C3AED; border: 1px solid rgba(124, 58, 237, 0.2); }

.table-txt { font-size: 0.8rem; color: var(--brand-teal); font-weight: 600; }

/* ── New Ticket Modal ───────────────────────────────────── */
.support-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(26, 26, 46, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.support-modal-overlay.is-open { display: flex; }

.support-modal {
  background-color: var(--white);
  width: 100%;
  max-width: 650px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  position: relative;
}

/* Modal Header */
.modal-header {
  padding: 32px 32px 10px 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-title h1 {
  font-weight: 600;
  font-size: 22px;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.header-title p { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.close-btn {
  background: var(--bg-main);
  border: 1px solid var(--border);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all .18s;
}

.close-btn:hover { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }

/* Modal Body */
.modal-body { padding: 20px 32px; overflow-y: auto; flex-grow: 1; }

.modal-body::-webkit-scrollbar       { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: var(--brand-primary); border-radius: 10px; }

/* Form Elements */
.form-group { margin-bottom: 20px; }

.label-style {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-main);
  background-color: var(--white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: "Poppins", sans-serif;
}

input:focus, textarea:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px var(--brand-primary-soft); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

textarea { resize: none; min-height: 100px; }

/* Upload area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.5);
  cursor: pointer;
  transition: all .2s;
}

.upload-area:hover { background: var(--brand-primary-soft); border-color: var(--brand-primary); }
.upload-area i { font-size: 24px; color: var(--brand-primary); margin-bottom: 8px; }

/* Modal Footer */
.modal-footer {
  padding: 24px 32px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-main);
  border-top: 1px solid var(--border);
}

/* ── Ticket Detail Chat ──────────────────────────────────── */
.ticket-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(26, 26, 46, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.ticket-detail-overlay.is-open { display: flex; }

.ticket-detail {
  background: var(--white);
  width: 100%;
  max-width: 900px;
  height: 80vh;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.ticket-detail .detail-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.ticket-detail .detail-header h3 { margin: 0; font-size: 1rem; color: var(--text-main); }

/* Chat */
.chat-messages {
  padding: 20px;
  overflow-y: auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-main);
}

.message {
  max-width: 75%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.message--user  { align-self: flex-start; background: var(--white); border: 1px solid var(--border); }
.message--agent { align-self: flex-end;   background: var(--brand-primary-soft); border: 1px solid rgba(242,166,90,.25); color: var(--brand-primary-deep); }

.detail-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--white);
}

.detail-footer textarea { resize: none; min-height: 48px; max-height: 120px; }

.detail-footer .btn-send {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-deep));
  color: var(--white);
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: var(--glow-orange);
  transition: all .18s;
}

.detail-footer .btn-send:hover { background: var(--brand-primary-deep); transform: translateY(-1px); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .row { grid-template-columns: 1fr; }
  .modal-footer  { flex-direction: column; }
  .support-modal { height: 100%; max-height: 100vh; border-radius: 12px; }
  .modal-body    { padding: 16px; }
  .modal-header  { padding: 16px; }
  .header-title h1 { font-size: 18px; }
  .header-title p  { font-size: 11px; }
  .btn { width: 100%; justify-content: center; }
}