/* ---------------------------------------------------------------------
   Design tokens
   --------------------------------------------------------------------- */
:root {
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-border: #dde1e6;
  --color-border-strong: #c4cad3;

  --color-text: #1a2027;
  --color-text-muted: #66707c;
  --color-text-faint: #99a1ab;

  --color-primary: #2456c9;
  --color-primary-hover: #1c46a8;
  --color-primary-soft: #e8eefb;

  --color-neutral: #3c4552;
  --color-neutral-hover: #2b323c;

  --color-danger: #b3261e;
  --color-danger-bg: #fbe8e7;
  --color-danger-border: #f0c2bf;

  --color-warning: #8a5a00;
  --color-warning-bg: #fdf1da;
  --color-warning-border: #f1d497;

  --color-success: #1b6b3f;
  --color-success-bg: #e6f4ea;
  --color-success-border: #b9e0c4;

  --color-info: #1c5b8f;
  --color-info-bg: #e7f1fa;
  --color-info-border: #b9d8ee;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --shadow-sm: 0 1px 2px rgba(20, 24, 30, 0.06);
  --shadow-md: 0 2px 8px rgba(20, 24, 30, 0.08);

  --font-sans: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

/* ---------------------------------------------------------------------
   Base
   --------------------------------------------------------------------- */
body {
  font-family: var(--font-sans);
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-hover); }

h1, h2, h3 { font-weight: 600; color: var(--color-text); }
h1 { font-size: 20px; margin: 0 0 var(--space-1); }
h2 { font-size: 15px; margin: var(--space-8) 0 var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px solid var(--color-border); }
h2:first-of-type { margin-top: var(--space-2); }

code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--color-bg);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.muted { color: var(--color-text-muted); }
.faint { color: var(--color-text-faint); }
.mono { font-family: var(--font-mono); font-size: 12px; }

/* ---------------------------------------------------------------------
   Layout & Topbar
   --------------------------------------------------------------------- */
header.topbar {
  background: var(--color-neutral);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  height: 52px;
  gap: var(--space-3);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

header.topbar .brand {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
  padding-right: var(--space-4);
  margin-right: var(--space-1);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  white-space: nowrap;
  flex-shrink: 0;
}

header.topbar nav.primary-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

header.topbar nav.secondary-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

header.topbar a.nav-link,
header.topbar button.nav-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

header.topbar a.nav-link:hover,
header.topbar button.nav-link:hover,
header.topbar .nav-dropdown:hover > .nav-dropdown-trigger,
header.topbar .nav-dropdown.is-open > .nav-dropdown-trigger {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

header.topbar a.nav-link.active,
header.topbar button.nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
}

/* Nav Dropdowns */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.dropdown-chevron {
  opacity: 0.75;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.nav-dropdown:hover .dropdown-chevron,
.nav-dropdown.is-open .dropdown-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 270px;
  max-width: 320px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.16), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 6px;
  margin-top: 4px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
  animation: dropdownFade 0.15s ease-out;
}

/* Cầu nối hover: khoảng margin-top 4px không làm mất :hover khi kéo chuột xuống item */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 12px;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-dropdown:hover > .nav-dropdown-menu,
.nav-dropdown:focus-within > .nav-dropdown-menu,
.nav-dropdown.is-open > .nav-dropdown-menu {
  display: flex;
}

.nav-dropdown-right {
  left: auto;
  right: 0;
}

.nav-dropdown-item {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  transition: background-color 0.12s ease;
}

.nav-dropdown-item:hover {
  background-color: var(--color-primary-soft);
  text-decoration: none;
}

.nav-dropdown-item.active {
  background-color: #e8eefb;
  border-left: 3px solid var(--color-primary);
}

.nav-dropdown-item .item-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.3;
}

.nav-dropdown-item:hover .item-title {
  color: var(--color-primary);
}

.nav-dropdown-item .item-desc {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.25;
}

.btn-topbar-action {
  display: inline-flex;
  align-items: center;
  background: var(--color-primary);
  color: #ffffff !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-topbar-action:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-6);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.page-header .meta { color: var(--color-text-muted); font-size: 13px; margin-top: var(--space-1); }
.page-header .toolbar { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   Buttons & Loading States
   --------------------------------------------------------------------- */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--color-primary);
  color: #fff;
  border: 1px solid transparent;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  line-height: 1.3;
  white-space: nowrap;
  transition: background-color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}
button:hover, .btn:hover { background: var(--color-primary-hover); color: #fff; }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
button:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border-strong); }
.btn-secondary:hover { background: var(--color-bg); color: var(--color-text); }
.btn-neutral { background: var(--color-neutral); }
.btn-neutral:hover { background: var(--color-neutral-hover); }
.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: #8f1e18; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Loading state on button */
.is-loading,
button.is-loading,
.btn.is-loading {
  position: relative;
  pointer-events: none !important;
  opacity: 0.85 !important;
  cursor: wait !important;
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spinLoading 0.65s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-secondary .btn-spinner,
.btn-secondary.is-loading .btn-spinner {
  border-color: rgba(0, 0, 0, 0.18);
  border-top-color: var(--color-text);
}

.btn-sm .btn-spinner {
  width: 12px;
  height: 12px;
  border-width: 2px;
}

@keyframes spinLoading {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Global Action Loading Overlay */
#global-action-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: overlayFadeIn 0.2s ease-out;
  padding: var(--space-4);
}
#global-action-overlay[hidden] { display: none !important; }

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.action-overlay-card {
  background: var(--color-surface);
  color: var(--color-text);
  padding: var(--space-6) var(--space-8);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 440px;
  width: 100%;
}

.action-overlay-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-primary-soft);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spinLoading 0.75s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
  margin-bottom: var(--space-4);
}

.action-overlay-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.action-overlay-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.45;
}

/* Cell auto-saving state */
.cell-input.is-saving {
  border-color: var(--color-primary) !important;
  background-color: #f0f4fe !important;
  outline: 2px solid rgba(36, 86, 201, 0.25) !important;
}

.cell-input.is-saved {
  border-color: var(--color-success) !important;
  background-color: #f0faf4 !important;
  transition: background-color 0.8s ease, border-color 0.8s ease;
}

.toolbar { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
label {
  display: block;
  margin-bottom: var(--space-4);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}
label .hint { display: block; font-weight: 400; color: var(--color-text-muted); margin-top: 2px; font-size: 12px; }

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  display: block;
  width: 100%;
  margin-top: var(--space-1);
  padding: 7px 10px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
}
input[type="checkbox"], input[type="radio"] {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  cursor: pointer;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}
textarea { font-family: var(--font-mono); resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  outline: none;
}

.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 720px;
  box-shadow: var(--shadow-sm);
}

/* Hộp nội dung chung (thanh tìm kiếm, modal...) — dùng ở configs/ingredients/
   category-weights/synonyms. Không ép max-width, mỗi nơi tự set qua inline
   style khi cần (modal set width/max-width riêng). */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.form-row { display: flex; gap: var(--space-4); }
.form-row > label { flex: 1; }

.form-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  color: var(--color-text-faint);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-divider::before, .form-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--color-border);
}

.dropzone {
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  text-align: center;
  background: var(--color-bg);
}
.dropzone input[type="file"] { width: auto; margin: 0 auto; display: inline-block; }

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: auto;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-5);
  cursor: grab;
}
.table-wrap.is-over-text { cursor: text; }
.table-wrap.is-dragging {
  cursor: grabbing;
  user-select: none;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
/* table:width 100% ép cột co lại đúng khung -> width/min-width trên th vô
   nghĩa khi tổng các cột vượt khung. Cho table tự giãn theo nội dung rồi
   cuộn ngang trong .table-wrap (đã có overflow:auto) thay vì bị bóp nhỏ. */
.table-wrap table { margin: 0; box-shadow: none; border: none; width: auto; min-width: 100%; }
th, td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
thead th {
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--color-border-strong);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--color-bg); }
tbody tr.row-danger td { background: var(--color-danger-bg); }
tbody tr.row-danger:hover td { background: #f7d9d7; }
tbody tr.row-warning td { background: var(--color-warning-bg); }
tbody tr.row-warning:hover td { background: #fbe8bf; }
tbody tr.row-saved td { background: var(--color-success-bg); }
tbody tr.row-saved:hover td { background: #d4ecdb; }

.cell-empty { color: var(--color-text-faint); text-align: center; padding: var(--space-8); }

/* Editable inline-table cells — border luôn hiện ở trạng thái nghỉ để người
   dùng nhận ra ngay đây là ô sửa được, không phải chỉ khi hover mới thấy. */
.cell-input {
  width: 100%;
  border: 1px solid var(--color-border);
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--color-surface);
  margin: 0;
}
.cell-input:hover { border-color: var(--color-border-strong); }
.cell-input:focus { border-color: var(--color-primary); background: var(--color-surface); box-shadow: 0 0 0 2px var(--color-primary-soft); }

/* ---------------------------------------------------------------------
   Badges / pills
   --------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-neutral { background: #e9ebee; color: var(--color-text-muted); }
.badge-primary { background: var(--color-primary-soft); color: var(--color-primary); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); border: 1px solid var(--color-danger-border); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid var(--color-warning-border); }
.badge-success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid var(--color-success-border); }
.badge-info { background: var(--color-info-bg); color: var(--color-info); border: 1px solid var(--color-info-border); }
.badge-ai { background: #f3e8ff; color: #6b21a8; border: 1px solid #d8b4fe; }
.btn-ai { background: #7e22ce; color: #fff; border-color: #6b21a8; }
.btn-ai:hover { background: #6b21a8; color: #fff; }

.warning-list { display: flex; flex-direction: column; gap: 3px; }
.warning-item { font-size: 12px; }
.warning-item .badge { margin-right: 6px; }

/* ---------------------------------------------------------------------
   Alerts / banners
   --------------------------------------------------------------------- */
.alert {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.alert-info { background: var(--color-info-bg); border-color: var(--color-info-border); color: var(--color-info); }
.alert-success { background: var(--color-success-bg); border-color: var(--color-success-border); color: var(--color-success); }
.alert-warning { background: var(--color-warning-bg); border-color: var(--color-warning-border); color: var(--color-warning); }
.alert-danger { background: var(--color-danger-bg); border-color: var(--color-danger-border); color: var(--color-danger); }
.alert-title { font-weight: 600; margin-bottom: 2px; display: block; }
.alert-action { flex-shrink: 0; }

/* ---------------------------------------------------------------------
   Stat cards
   --------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-label { color: var(--color-text-muted); font-size: 12px; font-weight: 500; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; margin-top: 2px; }
.stat-card .stat-value.is-alert { color: var(--color-danger); }
.stat-card .stat-value.is-ok { color: var(--color-success); }

/* ---------------------------------------------------------------------
   Toast
   --------------------------------------------------------------------- */
#toast {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  background: var(--color-neutral);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  border-left: 3px solid var(--color-success);
  z-index: 100;
  max-width: 320px;
}
#toast[hidden] { display: none; }
#toast.is-error { border-left-color: var(--color-danger); }

/* ---------------------------------------------------------------------
   Pagination
   --------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  justify-content: flex-end;
  font-size: 13px;
}

/* ---------------------------------------------------------------------
   Utility
   --------------------------------------------------------------------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 960px;
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.search-bar input, .search-bar select {
  margin-top: 0;
  padding: 8px 14px;
  font-size: 14px;
  height: 38px;
}
.search-bar input[type="text"] {
  min-width: 240px;
  flex: 1;
}
.search-bar select {
  min-width: 180px;
  width: auto;
}
.search-bar input.input-sm, .search-bar input[name="shipment_id"] {
  min-width: 130px;
  max-width: 160px;
  flex: 0 0 auto;
}
.search-bar button, .search-bar .btn {
  padding: 8px 16px;
  font-size: 14px;
  height: 38px;
}
.text-right { text-align: right; }
.text-center { text-align: center; }
.col-narrow { width: 90px; }
.col-xnarrow { width: 64px; }

/* ---------------------------------------------------------------------
   Modal / Dialog
   --------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
}
.modal-overlay[hidden] { display: none; }
.modal-dialog {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.modal-header h2 {
  margin: 0;
  font-size: 16px;
  padding: 0;
  border-bottom: none;
}
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}
.modal-close:hover {
  background: var(--color-bg);
  color: var(--color-text);
}
.modal-body {
  padding: var(--space-5);
  overflow-y: auto;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 960px) {
  header.topbar {
    padding: 0 var(--space-3);
    gap: var(--space-2);
  }
  header.topbar .brand {
    font-size: 13px;
    padding-right: var(--space-2);
    margin-right: 0;
  }
  header.topbar a.nav-link,
  header.topbar button.nav-link {
    padding: 6px 8px;
    font-size: 12px;
  }
  .btn-topbar-action {
    padding: 5px 10px;
    font-size: 12px;
  }
}

/* ---------------------------------------------------------------------
   Lookup Progress Bar & Realtime Scanner
   --------------------------------------------------------------------- */
.lookup-progress-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.lookup-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.lookup-progress-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, #3b82f6 100%);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: var(--radius-sm);
}

.progress-fill.is-complete {
  background: linear-gradient(90deg, var(--color-success) 0%, #10b981 100%);
}

.lookup-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-2);
  font-size: 12px;
  color: var(--color-text-muted);
}



