/* Container Depth */
.ticket-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 26, 114, 0.04);
}

/* Header & Search */
.ticket-panel__header {
  padding: 1rem 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.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;
}

.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;
}

.tab.active {
  border-bottom: 3px solid var(--sky-blue);
  color: var(--brand-teal);
}

.tab-count {
  background: var(--border);
  color: var(--brand-navy);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.6rem;
}

.btn-new-ticket {
  background: var(--brand-navy);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Responsive Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  /* Ensures columns don't squash on mobile */
}

.ticket-table th {
  background: #F8FAFC;
  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);
}

.ticket-table td {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}

.ticket-table tr:hover td {
  background: #fdfdfe;
}

/* Specific Cell Styling */
.id-cell {
  font-weight: 600;
  color: var(--brand-navy);
}

.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 Dot Pattern */
.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, 0.4);
}

.priority--high {
  color: #f59e0b;
}

.priority--high::before {
  background: #f59e0b;
}

/* Status Pills */
.status-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-pill--progress {
  background: #EEF2FF;
  color: var(--sky-blue);
}

.status-pill--waiting {
  background: #F5F3FF;
  color: #7C3AED;
}

.table-txt {
  font-size: 0.8rem;
  color: var(--brand-teal);
  font-weight: 600;
}


.support-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.7);
  /* Deep slate with 70% opacity */
  backdrop-filter: blur(4px);
  /* Subtle blur for that premium feel */
  display: none;
  /* hidden by default, toggled with .is-open */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.support-modal-overlay.is-open {
  display: flex;
}

/* Modal Container */
.support-modal {
  background-color: var(--white);
  width: 100%;
  max-width: 650px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  position: relative;
}


/* Header Section */
.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: #EDF2F7;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: 0.2s;
}

.close-btn:hover {
  background: #E2E8F0;
}

/* Scrollable Body */
.modal-body {
  padding: 20px 32px;
  overflow-y: auto;
  flex-grow: 1;
}

/* Scrollbar Styling */
.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--brand-teal);
  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: #1a1c2e;
  background-color: white;
  outline: none;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus {
  border-color: #3b82f6;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

textarea {
  resize: none;
  min-height: 100px;
}

/* Upload Area */
.upload-area {
  border: 2px dashed #CBD5E0;
  border-radius: 12px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: 0.2s;
}

.upload-area:hover {
  background: white;
  border-color: #3b82f6;
}

.upload-area i {
  font-size: 24px;
  color: #3b82f6;
  margin-bottom: 8px;
}

/* Footer */
.modal-footer {
  padding: 24px 32px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-main);
}

/* Responsive Breakpoints */
@media (max-width: 600px) {
  .row {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .support-modal {
    height: 100%;
    max-height: 100vh;
    border-radius: 10px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-header {
    padding: 16px;
  }

  .header-title h1 {
    font-size: 18px;
  }

  .header-title p {
    font-size: 11px;

  }
}

/* Ticket detail / chat modal */
.ticket-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 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: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.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;
}

.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: 12px;
  font-size: 0.95rem;
}

.message--user {
  align-self: flex-start;
  background: #FFF;
  border: 1px solid var(--border);
}

.message--agent {
  align-self: flex-end;
  background: #DCFCE7;
}

.detail-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.detail-footer textarea {
  resize: none;
  min-height: 48px;
  max-height: 120px;
}

.detail-footer .btn-send {
  background: var(--brand-navy);
  color: var(--white);
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}