:root {
  --bg-main: #fdfcf9;
  --bg-soft: #f6f5ff;
  --card: #ffffff;
  --border: #e6e8f0;
  --text: #1e2433;
  --muted: #6b7280;
  --gold-dark: #b58328;
  --gold-main: #d4a13e;
  --gold-light: #fdf6e3;
  --gold-grad: linear-gradient(90deg, #a67622 0%, #dca946 55%, #f7e199 100%);
  --purple-main: #6d5dfc;
  --purple-soft: #f1efff;
  --poster-bg: #535386;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, input, select, button, textarea {
  font-family: Calibri, Arial, "Times New Roman", sans-serif;
}

body {
  background: radial-gradient(circle at top center, #fffdf7 0%, #f8f9fc 65%);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ==================== TOP NAVBAR (GGFLEX STYLE) ==================== */
.hub-navbar {
  background: #ffffff;
  border-bottom: 1px solid #eceef4;
  position: sticky;
  top: 0;
  z-index: 100;
}

.hub-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 22px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.aov-shield {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f3d27a 0%, #c8912c 100%);
  color: #422b05;
  font-weight: 900;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(181, 131, 40, 0.25);
}

.brand-txt strong {
  display: block;
  font-size: 16px;
  font-weight: 900;
  color: #a8741a;
  letter-spacing: 0.5px;
  line-height: 1.1;
}
.brand-txt span {
  display: block;
  font-size: 10.5px;
  color: #94a3b8;
  letter-spacing: 0.8px;
  font-weight: 700;
}

.hub-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  overflow-x: auto;
}

.nav-link {
  height: 100%;
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  padding: 0 14px;
  font-size: 14.5px;
  font-weight: 700;
  color: #4b5563;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover { color: #a8741a; }
.nav-link.active {
  color: #b58328;
  border-bottom-color: #c8912c;
}

.nav-badge {
  background: #d4a13e;
  color: #fff;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 11.5px;
}

.hub-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 16px 64px;
}

.hub-page { display: none; }
.hub-page.active { display: block; }

/* ==================== GGFLEX HERO HEADER ==================== */
.hub-hero {
  text-align: center;
  max-width: 780px;
  margin: 4px auto 22px;
}

.hub-hero h1 {
  font-size: 38px;
  font-weight: 400;
  letter-spacing: 2px;
  color: #d3a13b;
}

.hub-hero-sub {
  color: #b78a35;
  font-size: 16px;
  margin-top: 4px;
}

.guide-btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 14px 0 18px;
}
.guide-ornament-line {
  width: 64px;
  height: 1px;
  background: #d9b56d;
  position: relative;
}
.btn-guide-gold {
  background: linear-gradient(135deg, #b07f2b 0%, #c9963b 50%, #a57422 100%);
  color: #fff;
  border: 1.5px solid #e2c178;
  border-radius: 6px;
  padding: 7px 26px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(181, 131, 40, 0.22);
}
.btn-guide-gold:hover { filter: brightness(1.06); }

.combine-mode-banner {
  background: var(--gold-grad);
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.6px;
  padding: 12px;
  border-radius: 10px;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(181, 131, 40, 0.18);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 5px 15px;
  border-radius: 99px;
  background: #e8f8f0;
  color: #0d7a49;
  font-size: 13px;
  font-weight: 700;
}
.dot-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

/* ==================== GGFLEX SECTION CARDS ==================== */
.gg-main-wrap {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gg-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.025);
}
.gg-card.max-full { max-width: 100%; }

.gg-card-header {
  padding: 13px 18px;
  border-bottom: 1px solid #f1f3f8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #1e293b;
  text-transform: uppercase;
}
.gg-card-header.clickable { cursor: pointer; user-select: none; }

.gg-title-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.gg-title-bar::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: #d4a13e;
}
.req { color: #dc2626; }

.gg-card-body {
  padding: 16px 18px;
}

/* UPLOAD DROPZONE & ACCORDIONS */
.hub-upload-box {
  display: block;
  border: 1.5px dashed #d5dae5;
  background: #fafbfd;
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.hub-upload-box:hover {
  border-color: #d4a13e;
  background: #fffdf7;
}
.upload-main-txt {
  font-size: 15px;
  font-weight: 800;
  color: #b58328;
}
.upload-sub-txt {
  font-size: 13px;
  color: #8c96a6;
  margin-top: 3px;
}

.gg-accordion {
  margin-top: 10px;
  border: 1px solid #ebeef5;
  border-radius: 9px;
  overflow: hidden;
  background: #f9fafc;
}
.gg-acc-head {
  padding: 11px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  user-select: none;
}
.gg-acc-head.gold-open { background: #fdf6e4; color: #9a6b16; }
.gg-acc-head.purple-open { background: #f2f0ff; color: #5542f6; }

.gg-acc-body {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #ebeef5;
}

.btn-paste-wide {
  width: 100%;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid #e5c67b;
  background: #fdf6e4;
  color: #9a6b16;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 8px;
}
.btn-txt-file-wide {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d5d0ff;
  background: #f5f3ff;
  color: #5542f6;
  font-weight: 800;
  cursor: pointer;
}

.gg-textarea {
  width: 100%;
  min-height: 92px;
  border: 1px solid #dce1eb;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  resize: vertical;
  outline: none;
}
.gg-textarea:focus { border-color: #d4a13e; }

/* SCAN PROGRESS & DETECTED CHIPS */
.scan-prog {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.scan-prog-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.scan-prog-bar { height: 7px; background: #fef3c7; border-radius: 99px; overflow: hidden; }
.scan-prog-fill { height: 100%; width: 0%; background: #d97706; transition: width 0.2s; }

.detected-bar {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}
.det-chip {
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}
.btn-text-danger {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #dc2626;
  font-weight: 700;
  cursor: pointer;
}

/* ==================== TÙY CHỌN XỬ LÝ (GOLD CHECKBOXES + SUB-PANELS) ==================== */
.gg-opt-list {
  display: flex;
  flex-direction: column;
}
.gg-opt-item {
  border-bottom: 1px solid #f2f4f8;
  padding: 11px 2px;
}
.gg-opt-item:last-child { border-bottom: none; }

.gg-opt-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  color: #1f2937;
}
.gg-opt-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #d4a13e;
  cursor: pointer;
}

.gg-sub-form {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 9px;
  background: #f9fafc;
  border: 1px solid #e6e9f0;
}

/* HERO / SKIN CHIPS */
.champ-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.champ-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: #fdf6e3;
  border: 1px solid #e4c176;
  color: #8f6111;
  font-size: 12.5px;
  font-weight: 700;
}
.champ-chip b { cursor: pointer; font-size: 13px; }

/* ACCESSORIES (ĐÁ QUÝ, THẺ ĐỔI TÊN, GIẤY TUYỆT SẮC XANH & HỒNG) */
.items-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.item-vis-master-btn {
  padding: 5px 12px;
  border-radius: 99px;
  border: 1.5px solid #10b981;
  background: #ecfdf5;
  color: #047857;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}
.item-vis-master-btn:not(.active) {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
}
.pk-two-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pk-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fafbfd;
  transition: opacity 0.15s, background 0.15s;
}
.pk-box.item-muted {
  opacity: 0.52;
  background: #f1f5f9;
}
.pk-box img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; }
.pk-info { flex: 1; font-weight: 700; font-size: 13.5px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.pk-eye-btn {
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #047857;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.pk-eye-btn:not(.active) {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #475569;
}
.lib-card-actions {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 4px;
}
.lib-act-btn {
  border: 1px solid #3b4c85;
  background: #232f5c;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
}
.lib-act-btn.danger {
  border-color: #e11d48;
  background: rgba(225, 29, 72, 0.88);
  color: #ffffff;
}
.lib-act-btn:hover { filter: brightness(1.12); }

/* ==================== INPUTS & ORDER SECTION ==================== */
.hub-input, .hub-input-sm, .hub-select-sm, .hub-input-qty {
  border: 1px solid #dce1eb;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  background: #fff;
  color: #0f172a;
  outline: none;
}
.hub-input { width: 100%; }
.hub-input-sm { width: 100%; padding: 7px 10px; font-size: 13.5px; }
.hub-select-sm { padding: 7px 10px; font-size: 13.5px; }
.hub-input-qty { width: 78px; text-align: center; font-weight: 700; }
.hub-input:focus, .hub-input-sm:focus, .hub-input-qty:focus { border-color: #d4a13e; }

.lbl-sm { display: block; font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 6px; }
.lbl-xs { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.lbl-inline { font-size: 13.5px; font-weight: 700; color: #334155; }
.hint-xs { font-size: 12.5px; color: var(--muted); }

.order-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 14px;
  align-items: start;
}

.exclusive-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  background: #f1f3f9;
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.mode-tab-btn {
  padding: 6px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  color: #4b5563;
  cursor: pointer;
}
.mode-tab-btn.active {
  background: #ffffff;
  color: #a8741a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.quick-count-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.q-chip {
  padding: 3px 8px;
  border-radius: 6px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  font-size: 12px;
  font-weight: 700;
  color: #4b5563;
  cursor: pointer;
}
.q-chip.active { background: #fdf6e3; border-color: #d4a13e; color: #9a6b16; }

.shape-toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.shape-btn {
  padding: 11px;
  border-radius: 8px;
  border: 1.5px solid #dce1eb;
  background: #fff;
  font-weight: 700;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}
.shape-btn.active {
  background: #fdf8eb;
  border-color: #c8912c;
  color: #9a6b16;
}

.btn-merge-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #c8912c 0%, #a8741a 100%);
  color: #fff;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(181, 131, 40, 0.25);
}
.btn-merge-gold.full-w { width: 100%; padding: 13px; font-size: 15px; letter-spacing: 0.5px; }
.btn-merge-gold:hover { filter: brightness(1.06); }
.btn-merge-gold:disabled { opacity: 0.6; cursor: wait; }

.btn-outline-sm {
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn-outline-sm:hover { background: #f9fafb; border-color: #9ca3af; }

.btn-purple-outline {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid #cbc6ff;
  background: #fff;
  color: #5542f6;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn-purple-outline:hover { background: #f5f3ff; }

/* ==================== PAGE: ẢNH ĐÃ GHÉP (/images-history STYLE, PERMANENT DB) ==================== */
.history-wrap {
  max-width: 960px;
  margin: 0 auto;
}
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  background: #eeecff;
  color: #5542f6;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 8px;
}
.history-h1 {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
}
.history-toolbar-card {
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.03);
}
.history-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.history-search-inp {
  flex: 1;
  min-width: 220px;
  border: 1px solid #e2e8f0;
  border-radius: 99px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
}
.history-search-inp:focus { border-color: #6d5dfc; }

.accounts-db-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.acc-db-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  position: relative;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.acc-select-chk {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 19px;
  height: 19px;
  accent-color: #6d5dfc;
  z-index: 2;
  cursor: pointer;
}
.acc-db-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #535386;
  cursor: pointer;
  display: block;
}
.acc-db-body { padding: 12px 14px; }
.acc-db-title { font-size: 15px; font-weight: 800; color: #0f172a; }

.history-footer-bar {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.page-pill-active {
  background: #6d5dfc;
  color: #fff;
  font-weight: 800;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 13px;
}

/* ==================== PAGE: SỬA VỊ TRÍ & KẾT QUẢ ==================== */
.editor-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.rendered-showcase {
  background: #2b2b48;
  border-radius: 10px;
  padding: 12px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rendered-showcase img {
  max-width: 100%;
  max-height: 680px;
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.empty-render-msg { color: #cbd5e1; font-size: 14px; text-align: center; padding: 24px; }

.editable-pills-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ed-label { font-weight: 800; font-size: 14px; color: #334155; }
.ed-pill {
  padding: 5px 13px;
  border-radius: 99px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.pill-blue { background: #3b66d4; cursor: default; }
.pill-purple { background: #6b46c1; }
.pill-orange { background: #dc6b2f; }
.pill-red { background: #d64045; }
.pill-green { background: #2f855a; }

.editor-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.btn-step { width: 28px; height: 28px; border-radius: 6px; border: 1px solid #cbd5e1; background: #fff; font-weight: 800; cursor: pointer; }
.formula-live-tag { background: #fdf6e3; color: #9a6b16; padding: 4px 10px; border-radius: 6px; font-weight: 800; font-size: 13px; }

.swap-hint-banner {
  background: #fef9c3;
  border: 1.5px solid #eab308;
  color: #854d0e;
  padding: 9px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slot-sections-wrap { display: flex; flex-direction: column; gap: 14px; }
.slot-group-box {
  border-radius: 10px;
  padding: 3px;
  background-image: linear-gradient(90deg, #5cffff 0%, #ff9cfa 100%);
}
.slot-group-inner { background: #535386; border-radius: 8px; padding: 12px; }
.slot-group-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.slot-cards-flex {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 8px;
}

.clean-card {
  background: #232c54;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.18);
  cursor: grab;
  position: relative;
  display: flex;
  flex-direction: column;
  user-select: none;
}
.clean-card:hover { border-color: #5cffff; }
.clean-card.swap-active { border: 2.5px solid #facc15 !important; box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.45); }
.clean-card.drag-over { border: 2.5px dashed #ff9cfa !important; opacity: 0.75; }

.clean-card-thumb { position: relative; width: 100%; aspect-ratio: 382 / 539; overflow: hidden; }
.clean-card-thumb img.main-img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.clean-card-thumb img.evo-center { position: absolute; left: 50%; top: 63.5%; transform: translate(-50%, -50%); width: 56%; pointer-events: none; }
.clean-card-thumb img.top-center { position: absolute; left: 50%; top: 67%; transform: translate(-50%, -50%); width: 46%; pointer-events: none; }

.card-x-btn {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(225, 29, 72, 0.92); color: #fff; font-size: 11px; font-weight: 800; cursor: pointer;
}
.card-pos-num {
  position: absolute; top: 4px; left: 4px; background: rgba(15, 23, 42, 0.78);
  color: #e2e8f0; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; pointer-events: none;
}
.clean-card-footer { padding: 5px 6px; background: #1a2142; color: #f8fafc; }
.clean-skin-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }

.evo-pills-row { display: flex; justify-content: center; gap: 2px; margin-top: 4px; }
.evo-mini-btn {
  border: 1px solid #3b4c85; background: #232f5c; color: #cbd5e1;
  font-size: 10px; font-weight: 700; padding: 1px 4px; border-radius: 3px; cursor: pointer;
}
.evo-mini-btn.active { background: #38bdf8; color: #0f172a; border-color: #38bdf8; }

.clean-cards-grid, .mini-skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 9px;
}
.mini-skin-grid { max-height: 290px; overflow-y: auto; padding: 4px; }
.modal-scroll-grid { max-height: 310px; overflow-y: auto; padding: 4px; }

.pick-skin-card { background: #1a2142; border-radius: 7px; overflow: hidden; border: 2px solid #cbd5e1; cursor: pointer; }
.pick-skin-card.picked { border-color: #10b981; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3); }
.pick-skin-card img { width: 100%; aspect-ratio: 382 / 539; object-fit: cover; display: block; }
.pick-skin-name { font-size: 12px; color: #fff; padding: 4px 6px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mini-effects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}
.mini-eff-card { border: 2px solid #cbd5e1; border-radius: 7px; overflow: hidden; cursor: pointer; background: #1e293b; color: #fff; }
.mini-eff-card.picked { border-color: #10b981; }
.mini-eff-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.mini-eff-card div { font-size: 12px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==================== PAGE: CẤU HÌNH (/cau-hinh PURPLE CARD STYLE) ==================== */
.cfg-card-narrow {
  max-width: 540px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 18px;
  padding: 28px 26px;
  border: 1px solid #ebe9ff;
  box-shadow: 0 8px 30px rgba(109, 93, 252, 0.06);
}
.cfg-purple-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #7c6cff 0%, #5b48f0 100%);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}
.cfg-divider-lbl {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #8b95a5;
  margin: 18px 0 10px;
  position: relative;
}
.seg-group { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.seg-btn {
  min-width: 56px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  font-weight: 800;
  font-size: 13.5px;
  color: #1e293b;
  cursor: pointer;
}
.seg-btn.active {
  border-color: #7c6cff;
  background: #f2f0ff;
  color: #5542f6;
}
.btn-save-purple {
  width: 100%;
  margin-top: 22px;
  padding: 13px;
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, #7666ff 0%, #5b49f5 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.btn-save-purple:hover { filter: brightness(1.05); }

/* BACKUP & MODALS */
.backup-cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.backup-box, .backup-restore-box, .laptop-guide-box {
  padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: #fafbfd;
}
.guide-steps { padding-left: 20px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.62); z-index: 999;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  background: #fff; border-radius: 14px; padding: 22px; max-width: 500px;
  width: 100%; max-height: 90vh; overflow-y: auto;
}
.modal-card.wide-modal { max-width: 780px; }
.guide-modal-step {
  padding: 12px 14px;
  border-left: 3px solid #d4a13e;
  background: #fdfaf2;
  border-radius: 6px;
  margin-bottom: 10px;
}
.guide-modal-step strong { color: #9a6b16; display: block; margin-bottom: 4px; }

.new-skins-prompt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; max-height: 52vh; overflow-y: auto; }
.new-skin-item { display: flex; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: #f8fafc; }
.new-skin-item img { width: 66px; aspect-ratio: 382 / 539; object-fit: cover; border-radius: 5px; }
.new-skin-fields { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.wifi-url-box { margin: 12px 0; padding: 12px; border-radius: 8px; background: #fdf6e3; border: 1px solid #d4a13e; font-family: monospace; font-size: 16px; font-weight: 800; text-align: center; color: #9a6b16; }

.excluded-tray { padding: 10px 14px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; font-weight: 700; }
.board-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid-2-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-search-bar { display: flex; gap: 8px; }
.row-flex-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.center-txt { text-align: center; }
.center-btn-wrap { display: flex; justify-content: center; }
.hidden { display: none !important; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

@media (max-width: 820px) {
  .order-grid-2, .pk-two-cards, .backup-cards-grid, .grid-2-cols { grid-template-columns: 1fr; }
}


/* ==================== NEW: SPACING BAR, TAG DRAG-DROP & MARQUEE MULTI-SELECT ==================== */
.editor-spacing-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.spacing-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 3px 8px;
  border-radius: 7px;
}

.tag-drag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: grab;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}
.tag-drag-row:active { cursor: grabbing; }
.tag-drag-row.dragging { opacity: 0.45; transform: scale(0.98); }
.tag-drag-row.drag-over {
  border-color: #d4a13e;
  background: #fffbeb;
  box-shadow: 0 0 0 2px rgba(212, 161, 62, 0.32);
}
.tag-drag-handle {
  font-size: 16px;
  font-weight: 800;
  color: #94a3b8;
  padding: 0 4px;
  user-select: none;
  cursor: grab;
}

.lib-marquee-wrap {
  position: relative;
  user-select: none;
}
.lib-marquee-box {
  position: fixed;
  z-index: 9999;
  border: 2px solid #d4a13e;
  background: rgba(212, 161, 62, 0.18);
  border-radius: 6px;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(212, 161, 62, 0.35);
}
.clean-card {
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.clean-card.lib-selected-card {
  border: 2.5px solid #facc15 !important;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.42), 0 6px 14px rgba(15, 23, 42, 0.25);
  transform: translateY(-2px) scale(1.015);
}
.clean-card.lib-marquee-hit {
  border: 2.5px solid #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.38);
}

.lib-floating-batch {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 950;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  border: 1.5px solid #d4a13e;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  animation: floatBarIn 0.18s ease-out;
}
@keyframes floatBarIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

#cleanSlotSections .clean-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

.shortcut-toast {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  border: 1.5px solid #38bdf8;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  animation: toastSlideIn 0.16s ease-out;
}
.shortcut-toast.hidden {
  display: none !important;
}
.shortcut-toast-btn {
  background: #d4a13e;
  color: #0f172a;
  border: none;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.shortcut-toast-btn:hover {
  background: #eab308;
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
