@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ─── RESET & BASE ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --sidebar-w: 260px;
  --sidebar-bg: #0f1117;
  --sidebar-hover: #1a1d27;
  --sidebar-active: #1e2235;
  --sidebar-border: #2a2d3a;
  --sidebar-text: #8b8fa3;
  --sidebar-text-active: #ffffff;
  --sidebar-icon: #5c6070;

  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dim: rgba(99, 102, 241, 0.12);
  --accent-glow: rgba(99, 102, 241, 0.25);

  --bg: #f0f2f8;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --card-shadow-lg: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);

  --text: #1a1d2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --border: #e5e7eb;
  --border-focus: var(--accent);

  --success: #22c55e;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --error: #ef4444;
  --error-bg: #fef2f2;
  --error-border: #fecaca;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html { font-size: 16px; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--accent-glow);
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.3px;
}

.brand-text span {
  font-size: 11px;
  color: var(--sidebar-text);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Nav */
.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: var(--transition);
  position: relative;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: white;
}

.nav-item:hover i { color: white; }

.nav-item.active {
  background: var(--sidebar-active);
  color: white;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item.active i { color: var(--accent-light); }

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.sidebar-link i { font-size: 15px; width: 20px; text-align: center; }

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: white;
}

/* ─── MAIN CONTENT ─── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 0;
  min-height: 100vh;
}

/* Page header */
.page-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 24px 36px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.9);
}

.page-title h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.page-title p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Tab content */
.tab-content {
  display: none;
  padding: 32px 36px;
  animation: fadeIn 0.25s ease;
}

.tab-content.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── SEARCH CARD ─── */
.search-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.search-form { width: 100%; }

.input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.tracking-input-wrap { flex: 1; }

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}

.input-wrap input,
.input-wrap select {
  width: 100%;
  padding: 13px 16px 13px 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  transition: var(--transition);
  appearance: none;
}

.input-wrap input::placeholder { color: var(--text-muted); }

.input-wrap input:focus,
.input-wrap select:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.carrier-select-wrap { width: 180px; }
.select-arrow {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  font-size: 10px;
  pointer-events: none;
}

/* ─── BUTTONS ─── */
.btn-track {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-track:hover {
  background: var(--accent-light);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-track:active { transform: translateY(0); }

.btn-track:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

textarea#batchInput {
  width: 100%;
  height: 200px;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  margin: 16px 0;
  transition: var(--transition);
}

textarea#batchInput:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 3px var(--accent-dim);
}

textarea#batchInput::placeholder { color: var(--text-muted); }

.batch-instructions {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.batch-instructions i { color: var(--accent); }

.batch-instructions code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
}

/* Ghost / icon buttons */
.btn-refresh {
  width: 40px; height: 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-refresh:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-copy {
  width: 32px; height: 32px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.btn-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-icon {
  width: 34px; height: 34px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-ghost {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-ghost:hover {
  border-color: var(--error);
  color: var(--error);
  background: var(--error-bg);
}

.btn-danger-ghost { color: var(--error); }

/* ─── ALERTS ─── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

.alert-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: #92400e;
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: #b91c1c;
}

.alert i { font-size: 16px; }

/* ─── LOADING ─── */
.loading-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.loading-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}

.loading-dots span {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.hidden { display: none !important; }

/* ─── RESULT CARD ─── */
.result-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.result-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 28px;
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
  border-bottom: 1px solid var(--border);
}

.result-hero-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.carrier-badge-lg {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.carrier-badge-lg.fedex    { background: linear-gradient(135deg, #4D148C, #FF6200); }
.carrier-badge-lg.ups      { background: linear-gradient(135deg, #351C15, #FFB500); }
.carrier-badge-lg.usps     { background: linear-gradient(135deg, #004B87, #E31837); }
.carrier-badge-lg.dhl      { background: linear-gradient(135deg, #FFCC00, #C80036); }
.carrier-badge-lg.roadie   { background: linear-gradient(135deg, #FF6B35, #F7C59F); }
.carrier-badge-lg.ontrac   { background: linear-gradient(135deg, #00A651, #00539B); }
.carrier-badge-lg.amazon   { background: linear-gradient(135deg, #FF9900, #146EB4); }
.carrier-badge-lg.lasership,
.carrier-badge-lg.laserchip { background: linear-gradient(135deg, #2D2D2D, #00A3E0); }
.carrier-badge-lg.spee-dee  { background: linear-gradient(135deg, #0066B3, #EE3124); }
.carrier-badge-lg.cainiao   { background: linear-gradient(135deg, #00A0E9, #FFD700); }
.carrier-badge-lg.china-post { background: linear-gradient(135deg, #DE2910, #FFDE00); color: white !important; }
.carrier-badge-lg.unknown   { background: linear-gradient(135deg, #6b7280, #374151); }

.result-meta { display: flex; flex-direction: column; gap: 8px; }

.tracking-number-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tracking-number {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
  font-family: 'SF Mono', 'Consolas', monospace;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  width: fit-content;
}

.status-badge.delivered      { background: var(--success-bg); color: #15803d; border: 1px solid var(--success-border); }
.status-badge.in-transit     { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.status-badge.out-for-delivery { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.status-badge.error,
.status-badge.not-found      { background: var(--error-bg); color: #b91c1c; border: 1px solid var(--error-border); }
.status-badge.pending        { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }

/* Stats row */
.result-stats {
  display: flex;
  align-items: stretch;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  flex: 1;
}

.stat-item:last-child { flex: 1.5; }

.stat-icon {
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.stat-body { display: flex; flex-direction: column; gap: 2px; }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.stat-divider {
  width: 1px;
  background: var(--border);
  margin: 12px 24px;
  flex-shrink: 0;
}

/* ─── TIMELINE ─── */
.timeline-section { padding: 24px 28px; }

.timeline-header {
  margin-bottom: 24px;
}

.timeline-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-header h3 i { color: var(--accent); font-size: 14px; }

.timeline {
  position: relative;
  padding-left: 0;
}

.timeline::before {
  display: none;
}

/* Card-style timeline */
.tl-event {
  display: flex;
  gap: 0;
  position: relative;
}

.tl-event:last-child .tl-line { display: none; }

.tl-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 0 0;
  flex-shrink: 0;
}

.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--border);
  flex-shrink: 0;
  margin-top: 4px;
  z-index: 1;
  transition: var(--transition);
}

.tl-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  margin-top: 4px;
  min-height: 24px;
}

.tl-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 28px;
  flex: 1;
  min-width: 0;
}

.tl-content-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.tl-status-icon {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 5px;
  flex-shrink: 0;
}

.tl-event:first-child .tl-status-icon { color: var(--accent); }
.tl-event:first-child .tl-dot {
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 0 14px var(--accent-glow);
  width: 14px;
  height: 14px;
}
.tl-event:first-child .tl-line { background: var(--accent-light); }

.tl-main { flex: 1; min-width: 0; }

.tl-description {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
}

.tl-event:first-child .tl-description { color: var(--accent); }

.tl-location-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.tl-location-row i { font-size: 11px; color: var(--text-muted); }

.tl-datetime {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding-top: 2px;
  text-align: right;
}

/* Compact variant for batch results */
.batch-results .timeline-item {
  padding: 0;
}

.batch-results .timeline-item::before { display: none; }

/* ─── BATCH RESULTS ─── */
.batch-results {
  display: grid;
  gap: 12px;
}

.batch-result-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px 18px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.batch-result-item:hover {
  border-color: var(--accent-light);
  box-shadow: var(--card-shadow-lg);
}

.batch-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.batch-carrier-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: white;
}

.batch-carrier-badge.fedex    { background: linear-gradient(135deg, #4D148C, #FF6200); }
.batch-carrier-badge.ups      { background: linear-gradient(135deg, #351C15, #FFB500); }
.batch-carrier-badge.usps     { background: linear-gradient(135deg, #004B87, #E31837); }
.batch-carrier-badge.dhl      { background: linear-gradient(135deg, #FFCC00, #C80036); }
.batch-carrier-badge.roadie   { background: linear-gradient(135deg, #FF6B35, #F7C59F); }
.batch-carrier-badge.ontrac   { background: linear-gradient(135deg, #00A651, #00539B); }
.batch-carrier-badge.amazon   { background: linear-gradient(135deg, #FF9900, #146EB4); }
.batch-carrier-badge.lasership { background: linear-gradient(135deg, #2D2D2D, #00A3E0); }
.batch-carrier-badge.spee-dee  { background: linear-gradient(135deg, #0066B3, #EE3124); }
.batch-carrier-badge.cainiao   { background: linear-gradient(135deg, #00A0E9, #FFD700); }
.batch-carrier-badge.china-post { background: linear-gradient(135deg, #DE2910, #FFDE00); color: white !important; }
.batch-carrier-badge.unknown   { background: linear-gradient(135deg, #6b7280, #374151); }

.batch-number {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  font-family: 'SF Mono', monospace;
  flex: 1;
}

.batch-status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
}

.batch-status-badge.delivered { background: var(--success-bg); color: #15803d; border: 1px solid var(--success-border); }
.batch-status-badge.in-transit { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.batch-status-badge.out-for-delivery { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.batch-status-badge.error,
.batch-status-badge.not-found { background: var(--error-bg); color: #b91c1c; border: 1px solid var(--error-border); }
.batch-status-badge.pending { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }

.batch-latest-event {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 4px;
  display: flex;
  gap: 6px;
}

.batch-event-location { color: var(--text-muted); }

/* ─── HISTORY ─── */
.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.history-count {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.history-grid {
  display: grid;
  gap: 10px;
}

.history-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: var(--transition);
  box-shadow: var(--card-shadow);
}

.history-card:hover {
  border-color: var(--accent-light);
  box-shadow: var(--card-shadow-lg);
}

.history-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }

.history-carrier-badge {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.history-carrier-badge.fedex    { background: linear-gradient(135deg, #4D148C, #FF6200); }
.history-carrier-badge.ups      { background: linear-gradient(135deg, #351C15, #FFB500); }
.history-carrier-badge.usps     { background: linear-gradient(135deg, #004B87, #E31837); }
.history-carrier-badge.dhl      { background: linear-gradient(135deg, #FFCC00, #C80036); }
.history-carrier-badge.roadie   { background: linear-gradient(135deg, #FF6B35, #F7C59F); }
.history-carrier-badge.ontrac   { background: linear-gradient(135deg, #00A651, #00539B); }
.history-carrier-badge.amazon   { background: linear-gradient(135deg, #FF9900, #146EB4); }
.history-carrier-badge.lasership { background: linear-gradient(135deg, #2D2D2D, #00A3E0); }
.history-carrier-badge.spee-dee  { background: linear-gradient(135deg, #0066B3, #EE3124); }
.history-carrier-badge.cainiao   { background: linear-gradient(135deg, #00A0E9, #FFD700); }
.history-carrier-badge.china-post { background: linear-gradient(135deg, #DE2910, #FFDE00); color: white !important; }
.history-carrier-badge.unknown   { background: linear-gradient(135deg, #6b7280, #374151); }

.history-number {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: 'SF Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.history-actions { display: flex; gap: 6px; flex-shrink: 0; }

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 15px;
  font-weight: 500;
}

/* ─── QUOTA ─── */
.quota-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.quota-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
}

.quota-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quota-card h3 i { color: var(--accent); }

.quota-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.quota-card-header h3 { margin-bottom: 0; }

/* Donut chart */
.quota-donut-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 24px;
}

.quota-donut {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.donut-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 10;
}

.donut-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.donut-label {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-percent {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
}

.donut-sub {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quota-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.qn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.qn-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.qn-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qn-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  margin: 0 8px;
}

.quota-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.quota-detail-row:last-child { border-bottom: none; }

.qd-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

.qd-value { font-size: 15px; font-weight: 700; color: var(--text); }

/* ─── COPY TOAST ─── */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-toast.show {
  transform: translateX(-50%) translateY(0);
}

.copy-toast i { color: var(--success); }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .sidebar {
    width: 72px;
  }
  .brand-text, .nav-item span, .sidebar-link span, .sidebar-footer span { display: none; }
  .brand-text h1 { font-size: 20px; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item i { font-size: 18px; }
  .nav-item.active::before { display: none; }
  .sidebar-brand { justify-content: center; padding: 20px 12px; }
  .sidebar-link { justify-content: center; padding: 12px; }
  .main-content { margin-left: 72px; }
  .tab-content { padding: 24px 20px; }
  .page-header { padding: 20px; }
  .quota-grid { grid-template-columns: 1fr; }
  .result-stats { flex-wrap: wrap; padding: 0 20px; }
  .stat-divider { display: none; }
  .stat-item { flex: 1 0 calc(50% - 12px); padding: 16px 0; }
}

@media (max-width: 600px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .input-row { flex-wrap: wrap; }
  .tracking-input-wrap { min-width: 100%; }
  .carrier-select-wrap { width: 100%; }
  .btn-track { width: 100%; justify-content: center; }
  .result-hero-left { flex-wrap: wrap; }
}
