/* Customer Tracking Dashboard - Custom styles */

/* Stat cards - Jumlah SP, Terkirim, Belum Terkirim */
.stat-card {
  border-left: 4px solid #206bc4;
  transition: box-shadow 0.2s;
}
.stat-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.stat-card-clickable {
  cursor: pointer;
}
.stat-card-clickable:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.stat-card .stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #656d76;
  margin-bottom: 0.25rem;
}
.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}
.stat-card-total {
  border-left-color: #206bc4;
}
.stat-card-total .stat-label { color: #206bc4; }
.stat-card-terkirim {
  border-left-color: #2fb344;
}
.stat-card-terkirim .stat-label { color: #2fb344; }
.stat-card-belum {
  border-left-color: #f59e0b;
}
.stat-card-belum .stat-label { color: #b45309; }

/* Chart - ensure bar clicks work */
.chart-scroll-wrapper,
.chart-scroll-wrapper .chart-inner,
.chart-scroll-wrapper canvas {
  pointer-events: auto;
}
.chart-scroll-wrapper .chart-inner {
  position: relative;
}

.table-row-clickable tbody tr {
  cursor: pointer;
}
.table-row-clickable tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

/* Vertical align top untuk tabel */
.table-row-clickable thead th,
.table-row-clickable tbody td {
  vertical-align: top !important;
}
/* Agar kolom bisa di-resize meski isi lebih besar - lebar dari col/th */
#dashboard-table {
  table-layout: fixed;
  width: max-content;
}
#dashboard-table td {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}
#dashboard-table td .text-truncate-cell,
#dashboard-table td .text-wrap-cell {
  min-width: 0;
  width: 100%;
}

/* Truncate: ellipsis jika overflow (kolom pendek) */
.text-truncate-cell {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  box-sizing: border-box;
}
.text-truncate-cell--wide {
  max-width: 100%;
}

/* Text wrap: teks turun baris mengikuti lebar kolom */
.text-wrap-cell {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  display: block;
  box-sizing: border-box;
  max-width: 100%;
}

/* Dashboard table: resize handle, draggable header */
#dashboard-table th {
  position: relative;
  white-space: nowrap;
  user-select: none;
  overflow: hidden;
  padding-right: 14px; /* ruang untuk resize handle */
}
#dashboard-table th.th-sortable {
  cursor: default;
}
#dashboard-table th .th-drag-handle {
  display: inline-block;
  width: 16px;
  margin-right: 4px;
  cursor: grab;
  color: #9ca3af;
  font-size: 0.85rem;
  font-weight: bold;
  vertical-align: middle;
  text-align: center;
}
#dashboard-table th .th-drag-handle:hover {
  color: var(--tblr-primary, #066fd1);
}
#dashboard-table th .th-drag-handle:active {
  cursor: grabbing;
}
#dashboard-table th .th-sort-link {
  cursor: pointer;
}
#dashboard-table th .th-sort-link:hover {
  text-decoration: underline;
}
#dashboard-table th .resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  min-height: 24px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  z-index: 10;
  pointer-events: auto;
}
#dashboard-table th .resize-handle:hover {
  background: rgba(6, 111, 209, 0.12);
}
#dashboard-table th .resize-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background: #d1d5db;
  border-radius: 1px;
  opacity: 0;
  pointer-events: none;
}
#dashboard-table th .resize-handle:hover::before {
  opacity: 1;
}
#dashboard-table th.dragging {
  opacity: 0.6;
}
#dashboard-table th.drag-over {
  border-left: 2px solid var(--tblr-primary, #066fd1);
}

/* Shipment Detail Popup - eye catching design */
.shipment-detail-popup {
  font-size: 0.95rem;
}
.shipment-kode-sp {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #066fd1 0%, #0d6efd 100%);
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(6, 111, 209, 0.35);
}
.shipment-kode-sp-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
  margin-right: 0.5rem;
}
.shipment-kode-sp-value {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.shipment-detail-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s;
}
.shipment-detail-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.shipment-detail-card-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e9ecef;
}
.shipment-detail-icon {
  font-size: 1.1rem;
  margin-right: 0.5rem;
  opacity: 0.85;
}
.shipment-detail-card-body {
  padding: 1rem;
}
.shipment-detail-label {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
}
.shipment-detail-value {
  color: #1e293b;
  font-weight: 500;
}
.shipment-text-toggle {
  cursor: pointer;
}
.shipment-text-toggle:hover {
  color: var(--tblr-primary, #066fd1);
}
.shipment-detail-truncate {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shipment-detail-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}
.shipment-text-toggle.shipment-detail-expanded {
  display: block !important;
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}
.shipment-detail-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.5rem 1rem;
  align-items: start;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.shipment-detail-row:last-child {
  border-bottom: none;
}
.shipment-detail-row .shipment-detail-label {
  margin-bottom: 0;
}
.shipment-detail-row .shipment-detail-value {
  min-width: 0;
  word-break: break-word;
}
.shipment-status-card.shipment-status-success .shipment-detail-card-header {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #166534;
}
.shipment-status-card.shipment-status-warning .shipment-detail-card-header {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #b45309;
}
.shipment-status-card .shipment-status-header {
  display: flex;
  align-items: center;
}
.shipment-timeline-header {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e40af;
}
.shipment-timeline {
  position: relative;
  padding-left: 0.5rem;
}
.shipment-timeline-item {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px dashed #e2e8f0;
}
.shipment-timeline-item:last-child {
  border-bottom: none;
}
.shipment-timeline-marker {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shipment-timeline-content {
  flex: 1;
  min-width: 0;
}
.shipment-timeline-time {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.shipment-timeline-desc {
  font-size: 0.9rem;
  color: #334155;
}

/* Modal header - rapi */
.shipment-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.shipment-modal-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.shipment-modal-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.shipment-modal-kode {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shipment-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Tabel Aktivitas - pastikan teks terbaca (kontras dengan background) */
.table-activities thead th {
  color: #0f172a !important;
  font-weight: 600;
  background-color: #f8fafc !important;
}
.table-activities tbody td {
  color: #0f172a !important;
  background-color: #fff !important;
}
.table-activities tbody tr:nth-child(even) td {
  background-color: #f8fafc !important;
}
.table-activities tbody td .text-muted {
  color: #475569 !important;
}
.table-activities tbody td code {
  color: #1e40af !important;
  background-color: #dbeafe !important;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
.table-activities .badge.bg-primary {
  background-color: #066fd1 !important;
  color: #ffffff !important;
}
