:root {
  --brand: #6366f1;
  --brand-2: #ec4899;
  --brand-grad: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  --zalo: #0068ff;
  --zalo-grad: linear-gradient(135deg, #0068ff 0%, #00a8ff 100%);
  --bg: #0a0a0f;
  --surface: #13131a;
  --surface-2: #1c1c26;
  --surface-3: #252532;
  --border: rgba(255,255,255,0.08);
  --border-2: rgba(255,255,255,0.12);
  --text: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b7b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --radius-xxs: 8px;
  --shadow: 0 20px 60px -20px rgba(0,0,0,0.5);
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px;
  margin-bottom: 32px;
  padding: 0 8px;
}
.sidebar-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand-grad);
  display: grid; place-items: center;
  color: #fff; font-size: 16px;
}
.sidebar-section { margin-bottom: 24px; }
.sidebar-section-title {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 12px;
  margin-bottom: 8px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 2px;
  text-decoration: none;
}
.sidebar-item:hover { background: var(--surface-2); color: var(--text); }
.sidebar-item.active { background: var(--brand); color: #fff; }
.sidebar-item i { width: 18px; text-align: center; font-size: 15px; }
.sidebar-item .badge {
  margin-left: auto;
  background: var(--surface-3);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.sidebar-item.active .badge { background: rgba(255,255,255,0.2); color: #fff; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,0.5);
}
.sidebar-overlay.open { display: block; }

.main {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}
.topbar-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.topbar-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  padding: 10px 18px; border-radius: var(--radius-xs);
  font-weight: 600; font-size: 13.5px;
  cursor: pointer; border: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.2s;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,0.3);
}
.btn-zalo {
  background: var(--zalo-grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,104,255,0.3);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  padding: 9px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}
.search-box input {
  background: transparent; border: none;
  color: var(--text); font-size: 13px;
  outline: none; width: 200px;
  font-family: inherit;
}
.search-box i { color: var(--text-muted); font-size: 13px; }
.filter-select {
  padding: 9px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.view-toggle {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  overflow: hidden;
}
.view-toggle button {
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s;
}
.view-toggle button.active {
  background: var(--surface-3);
  color: var(--text);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.card-grid.list-view { grid-template-columns: 1fr; }

.vcard-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.25s ease;
  position: relative;
  animation: slideIn 0.4s ease both;
}
.vcard-item:hover {
  transform: translateY(-4px);
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}
.vcard-item.draft { opacity: 0.75; }
.vcard-item.draft:hover { opacity: 1; }
.vcard-item.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand), var(--shadow);
}
.vcard-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  box-shadow: var(--shadow-lg);
}
.vcard-item.drag-over {
  border-color: var(--brand);
  border-style: dashed;
}

.vcard-checkbox {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 6;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.3);
  cursor: pointer;
  display: grid; place-items: center;
  color: transparent;
  font-size: 11px;
  transition: all 0.2s;
}
.vcard-checkbox:hover { border-color: var(--brand); }
.vcard-item.selected .vcard-checkbox {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.vcard-drag-handle {
  position: absolute;
  top: 12px; right: 88px;
  z-index: 6;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: grab;
  display: none;
  place-items: center;
  color: rgba(255,255,255,0.8);
  font-size: 12px;
}
.card-grid.custom-order .vcard-drag-handle { display: grid; }
.vcard-drag-handle:active { cursor: grabbing; }

.vcard-cover {
  height: 130px;
  position: relative;
  overflow: hidden;
}
.vcard-cover-bg { width: 100%; height: 100%; }
.vcard-cover-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.6) 100%);
}
.vcard-status-badge {
  position: absolute;
  top: 12px; right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(10px);
}
.vcard-status-badge.active {
  background: rgba(34,197,94,0.2);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.3);
}
.vcard-status-badge.draft {
  background: rgba(245,158,11,0.2);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.3);
}
.vcard-template-badge {
  position: absolute;
  bottom: 10px; left: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.vcard-team-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(99,102,241,0.15);
  color: var(--brand);
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 12px;
}
.vcard-quick-actions {
  position: absolute;
  top: 12px; left: 42px;
  display: flex; gap: 6px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
}
.vcard-item:hover .vcard-quick-actions { opacity: 1; }
.vcard-quick-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
.vcard-quick-btn:hover { background: rgba(255,255,255,0.2); }

.vcard-avatar-wrap {
  position: relative;
  margin-top: -36px;
  margin-left: 20px;
  z-index: 2;
}
.vcard-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 4px solid var(--surface);
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 24px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.vcard-avatar img { width: 100%; height: 100%; object-fit: cover; }
.vcard-avatar-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
}

.vcard-body { padding: 12px 20px 20px; }
.vcard-name-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.vcard-name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.vcard-verified {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #1da1f2;
  display: grid; place-items: center;
  color: #fff; font-size: 9px;
}
.vcard-role { font-size: 13px; color: var(--text-secondary); margin-bottom: 2px; }
.vcard-company { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.vcard-bio {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vcard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-bottom: 16px;
}
.vcard-stat { text-align: center; }
.vcard-stat-value { font-size: 16px; font-weight: 700; color: var(--text); }
.vcard-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.vcard-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vcard-actions .btn { flex: 1; justify-content: center; min-width: 40px; }

.list-view .vcard-item {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: stretch;
}
.list-view .vcard-cover { height: 100%; min-height: 120px; }
.list-view .vcard-avatar-wrap {
  margin-top: 0;
  margin-left: 0;
  position: absolute;
  bottom: 10px;
  left: 10px;
}
.list-view .vcard-avatar { width: 50px; height: 50px; font-size: 18px; border-width: 3px; }
.list-view .vcard-body { padding: 16px 20px; }
.list-view .vcard-stats { margin-bottom: 0; padding-top: 0; border-top: none; }
.list-view .vcard-actions {
  flex-direction: column;
  padding: 16px;
  border-left: 1px solid var(--border);
  flex-wrap: nowrap;
}

.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.3s cubic-bezier(.2,.8,.2,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface-2);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 14px;
}
.modal-close:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
  gap: 10px;
  flex-wrap: wrap;
}
.modal-footer-left, .modal-footer-right { display: flex; gap: 8px; flex-wrap: wrap; }

.form-section { margin-bottom: 28px; }
.form-section-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title i { color: var(--brand); font-size: 14px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.form-row.single { grid-template-columns: 1fr; }
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.form-label .required { color: var(--danger); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.avatar-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.avatar-preview {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--brand-grad);
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 28px;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--surface-3);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload-actions { display: flex; flex-direction: column; gap: 8px; }
.avatar-upload-btn {
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xxs);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
}
.avatar-upload-btn:hover { background: var(--surface-3); }

.cover-upload {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cover-preview {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  position: relative;
}
.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover-preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}
.cover-preview-placeholder i { font-size: 28px; opacity: 0.7; }
.cover-preview.has-image .cover-preview-placeholder { display: none; }

.vcard-cover-bg img,
.preview-cover-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.preview-cover.has-photo { height: 300px; }

.cover-colors {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cover-color {
  width: 36px; height: 36px;
  border-radius: 10px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
}
.cover-color:hover { transform: scale(1.1); }
.cover-color.active { border-color: #fff; box-shadow: 0 0 0 2px var(--brand); }

.social-links-list { display: flex; flex-direction: column; gap: 10px; }
.social-link-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 10px;
  align-items: center;
}
.social-link-platform {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  text-transform: capitalize;
}
.social-link-platform i { width: 16px; text-align: center; }
.social-link-input {
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.social-link-input:focus { border-color: var(--brand); }
.social-link-remove {
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 12px;
}
.social-link-remove:hover { background: rgba(239,68,68,0.15); color: var(--danger); }
.add-social-btn {
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}
.add-social-btn:hover { border-color: var(--brand); color: var(--brand); }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  margin-bottom: 10px;
}
.toggle-label { font-size: 13px; font-weight: 500; }
.toggle-switch {
  width: 44px; height: 24px;
  background: var(--surface-3);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}
.toggle-switch.on { background: var(--brand); }
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.toggle-switch.on::after { transform: translateX(20px); }

.preview-modal .modal { max-width: 430px; max-height: 95vh; }
.preview-modal .modal-body { padding: 0; overflow-y: auto; }
.preview-card {
  background: #0a0a0a;
  min-height: 100%;
  --pv-brand: var(--brand);
}
.preview-cover { position: relative; height: 320px; overflow: hidden; }
.preview-cover.has-photo { height: 320px; }
.preview-cover-bg { width: 100%; height: 100%; }
.preview-cover-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.preview-cover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
}
.preview-cover-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  z-index: 2;
}
.preview-cover-logo {
  display: flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: 15px; color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.preview-cover-share {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  display: grid; place-items: center;
  color: #fff; cursor: pointer;
  font-size: 14px;
}
.preview-profile {
  padding: 20px 20px 0;
  position: relative;
  z-index: 1;
}
.preview-name {
  font-size: 24px; font-weight: 800;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -0.02em;
  color: #fff;
}
.preview-role { font-size: 14px; color: #a0a0a0; margin-top: 4px; }
.preview-location { font-size: 13px; color: #707070; margin-top: 2px; }
.preview-cta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 18px 20px;
}
.preview-cta-btn {
  padding: 13px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit;
}
.preview-cta-save {
  background: #1e1e1e;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
}
.preview-cta-exchange { background: var(--pv-brand, #e91e8c); color: #fff; }
.preview-section { padding: 0 20px; margin-top: 20px; }
.preview-section:last-child { padding-bottom: 28px; }
.preview-section-title {
  font-size: 13px; font-weight: 700;
  color: #a0a0a0;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.preview-about {
  font-size: 14px;
  line-height: 1.65;
  color: #a0a0a0;
}
/* Contact brand styles loaded from contact.css */
.preview-featured-item,
.preview-connect-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #fff;
}
.preview-featured-item:last-child,
.preview-connect-item:last-child { border-bottom: none; }
.preview-featured-icon,
.preview-connect-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: #1e1e1e;
  display: grid; place-items: center;
  color: #a0a0a0; font-size: 14px; flex-shrink: 0;
}
.preview-featured-text,
.preview-connect-text { flex: 1; font-size: 14px; font-weight: 500; }
.preview-incentive-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.preview-incentive-btn,
.card-partner-btn {
  padding: 12px 14px; border-radius: 10px;
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  font-size: 13px; font-weight: 500;
  text-align: center;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.preview-incentive-btn:hover,
.card-partner-btn:hover {
  background: #2a2a2a;
  border-color: rgba(255,255,255,0.14);
}
.preview-incentive-btn.active,
.card-partner-btn.active {
  background: linear-gradient(135deg, #6366f1, #ec4899);
  border-color: transparent;
}
.preview-brand-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.preview-brand-logo,
.card-offer-tile {
  aspect-ratio: 1/1;
  background: #fff;
  border-radius: 10px;
  display: grid;
  place-items: center;
  padding: 8px 6px 18px;
  border: none;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.card-offer-tile:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}
.preview-brand-logo span,
.card-offer-logo {
  font-size: 10px; font-weight: 800;
  text-align: center; line-height: 1.1; color: #000;
  word-break: break-word;
}
.card-offer-pill {
  position: absolute;
  left: 4px; right: 4px; bottom: 4px;
  font-size: 8px;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
  border-radius: 999px;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-offers-hint {
  font-size: 11px;
  color: #6b6b7b;
  margin-top: 10px;
  text-align: center;
}
.offer-detail-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
}
.offer-detail-logo {
  width: 64px; height: 64px; border-radius: 16px;
  display: grid; place-items: center;
  font-size: 22px; color: #fff; font-weight: 800;
  flex-shrink: 0;
}
.offer-detail-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.offer-detail-category { font-size: 12px; color: var(--text-muted, #6b6b7b); }
.offer-detail-discount {
  font-size: 22px; font-weight: 800; color: var(--success, #22c55e);
  margin-bottom: 12px;
}
.offer-detail-desc {
  font-size: 14px; color: var(--text-secondary, #a0a0b0);
  line-height: 1.6; margin-bottom: 16px;
}
.voucher-box {
  background: var(--surface-2, #1e1e1e);
  border: 2px dashed var(--border-2, rgba(255,255,255,0.14));
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin-bottom: 16px;
}
.voucher-label {
  font-size: 11px; color: var(--text-muted, #6b6b7b);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.voucher-code {
  font-size: 20px; font-weight: 800;
  color: var(--brand, #6366f1); letter-spacing: 2px;
  margin-bottom: 8px;
}
.voucher-expiry { font-size: 12px; color: var(--text-muted, #6b6b7b); }
.preview-social-row { display: flex; gap: 8px; flex-wrap: wrap; }
.preview-social-btn {
  width: 44px; height: 44px; border-radius: 12px;
  background: #1e1e1e;
  border: 1px solid rgba(255,255,255,0.08);
  display: grid; place-items: center;
  color: #fff;
  font-size: 16px;
  text-decoration: none;
}
.preview-video-scroll {
  display: flex; gap: 12px; overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.preview-video-scroll::-webkit-scrollbar { display: none; }
.preview-video-card {
  flex-shrink: 0; width: 240px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
}
.preview-video-card img {
  width: 100%; height: 150px; object-fit: cover; display: block;
}
.preview-video-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.8) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px;
}
.preview-video-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, var(--pv-brand, #e91e8c) 90%, transparent);
  display: grid; place-items: center;
  color: #fff; font-size: 16px;
}
.preview-video-title {
  font-size: 12px; font-weight: 600; color: #fff;
  display: flex; align-items: center; gap: 6px;
}
.preview-video-title .badge {
  width: 18px; height: 18px; border-radius: 4px;
  background: var(--pv-brand, #e91e8c);
  display: grid; place-items: center;
  font-size: 8px; flex-shrink: 0;
}
.share-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.share-option {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s;
}
.share-option:hover { transform: translateY(-2px); background: var(--surface-3); }
.share-option i { font-size: 20px; color: var(--text); }

.qr-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}
.qr-box {
  width: 200px; height: 200px;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.qr-box canvas, .qr-box img { width: 100% !important; height: 100% !important; }

.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 300;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--info); }
.toast.zalo i { color: var(--zalo); }

.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid; place-items: center;
  margin: 0 auto 20px;
  font-size: 32px;
  color: var(--text-muted);
}
.empty-state-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-state-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.confirm-dialog .modal { max-width: 420px; }
.confirm-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(239,68,68,0.15);
  display: grid; place-items: center;
  margin: 0 auto 16px;
  font-size: 24px;
  color: var(--danger);
}
.confirm-title {
  font-size: 18px; font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}
.confirm-desc {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.menu-toggle {
  display: none;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  place-items: center;
  font-size: 16px;
  margin-bottom: 10px;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

/* ===== BULK BAR ===== */
.bulk-bar {
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: none;
  align-items: center;
  justify-content: space-between;
  animation: slideDown 0.3s ease;
  box-shadow: 0 0 0 1px var(--brand), 0 10px 30px rgba(99,102,241,0.15);
}
.bulk-bar.show { display: flex; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.bulk-bar-left, .bulk-bar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bulk-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  margin-right: 6px;
}
.bulk-count span {
  background: var(--brand);
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  margin-right: 6px;
}

/* ===== TEMPLATES ===== */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.template-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: all 0.2s;
  position: relative;
  background: var(--surface-2);
}
.template-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.template-card.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.template-preview { height: 72px; }
.template-info { padding: 10px 12px; }
.template-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.template-desc { font-size: 11px; color: var(--text-muted); }
.template-check {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: none;
  place-items: center;
  font-size: 10px;
}
.template-card.selected .template-check { display: grid; }

/* ===== TEAM SHARING ===== */
.team-member-list { display: flex; flex-direction: column; gap: 10px; }
.team-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}
.team-member-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--brand-grad);
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.team-member-info { flex: 1; min-width: 0; }
.team-member-name { font-size: 14px; font-weight: 600; }
.team-member-email { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.permission-select {
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.team-member-remove {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 12px;
}
.team-member-remove:hover { background: rgba(239,68,68,0.15); color: var(--danger); }
.add-member-form {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.add-member-form input {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.add-member-form input:focus { border-color: var(--brand); }

/* ===== ZALO / SMART SCANNER ===== */
.zalo-badge {
  margin-left: auto;
  background: var(--zalo);
  color: #fff;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.zalo-quick-add {
  background: linear-gradient(135deg, rgba(0,104,255,0.1) 0%, rgba(0,168,255,0.05) 100%);
  border: 1px solid rgba(0,104,255,0.3);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.zalo-quick-add-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.zalo-quick-add-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--zalo-grad);
  display: grid; place-items: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}
.zalo-quick-add-title { font-size: 14px; font-weight: 700; }
.zalo-quick-add-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.zalo-input-row { display: flex; gap: 8px; flex-wrap: wrap; }
.zalo-input-row input {
  flex: 1;
  min-width: 200px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.zalo-input-row input:focus { border-color: var(--zalo); }

.platform-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.platform-chip i { font-size: 12px; }
.platform-chip.zalo { border-color: rgba(0,104,255,0.4); color: #7db4ff; }

.qr-scanner-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-xs);
}
.qr-scanner-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.qr-scanner-tab.active { background: var(--surface-3); color: var(--text); }
.scanner-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
  background: #000;
}
#qr-reader {
  width: 100% !important;
  border: none !important;
}
#qr-reader video { border-radius: var(--radius-sm) !important; }
#qr-reader__dashboard { display: none !important; }
.scanning-indicator {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 180px; height: 180px;
  border: 2px solid var(--brand);
  border-radius: 50%;
  pointer-events: none;
  animation: pulse-ring 2s ease-out infinite;
  display: none;
}
@keyframes pulse-ring {
  0% { transform: translate(-50%, -50%) scale(0.85); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.35); opacity: 0; }
}
.scanner-result {
  margin-top: 16px;
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: none;
  animation: slideDown 0.3s ease;
}
.scanner-result.show { display: block; }
.scan-result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.scan-result-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 18px; color: #fff;
  flex-shrink: 0;
}
.scan-result-platform {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.scan-result-type {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.platform-detected-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(34,197,94,0.15);
  color: var(--success);
}
.scanner-result-data {
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
  padding: 10px;
  background: var(--surface-3);
  border-radius: 8px;
  margin-bottom: 12px;
  max-height: 80px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.scanner-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.scanner-result-actions .btn { justify-content: center; }
.pi-zalo { background: var(--zalo-grad); }
.pi-facebook { background: linear-gradient(135deg, #1877f2, #0d5bc4); }
.pi-instagram { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.pi-whatsapp { background: linear-gradient(135deg, #25d366, #128c7e); }
.pi-telegram { background: linear-gradient(135deg, #0088cc, #005f8c); }
.pi-linkedin { background: linear-gradient(135deg, #0077b5, #005582); }
.pi-twitter { background: linear-gradient(135deg, #000, #333); }
.pi-tiktok { background: linear-gradient(135deg, #000, #25f4ee); }
.pi-youtube { background: linear-gradient(135deg, #ff0000, #cc0000); }
.pi-wechat { background: linear-gradient(135deg, #07c160, #06ad56); }
.pi-line { background: linear-gradient(135deg, #00c300, #00a300); }
.pi-snapchat { background: linear-gradient(135deg, #fffc00, #f7d300); color: #111 !important; }
.pi-vcard { background: var(--brand-grad); }
.pi-url { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.pi-phone { background: linear-gradient(135deg, #22c55e, #16a34a); }
.pi-email { background: linear-gradient(135deg, #ef4444, #dc2626); }
.pi-unknown { background: linear-gradient(135deg, #6b7280, #4b5563); }
.scan-history {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.scan-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.scan-history-item:hover { background: var(--surface-3); }
.scan-history-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  font-size: 13px;
  flex-shrink: 0;
}
.scan-history-info { flex: 1; min-width: 0; }
.scan-history-platform { font-size: 12px; font-weight: 600; }
.scan-history-data {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.scan-history-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.scanner-upload-zone {
  text-align: center;
  padding: 40px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s;
}
.scanner-upload-zone:hover { border-color: var(--brand); }

@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .social-link-row { grid-template-columns: 1fr; }
  .share-options { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .menu-toggle { display: grid; }
  .list-view .vcard-item { grid-template-columns: 1fr; }
  .list-view .vcard-cover { height: 100px; }
  .list-view .vcard-actions {
    flex-direction: row;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 12px 20px;
  }
  .bulk-bar { flex-direction: column; gap: 12px; align-items: stretch; }
  .bulk-bar-left, .bulk-bar-right { justify-content: center; }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
  .vcard-drag-handle { right: 12px; top: 48px; }
}
