/* ═ ══════════════════════════════════════════════════════════════
   KJG HỆ THỐNG NHẬP LIỆU  Design System v2
   Redesigned CSS: cleaner, easier to read, professional
 ═ ══════════════════════════════════════════════════════════════ */

 /* ─ ─ DESIGN TOKENS ─────────────────────────────────────────── */
 :root {
  /* Brand palette */
  --navy:    #0d1b2e;
  --blue:    #1a3a6e;
  --accent:   #2563eb;
  --accent-h:  #1d4ed8;
  --cyan:    #06b6d4;

  /* Semantic colours */
  --green:   #16a34a;
  --green-bg:  #f0fdf4;
  --green-bd:  #86efac;
  --red:    #dc2626;
  --red-bg:   #fef2f2;
  --red-bd:   #fca5a5;
  --amber:   #d97706;
  --amber-bg:  #fffbeb;
  --amber-bd:  #fcd34d;
  --purple:   #7c3aed;
  --purple-bg: #ede9fe;
  --purple-bd: #c4b5fd;

  /* Surface */
  --bg:     #f4f6f9;
  --card:    #ffffff;
  --border:   #e2e8f0;
  --border-h:  #cbd5e1;

  /* Text */
  --text:    #0f172a;
  --text-2:   #334155;
  --muted:   #64748b;
  --subtle:   #94a3b8;

  /* Sizing */
  --ih:     38px;    /* input height */
  --radius:   8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Type scale */
  --fs-xs:   10px;
  --fs-sm:   11px;
  --fs-base:  13px;
  --fs-md:   14px;
  --fs-lg:   16px;
  --fs-xl:   20px;

  /* Spacing scale (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.06);
  --shadow-xl: 0 20px 56px rgba(0,0,0,.18);

  /* Fonts */
  --font:    'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'Inter', monospace;
 }

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

 body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02","cv03","cv04","cv11";
 }

 /* ─ ─ HEADER ─────────────────────────────────────────────────── */
 .app-header {
  background: linear-gradient(135deg, #0d1b2e 0%, #132240 55%, #1a3a6e 100%);
  color: #fff;
  padding: 0 var(--sp-6);
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,.28);
 }
 .logo {
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
 }
 .logo-badge {
  background: var(--accent);
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  font-family: var(--font-mono);
 }
 .header-right { display: flex; align-items: center; gap: var(--sp-3); }
 .sync-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  padding: 6px var(--sp-4);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 500;
  transition: background .2s;
 }
 .sync-btn:hover { background: rgba(255,255,255,.2); }

 /* ─── ALERT BELL ─── */
 .alert-bell-btn {
  position: relative;
  background: none;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  color: #fff;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s;
 }
 .alert-bell-btn:hover { background: rgba(255,255,255,.15); }
 .alert-bell-btn.has-alerts { animation: bellShake 1s ease-in-out; }
 .alert-badge {
  position: absolute; top: -5px; right: -5px;
  background: #dc2626; color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
 }
 @keyframes bellShake {
  0%,100% { transform: rotate(0); }
  10%,30%,50% { transform: rotate(8deg); }
  20%,40% { transform: rotate(-8deg); }
  60% { transform: rotate(0); }
 }

 /* ─── ALERT PANEL ─── */
 .alert-panel {
  position: fixed; top: 56px; right: 16px;
  width: 380px; max-height: 70vh;
  background: #fff; border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  z-index: 9999;
  overflow: hidden;
  border: 1px solid #e5e7eb;
 }
 .alert-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--navy, #0d1b2e); color: #fff;
  font-size: 14px; font-weight: 600;
 }
 .alert-panel-close {
  background: none; border: none; color: #fff;
  font-size: 22px; cursor: pointer; opacity: .7;
  line-height: 1;
 }
 .alert-panel-close:hover { opacity: 1; }
 .alert-panel-body {
  max-height: calc(70vh - 52px);
  overflow-y: auto;
  padding: 0;
 }
 .alert-group {
  border-bottom: 1px solid #f3f4f6;
  padding: 14px 18px;
 }
 .alert-group:last-child { border-bottom: none; }
 .alert-group-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
 }
 .alert-group-title.red   { color: #dc2626; }
 .alert-group-title.amber { color: #d97706; }
 .alert-item {
  font-size: 13px; color: #374151;
  padding: 5px 0 5px 16px;
  position: relative; line-height: 1.5;
 }
 .alert-item::before {
  content: ''; position: absolute; left: 0; top: 11px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #9ca3af;
 }
 .alert-item.critical::before { background: #dc2626; }
 .alert-item.warning::before  { background: #f59e0b; }
 .alert-empty {
  padding: 30px 18px; text-align: center;
  color: #6b7280; font-size: 13px;
 }
 .alert-loading {
  padding: 30px 18px; text-align: center;
  color: #6b7280; font-size: 13px;
 }
 @media (max-width: 480px) {
  .alert-panel { right: 8px; left: 8px; width: auto; }
 }

 #conn-status {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  display: flex;
  align-items: center;
  gap: 5px;
 }
 .conn-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
  transition: background .3s;
 }
 .conn-dot.ok { background: #4ade80; box-shadow: 0 0 7px #4ade80; }
 .conn-dot.err { background: var(--red); }

 /* ─ ─ NAV TABS ────────────────────────────────────────────────── */
 .role-bar {
  background: #0d1b2e;
  border-bottom: 2px solid var(--accent);
  padding: 0 20px;
  display: flex;
  overflow-x: auto;
  position: sticky;
  top: 54px;
  z-index: 99;
  scrollbar-width: none;
 }
 .role-bar::-webkit-scrollbar { display: none; }
 .role-tab {
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.42);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .18s, border-color .18s;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  letter-spacing: .2px;
 }
 .role-tab:hover { color: rgba(255,255,255,.72); }
 .role-tab.active { color: #fff; border-bottom-color: var(--cyan); }
 .role-tab .rdot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  transition: background .2s, box-shadow .2s;
  flex-shrink: 0;
 }
 .role-tab.active .rdot { background: var(--cyan); box-shadow: 0 0 7px var(--cyan); }

 /* ─ ─ LAYOUT ──────────────────────────────────────────────────── */
 .tab-pane {
  display: none;
  padding: var(--sp-5) var(--sp-6) 48px;
  max-width: 1300px;
  margin: 0 auto;
 }
 .tab-pane.active { display: block; }

 /* ─ ─ CARD ─────────────────────────────────────────────────────── */
 .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-sm);
 }
 .card-hd {
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--muted);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
 }
 .badge-dest {
  font-size: 10px;
  padding: 2px 9px;
  border-radius: 5px;
  font-weight: 600;
  margin-left: auto;
 }
 .badge-green { background: var(--green-bg); color: #166534; border: 1px solid var(--green-bd); }
 .badge-blue { background: #eff6ff;     color: #1e40af; border: 1px solid #bfdbfe; }

 /* ─ ─ GRID ─────────────────────────────────────────────────────── */
 .g { display: grid; gap: var(--sp-3); }
 .g2 { grid-template-columns: repeat(2, 1fr); }
 .g3 { grid-template-columns: repeat(3, 1fr); }
 .g4 { grid-template-columns: repeat(4, 1fr); }
 .g5 { grid-template-columns: repeat(5, 1fr); }
 .g6 { grid-template-columns: repeat(6, 1fr); }
 .c2 { grid-column: span 2; }
 .c3 { grid-column: span 3; }
 .c4 { grid-column: span 4; }

 /* ─ ─ FIELD & LABEL ────────────────────────────────────────────── */
 .field { display: flex; flex-direction: column; gap: 5px; }
 .field label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .1px;
  display: flex;
  align-items: center;
  gap: 5px;
 }
 .col-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  color: var(--accent);
  font-weight: 500;
 }
 .req { color: var(--red); }

 /* ─ ─ INPUTS ───────────────────────────────────────────────────── */
 input, select, textarea {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0 11px;
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
 }
 input, select { height: var(--ih); }
 textarea { padding: 8px 11px; resize: vertical; min-height: 64px; }
 input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
 }
 input[readonly], textarea[readonly] {
  background: #f8fafc;
  color: var(--muted);
  cursor: default;
 }
 input[readonly]:focus { border-color: var(--border); box-shadow: none; }
 .af-filled {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 600 !important;
  border-color: #bfdbfe !important;
 }
 input:disabled, select:disabled {
  background: #f1f5f9;
  color: var(--subtle);
  cursor: not-allowed;
 }

 /* ─ ─ VẬT TƯ DROPDOWN ─────────────────────────────────────────── */
 .vt-wrap { position: relative; }
 .vt-input-row { display: flex; gap: 6px; }
 .vt-input-row input { flex: 1; }
 .vt-btn, .lsx-btn {
  height: var(--ih);
  padding: 0 15px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  transition: background .18s;
  white-space: nowrap;
 }
 .vt-btn:hover, .lsx-btn:hover { background: var(--accent-h); }
 .vt-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-lg);
  max-height: 270px;
  overflow-y: auto;
  z-index: 200;
  display: none;
  box-shadow: var(--shadow-lg);
 }
 .vt-dropdown.open { display: block; }
 .vt-search-box {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
 }
 .vt-search-box input { height: 32px; font-size: 12px; }
 .vt-group-hd {
  padding: 6px 12px 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: .7px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
 }
 .vt-item {
  padding: 8px 13px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background .1s;
 }
 .vt-item:hover, .vt-item.sel { background: #eff6ff; }
 .vt-item .vn { font-weight: 500; font-size: var(--fs-base); }
 .vt-item .vm { font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }
 .vt-add-row {
  padding: 10px 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  background: #f0f9ff;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
 }
 .vt-add-row:hover { background: #e0f2fe; }
 .vt-selected {
  margin-top: 5px;
  padding: 6px 11px;
  background: var(--green-bg);
  border: 1.5px solid var(--green-bd);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
  display: none;
 }

 /* ─ ─ TRẠNG THÁI DOT ───────────────────────────────────────────── */
 .tt-wrap { position: relative; }
 .tt-dot {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
 }
 .tt-wrap select { padding-left: 27px; font-weight: 600; }

 /* ─ ─ LSX STATUS ───────────────────────────────────────────────── */
 .lsx-wrap { display: flex; gap: 6px; }
 .lsx-wrap input { flex: 1; }
 .lsx-status {
  height: var(--ih);
  padding: 0 13px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  background: #f1f5f9;
  color: var(--muted);
  border: 1.5px solid var(--border);
 }
 .lsx-status.ok   { background: var(--green-bg); color: var(--green); border-color: var(--green-bd); }
 .lsx-status.err   { background: var(--red-bg);  color: var(--red);  border-color: var(--red-bd); }
 .lsx-status.loading { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-bd); }

 /* ─ ─ KT PICKER BAR ────────────────────────────────────────────── */
 .kt-picker-bar {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  margin-top: 10px;
  padding: 10px 15px;
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius);
 }
 .kt-picker-bar span { font-size: 12px; color: var(--accent); font-weight: 600; flex: 1; }
 .kt-picker-info { font-size: 12px; color: var(--muted); }
 .kt-picker-info strong { color: var(--accent); }

 /* ─ ─ PASTE TABLE ──────────────────────────────────────────────── */
 .paste-hint {
  font-size: 11px;
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid var(--amber-bd);
  padding: 7px 11px;
  border-radius: 6px;
  margin-bottom: 10px;
 }
 .paste-table-wrap {
  overflow-x: auto;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
 }
 .paste-table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
 .paste-table th {
  background: #f8fafc;
  padding: 9px 11px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .4px;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
 }
 .paste-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
 }
 .paste-table tr:last-child td { border-bottom: none; }
 .paste-table tr:hover td { background: #fafbfc; }
 .paste-table input {
  height: 32px;
  font-size: var(--fs-base);
  border-color: transparent;
  border-radius: 5px;
  padding: 0 9px;
 }
 .paste-table input:focus { border-color: var(--accent); background: #fff; }
 .paste-table td.row-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--subtle);
  text-align: center;
  width: 34px;
 }
 .del-row-btn {
  background: none;
  border: none;
  color: #fca5a5;
  cursor: pointer;
  font-size: 15px;
  padding: 2px 5px;
  border-radius: 4px;
  transition: color .15s, background .15s;
 }
 .del-row-btn:hover { color: var(--red); background: var(--red-bg); }
 .add-row-btn {
  margin-top: 8px;
  height: 32px;
  padding: 0 14px;
  background: transparent;
  border: 1.5px dashed #cbd5e1;
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 500;
  transition: border-color .2s, color .2s;
  display: flex;
  align-items: center;
  gap: 5px;
 }
 .add-row-btn:hover { border-color: var(--accent); color: var(--accent); }
 .paste-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
 }
 .paste-count { font-size: 11px; color: var(--muted); }
 .paste-count strong { color: var(--accent); }

 /* ─ ─ WORKER CARD ──────────────────────────────────────────────── */
 .worker-card {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
 }
 .worker-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  min-width: 28px;
  font-family: var(--font-mono);
 }
 .worker-card select,
 .worker-card input[type=text] { flex: 1; height: 32px; font-size: 12px; }
 .worker-card input[type=number] { width: 62px; height: 32px; font-size: 12px; text-align: center; }

 /* ─ ─ MODAL ────────────────────────────────────────────────────── */

 /* 1. Làm nổi bật tên công ty và tiêu đề modal */
.modal-header .brand-title {
 color: #1a3353; /* Màu xanh navy đậm chuyên nghiệp */
 font-size: 18px;
 font-weight: 800;
 letter-spacing: -0.5px;
 margin-bottom: 2px;
}

.modal-header .brand-subtitle {
 color: #5f6368;
 font-size: 12px;
 font-weight: 500;
 text-transform: uppercase;
 opacity: 0.8;
}

/* 2. Thu nhỏ và làm đẹp Checkbox */
input[type="checkbox"] {
 width: 16px;
 height: 16px;
 cursor: pointer;
 accent-color: #007bff; /* Màu xanh thương hiệu khi tick */
 vertical-align: middle;
 transition: transform 0.1s;
}

input[type="checkbox"]:hover {
 transform: scale(1.1);
}

/* 3. Cải thiện bảng dữ liệu (Table) */
.cnps-table {
 border-collapse: separate;
 border-spacing: 0;
 width: 100%;
}

.cnps-table th {
 background-color: #f8f9fa;
 color: #4a5568;
 font-weight: 600;
 font-size: 12px;
 text-transform: uppercase;
 padding: 12px 10px;
 border-bottom: 2px solid #edf2f7;
}

.cnps-table td {
 padding: 14px 10px;
 border-bottom: 1px solid #edf2f7;
 font-size: 14px;
}

.cnps-table tr:hover {
 background-color: #fcfcfc;
}
 .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,16,32,.6);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
 }
 .modal-overlay.open { display: flex; }
 #addvt-modal.modal-overlay { z-index: 600; }
 .modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  width: 820px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
 }
 .modal-box.sm { width: 520px; }
 .modal-box.lg { width: 960px; }
 .modal-header {
  padding: var(--sp-4) var(--sp-5);
  background: linear-gradient(135deg, #0d1b2e, #1a3a6e);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
 }
 .modal-header h3 { font-size: var(--fs-md); font-weight: 600; }
 .modal-close {
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
 }
 .modal-close:hover { background: rgba(255,255,255,.22); }
 .modal-filter {
  padding: 10px var(--sp-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
 }
 .modal-filter input { flex: 1; min-width: 160px; height: 34px; font-size: var(--fs-base); }
 .modal-filter select { width: 170px; height: 34px; font-size: var(--fs-base); }
 .modal-body { flex: 1; overflow-y: auto; padding: 14px var(--sp-4); }
 .modal-footer {
  padding: 12px var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  flex-shrink: 0;
 }

 /* ─ ─ CUON PICKER CARDS ────────────────────────────────────────── */
 .cuon-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
 .cuon-card {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  cursor: pointer;
  transition: border-color .16s, background .16s;
 }
 .cuon-card:hover { border-color: var(--accent); background: #f8faff; }
 .cuon-card.picked { border-color: var(--accent); background: #eff6ff; }
 .cuon-card.hidden { display: none; }
 .cc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 5px; }
 .cc-stt { font-family: var(--font-mono); font-weight: 700; font-size: var(--fs-base); color: var(--accent); }
 .cc-tt { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
 .tt-ton { background: var(--green-bg); color: #166534; }
 .tt-xuat { background: #eff6ff;     color: #1e40af; }
 .tt-dang { background: var(--red-bg);  color: var(--red); }
 .cc-name  { font-size: 12px; color: var(--text); margin-bottom: 4px; line-height: 1.4; }
 .cc-bottom { display: flex; justify-content: space-between; font-size: 11px; }
 .cc-ncc  { color: var(--muted); }
 .cc-kg   { font-weight: 700; font-size: var(--fs-base); }
 .cc-kg.ok { color: var(--green); }
 .cc-kg.low { color: var(--red); }
 .kg-panel {
  display: none;
  margin-top: 8px;
  padding: 8px 11px;
  background: #f0f7ff;
  border-radius: 7px;
  border: 1px solid #c5d8f5;
 }
 .cuon-card.picked .kg-panel { display: block; }
 .kg-panel label { font-size: 11px; font-weight: 600; color: #1a3a6e; margin-bottom: 4px; display: block; }
 .kg-panel input { height: 32px; font-size: var(--fs-base); font-weight: 600; border-color: var(--accent); }
 .picker-group-hd {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #fff;
  background: #1e293b;
  padding: 5px 10px;
  border-radius: 6px;
  margin: 8px 0 5px;
  grid-column: 1 / -1;
 }
 .picker-group-hd.amber { background: #78350f; }

 /* ─ ─ UNDO SECTION ─────────────────────────────────────────────── */
 .undo-section {
  margin-top: 8px;
  padding: 10px 14px;
  background: #fffbeb;
  border: 1.5px solid var(--amber-bd);
  border-radius: var(--radius);
 }
 .undo-section-hd { font-size: 11px; font-weight: 600; color: var(--amber); margin-bottom: 8px; }
 .undo-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--amber-bd);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--amber);
  margin: 2px;
 }
 .undo-tag .undo-btn { cursor: pointer; color: #f59e0b; font-size: var(--fs-base); margin-left: 2px; }
 .undo-tag .undo-btn:hover { color: var(--red); }

 /* ─ ─ ADD VT MODAL ─────────────────────────────────────────────── */
 .addvt-body { padding: var(--sp-5); }

 /* ─ ─ BUTTONS ──────────────────────────────────────────────────── */
 .submit-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
 }
 .btn-reset {
  height: 40px;
  padding: 0 18px;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 500;
  cursor: pointer;
  transition: border-color .18s, color .18s;
 }
 .btn-reset:hover { border-color: var(--red); color: var(--red); }
 .btn-save {
  height: 40px;
  padding: 0 26px;
  background: linear-gradient(135deg, var(--accent), var(--accent-h));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform .18s, box-shadow .18s;
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
 }
 .btn-save:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,.35); }
 .btn-save.green {
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 2px 8px rgba(22,163,74,.25);
 }
 .btn-save.green:hover { box-shadow: 0 4px 14px rgba(22,163,74,.35); }
 .btn-save:disabled {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
 }
 .sel-info { font-size: 12px; color: var(--muted); }
 .sel-info strong { color: var(--accent); }

 /* ─ ─ DIVIDER ──────────────────────────────────────────────────── */
 .divider { height: 1px; background: var(--border); margin: 14px 0; }

 /* ─ ─ TOAST ────────────────────────────────────────────────────── */
 .toast-wrap {
  position: fixed;
  top: 66px; right: var(--sp-4);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 7px;
 }
 .toast {
  padding: 11px var(--sp-4);
  border-radius: var(--radius);
  font-size: var(--fs-base);
  font-weight: 500;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-md);
  animation: slideIn .22s ease;
  max-width: 420px;
  word-break: break-word;
 }
 .toast.success { background: #16a34a; }
 .toast.error  { background: var(--red); }
 .toast.warn  { background: var(--amber); }
 .toast.info  { background: var(--accent); }
 @keyframes slideIn {
  from { transform: translateX(110%); opacity: 0; }
  to  { transform: translateX(0);  opacity: 1; }
 }

 /* ─ ─ LOADING ──────────────────────────────────────────────────── */
 .loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,16,32,.5);
  z-index: 800;
  display: none;
  align-items: center;
  justify-content: center;
 }
 .loading-overlay.open { display: flex; }
 .loading-box {
  background: #fff;
  border-radius: 14px;
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-xl);
 }
 .spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
 }
 @keyframes spin { to { transform: rotate(360deg); } }
 .loading-box p { font-size: var(--fs-base); font-weight: 500; color: var(--muted); }
 .inline-spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
 }

 /* ─ ─ EMPTY STATE ──────────────────────────────────────────────── */
 .no-data {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
  font-size: var(--fs-base);
  grid-column: 1 / -1;
 }
 .no-data .nd-ico { font-size: 36px; margin-bottom: 8px; }
 .no-data p { font-size: 12px; margin-top: 4px; line-height: 1.6; }

 /* ─ ─ RESPONSIVE BASE ──────────────────────────────────────────── */
 @media (max-width: 900px) {
  .tab-pane { padding: 14px 14px 40px; }
  .g5, .g6 { grid-template-columns: repeat(2, 1fr); }
  .g4    { grid-template-columns: repeat(2, 1fr); }
  .c3, .c4 { grid-column: span 2; }
  .cuon-list { grid-template-columns: 1fr; }
 }
 @media (max-width: 600px) {
  .g2, .g3 { grid-template-columns: 1fr; }
  .c2    { grid-column: span 1; }
  .modal-box { max-height: 95vh; }
 }
