/* ==================== TRACKING PAGE ==================== */
.tracking-page { padding-bottom: 60px; }

/* Header */
.tracking-header {
  padding: 40px 0 30px;
}
.tracking-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
}
.tracking-subtitle {
  font-size: 15px;
  color: #666;
  margin: 0;
}

/* Search */
.tracking-search {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid #e9ecef;
}
.tracking-search__row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.tracking-search__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tracking-search__field label {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}
.tracking-search__field--id { flex: 2; min-width: 200px; }
.tracking-search__field--date { flex: 1; min-width: 140px; }
.tracking-search__field--btn { flex: 0 0 auto; }

.tracking-search__field input {
  height: 44px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  width: 100%;
  box-sizing: border-box;
}
.tracking-search__field input:focus {
  border-color: #333;
}

.tracking-search__field--btn button {
  height: 44px;
  padding: 0 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border: none;
}
.tracking-search__actions {
  margin-top: 12px;
  text-align: right;
}
.tracking-reset-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color .2s;
}
.tracking-reset-btn:hover { color: #333; }

/* Loading */
.tracking-loading {
  text-align: center;
  padding: 60px 0;
}
.tracking-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #eee;
  border-top-color: #333;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: trackingSpin .7s linear infinite;
}
@keyframes trackingSpin {
  to { transform: rotate(360deg); }
}
.tracking-loading p {
  color: #888;
  font-size: 14px;
}

/* Error */
.tracking-error {
  background: #fff5f5;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
}

/* Results */
.tracking-results__summary {
  margin-bottom: 12px;
  font-size: 14px;
  color: #555;
}
.tracking-results__summary span {
  font-weight: 600;
  color: #333;
}

.tracking-results__table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

/* Table */
.tracking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 600px;
}
.tracking-table thead {
  background: #f1f3f5;
}
.tracking-table th {
  padding: 12px 14px!important;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  border-bottom: 2px solid #dee2e6;
}
.tracking-table td {
  padding: 10px 14px!important;
  border-bottom: 1px solid #f0f0f0;
  color: #444;
  vertical-align: top;text-align: center;
}
.tracking-table tbody tr:hover {
  background: #f8f9fa;
}
.tracking-table tbody tr:last-child td {
  border-bottom: none;
}

/* #1 - Highlight */
.tracking-highlight {
  background: #fff3cd;
  padding: 1px 3px;
  border-radius: 3px;
  color: #856404;
}

/* #5 - Sort */
.tracking-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 24px;
  transition: background .15s;
}
.tracking-table th.sortable:hover { background: #e9ecef; }
.sort-icon {
  display: inline-block;
  width: 0; height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid #ccc;
  position: relative;
  top: -1px;
}
.sort-icon::after {
  content: '';
  display: block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #ccc;
  position: absolute;
  left: -4px;
  top: 7px;
}
th.sort-asc .sort-icon { border-bottom-color: #333; }
th.sort-asc .sort-icon::after { border-top-color: #ccc; }
th.sort-desc .sort-icon { border-bottom-color: #ccc; }
th.sort-desc .sort-icon::after { border-top-color: #333; }

/* Empty */
.tracking-empty {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}
.tracking-empty__icon {
  font-size: 48px;
  color: #ddd;
  margin-bottom: 16px;
}
.tracking-empty__icon i { display: block; }
.tracking-empty p { margin: 0 0 6px; font-size: 15px; }
.tracking-empty__hint { font-size: 13px; color: #aaa; }

/* Responsive */

/* Tablet landscape */
@media (max-width: 1199px) {
  .tracking-wrapper { max-width: 100%; }
}

/* Tablet portrait */
@media (max-width: 991px) {
  .tracking-search__field--id { flex: 1 1 100%; min-width: 100%; }
  .tracking-search__field--date { flex: 1; min-width: 120px; }
  .tracking-table { min-width: 700px; }
}

/* Mobile */
@media (max-width: 767px) {
  .tracking-page { padding-bottom: 40px; }
  .tracking-header { padding: 24px 0 16px; }
  .tracking-title { font-size: 22px; }
  .tracking-subtitle { font-size: 13px; }
  .tracking-search { padding: 16px; border-radius: 8px; }
  .tracking-search__row { flex-direction: column; gap: 10px; }
  .tracking-search__field--id,
  .tracking-search__field--date,
  .tracking-search__field--btn { flex: 1 1 100%; min-width: 100%; }
  .tracking-search__field--btn button { width: 100%; }
  .tracking-search__actions { margin-top: 8px; }

  /* Card layout cho mobile — giữ bảng giống desktop, scroll ngang */
  .tracking-results__table-wrap { -webkit-overflow-scrolling: touch; }
  .tracking-table { min-width: 600px; }
  .tracking-table th,
  .tracking-table td { padding: 8px 10px; font-size: 13px; }

  .tracking-empty { padding: 40px 16px; }
  .tracking-empty__icon { font-size: 36px; }
  .tracking-loading { padding: 40px 0; }
}

/* Small mobile */
@media (max-width: 480px) {
  .tracking-header { padding: 16px 0 12px; }
  .tracking-title { font-size: 20px; }
  .tracking-search { padding: 12px; margin-bottom: 16px; }
  .tracking-search__field input { height: 40px; font-size: 13px; }
  .tracking-search__field--btn button { height: 40px; font-size: 13px; }
  .tracking-table th,
  .tracking-table td { padding: 6px 8px; font-size: 12px; }
}
