/* Listagem de tickets — classes do legado + mass action / filtros */

.filter-accordion {
    border-radius: 10px;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    background: #fff;
    margin-bottom: 16px;
    position: relative;
    z-index: 5;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.filter-toggle-btn,
.filter-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none !important;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
}

.filter-clear-btn {
    font-size: 11px;
    font-weight: 500;
    color: #ef4444;
    border-color: #fecaca;
}

.mass-action-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.mass-action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mass-action-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.mass-action-select {
    padding: 6px 28px 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    min-width: 150px;
}

.btn-mass-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.btn-submit {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.selection-divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
}

.selection-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-selection {
    background: #fff;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 5px 10px;
}

.tickets-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.tickets-table table {
    width: 100%;
    border-collapse: collapse;
}

.tickets-table thead {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.tickets-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.tickets-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.tickets-table tbody tr:hover {
    background-color: #f8fafc;
}

.tickets-table td {
    padding: 12px 10px;
    font-size: 13px;
    vertical-align: middle;
}

.tickets-table .status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

.tickets-table .status.status-open {
    background-color: #fee2e2;
    color: #991b1b;
}

.tickets-table .status.status-ongoing {
    background-color: #fef3c7;
    color: #92400e;
}

.tickets-table .status.status-pending {
    background-color: #d1fae5;
    color: #065f46;
}

.tickets-table .status.status-aguardando-fatura {
    background-color: #ffedd5;
    color: #9a3412;
}

.tickets-table .status.status-closed {
    background-color: #e5e7eb;
    color: #374151;
}

.order-number a {
    font-weight: 600;
    color: #667eea;
    text-decoration: none;
}

.msg-count {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    min-width: 25px;
    text-align: center;
    display: inline-block;
}

.category {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: #475569;
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.marketplace-cell {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.marketplace-cell .mk-name {
    font-weight: 600;
    color: #334155;
}

.marketplace-cell .mk-sub {
    font-size: 11px;
    color: #94a3b8;
}

.date-cell {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    font-size: 12px;
    color: #475569;
}

.date-cell .date-sub {
    color: #94a3b8;
    font-size: 11px;
}

.tags-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 200px;
}

.tag-badge {
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
    white-space: nowrap;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.no-incident {
    border-radius: 4px;
    white-space: nowrap;
    background-color: #6394de69;
    border: 1px solid #6394de69;
    color: #000;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.incident {
    border-radius: 4px;
    white-space: nowrap;
    background-color: #fecaca;
    color: #991b1b;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.action-btn {
    background: #667eea;
    color: white !important;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none !important;
    display: inline-block;
}

.action-btn:hover {
    background: #5a67d8;
    color: white !important;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    max-width: 420px;
}

.search-box input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

.search-btn {
    border: none;
    border-radius: 8px;
    background: #667eea;
    color: #fff;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.filter-item {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

.filter-item:has(.msd.is-open) {
    z-index: 30;
}

.filter-item.filterBoxShow {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    border-left: 3px solid #6366f1;
}

.filter-submit-item {
    padding: 12px 14px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
}

.filter-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
}

.save-filter-card {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    background: #fff;
    margin: 0 0 16px;
}

.save-filter-header {
    padding: 10px 14px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 1px solid #fcd34d;
}

.save-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    background: #fff;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    cursor: pointer;
}

.save-filter-body {
    padding: 14px;
}

.save-filter-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.save-filter-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 6px;
}

.save-filter-help {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 12px;
}

.save-filter-submit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* Multiselect dropdown (filtros) — estilo Select2 */
.msd {
  position: relative;
  width: 100%;
  max-width: 420px;
  z-index: 1;
}

.msd.is-open {
  z-index: 40;
}

.msd-control {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 4px 8px 4px 6px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: #fff;
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.msd.is-open .msd-control,
.msd-control:focus-within {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.15rem rgba(0, 123, 255, 0.2);
}

.msd-selection {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.msd-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 3px;
  background: #e4e4e4;
  color: #333;
  font-size: 12px;
  line-height: 1.4;
}

.msd-tag-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msd-tag-remove {
  border: none;
  background: transparent;
  color: #999;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.msd-tag-remove:hover {
  color: #333;
}

.msd-search-field {
  flex: 1;
  min-width: 60px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent;
  padding: 4px 2px;
  font-size: 13px;
  color: #333;
}

.msd-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 4px;
}

.msd-clear-btn {
  border: none;
  background: transparent;
  color: #999;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
}

.msd-clear-btn:hover {
  color: #333;
}

.msd-arrow {
  color: #888;
  font-size: 11px;
  padding: 0 2px;
}

.msd-dropdown {
  position: absolute;
  z-index: 1080;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  min-width: 280px;
  background: #fff;
  border: 1px solid #aaa;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  overflow: visible;
}

.msd-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(320px, 50vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.msd-result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: #fff;
  text-align: left;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
}

.msd-result.is-highlighted,
.msd-result:hover {
  background: #5897fb;
  color: #fff;
}

.msd-result.is-selected {
  background: #ddd;
  color: #333;
}

.msd-result.is-selected.is-highlighted,
.msd-result.is-selected:hover {
  background: #5897fb;
  color: #fff;
}

.msd-check {
  width: 16px;
  height: 16px;
  border: 1px solid #adb5bd;
  border-radius: 2px;
  background: #fff;
  flex-shrink: 0;
  position: relative;
}

.msd-result.is-highlighted .msd-check,
.msd-result:hover .msd-check {
  border-color: #fff;
}

.msd-check.is-on {
  background: #fff;
  border-color: #5897fb;
}

.msd-check.is-on::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #5897fb;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.msd-result.is-highlighted .msd-check.is-on::after,
.msd-result:hover .msd-check.is-on::after {
  border-color: #5897fb;
}

.msd-result-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msd-no-results {
  padding: 10px 12px;
  color: #999;
  font-size: 13px;
}

.msd.is-disabled {
  opacity: 0.65;
  pointer-events: none;
}

/* Layout das linhas do filtro mais limpo */
.filter-item .form-row {
  align-items: flex-start;
}

.filter-item .col-form-label,
.filter-item label {
  padding-top: 8px;
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 0;
}

.filter-item .form-control,
.filter-item .form-control-sm {
  max-width: 420px;
  border-color: #ced4da;
  border-radius: 4px;
  min-height: 38px;
}


/* Barra simples do filtro personalizado (ticket_fav) */
.saved-filter-bar.filter-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e5e5;
  margin-bottom: 20px;
  overflow: hidden;
}

.saved-filter-bar > .filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e5e5;
  background-color: #fafafa;
}

.saved-filter-bar .filter-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.saved-filter-bar .filter-icon {
  width: 20px;
  height: 20px;
  fill: #666;
}

.saved-filter-bar .filter-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.saved-filter-bar .filter-content {
  padding: 20px;
}

.saved-filter-bar .filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.saved-filter-bar .form-group {
  margin-bottom: 0;
}

.saved-filter-bar .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px;
}

.saved-filter-bar .select-dash {
  width: 100%;
  min-height: 38px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
}

.saved-filter-bar input.select-dash::placeholder {
  color: #9aa3af;
}

.saved-filter-bar .filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.saved-filter-bar .filter-actions .btn-primary {
  background: #007bff;
  border-color: #007bff;
  color: #fff;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
