/* =====================================================================
   Brand Studio™ — Complete Stylesheet
   Portivo Portfolio Builder
   ===================================================================== */

/* ── Layout ── */
.bs-layout {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 20, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  font-family: 'Inter', sans-serif;
  color: #f1f5f9;
  overflow: hidden;
}

/* ── Top Bar ── */
.bs-topbar {
  height: 64px;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: rgba(15, 15, 30, 0.95);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899) 1;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.bs-topbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
  opacity: 0.6;
}

.bs-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: #94a3b8;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.bs-back-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #f1f5f9;
  border-color: rgba(255,255,255,0.2);
}

.bs-brand-title {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  flex: 1;
}

.bs-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.bs-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.bs-action-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #f1f5f9;
}

.bs-action-btn.primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.bs-action-btn.primary:hover {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59,130,246,0.4);
}

/* ── Body ── */
.bs-body {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* ── Sidebar ── */
.bs-sidebar {
  width: 220px;
  min-width: 220px;
  background: rgba(8, 8, 18, 0.9);
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.bs-sidebar::-webkit-scrollbar { width: 4px; }
.bs-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.bs-sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #475569;
  padding: 12px 16px 6px;
}

.bs-asset-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
  border-radius: 0;
  position: relative;
}
.bs-asset-btn i {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.bs-asset-btn:hover {
  background: rgba(255,255,255,0.05);
  color: #cbd5e1;
}
.bs-asset-btn.active {
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
  border-left: 2px solid #3b82f6;
}
.bs-asset-btn.active i { color: #3b82f6; }

.bs-sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.05);
  margin: 8px 16px;
}

.bs-recent-list {
  padding: 4px 0;
}

.bs-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  transition: color 0.15s;
}
.bs-recent-item:hover { color: #94a3b8; }
.bs-recent-item i { font-size: 14px; flex-shrink: 0; }
.bs-recent-name { font-weight: 500; color: #64748b; }
.bs-recent-meta { font-size: 11px; color: #334155; }
.bs-empty-state { padding: 12px 16px; font-size: 12px; color: #334155; font-style: italic; }

/* ── Main Preview Area ── */
.bs-main {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(5, 5, 15, 0.85);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.bs-main::-webkit-scrollbar { width: 6px; }
.bs-main::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.bs-preview-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 24px 20px;
  width: 100%;
  min-height: 100%;
  gap: 20px;
}

.bs-preview-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  align-self: flex-start;
}

.bs-card-sides {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 3px;
  align-self: flex-start;
}
.bs-side-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.bs-side-btn.active {
  background: rgba(59,130,246,0.2);
  color: #60a5fa;
}
.bs-side-btn:hover:not(.active) { color: #94a3b8; }

.bs-preview-canvas {
  background: rgba(20, 20, 35, 0.6);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.bs-preview-canvas::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
}

#bs-card-container {
  position: relative;
  z-index: 1;
}

.bs-export-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.bs-export-fmt-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.bs-export-fmt-btn:hover {
  background: rgba(255,255,255,0.09);
  color: #f1f5f9;
  border-color: rgba(255,255,255,0.18);
}
.bs-export-fmt-btn.primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.bs-export-fmt-btn.primary:hover {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59,130,246,0.35);
}

/* ── Right Panel ── */
.bs-right-panel {
  width: 300px;
  min-width: 300px;
  background: rgba(8, 8, 18, 0.9);
  border-left: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.bs-right-panel::-webkit-scrollbar { width: 4px; }
.bs-right-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.bs-panel-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 4px;
  background: rgba(5, 5, 15, 0.5);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.bs-panel-tabs::-webkit-scrollbar { display: none; }

.bs-panel-tab {
  background: transparent;
  border: none;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  padding: 11px 8px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  flex: 1;
  text-align: center;
}
.bs-panel-tab:hover { color: #94a3b8; }
.bs-panel-tab.active {
  color: #60a5fa;
  border-bottom-color: #3b82f6;
}

.bs-panel-content {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 16px;
}
.bs-panel-content.active { display: flex; }

.bs-panel-section {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.bs-panel-section:last-child { border-bottom: none; }
.bs-panel-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #334155;
  margin-bottom: 10px;
}

/* ── Theme Grid ── */
.bs-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.bs-theme-swatch {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 7px 8px;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
}
.bs-theme-swatch:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.14);
}
.bs-theme-swatch.active {
  border-color: #3b82f6;
  background: rgba(59,130,246,0.1);
}
.bs-swatch-c {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
}
.bs-swatch-name {
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bs-theme-swatch.active .bs-swatch-name { color: #94a3b8; }

/* ── Template Grid ── */
.bs-template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.bs-tpl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 10px;
  color: #475569;
  font-weight: 500;
}
.bs-tpl-btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); color: #94a3b8; }
.bs-tpl-btn.active { border-color: #3b82f6; background: rgba(59,130,246,0.1); color: #60a5fa; }
.bs-tpl-preview {
  width: 100%;
  height: 36px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

/* ── Color Pickers ── */
.bs-color-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.bs-color-input {
  width: 36px;
  height: 28px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
  background: transparent;
}

/* ── Toggles ── */
.bs-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.bs-toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 21px;
  flex-shrink: 0;
}
.bs-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.bs-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 21px;
  transition: 0.2s;
  border: 1px solid rgba(255,255,255,0.1);
}
.bs-toggle-slider::before {
  content: '';
  position: absolute;
  height: 15px;
  width: 15px;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: #64748b;
  border-radius: 50%;
  transition: 0.2s;
}
.bs-toggle input:checked + .bs-toggle-slider { background: rgba(59,130,246,0.3); border-color: #3b82f6; }
.bs-toggle input:checked + .bs-toggle-slider::before { transform: translateY(-50%) translateX(17px); background: #60a5fa; }

/* ── Chips ── */
.bs-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.bs-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  color: #64748b;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.bs-chip:hover { background: rgba(255,255,255,0.08); color: #94a3b8; }
.bs-chip.active { background: rgba(59,130,246,0.15); border-color: #3b82f6; color: #60a5fa; }

/* ── Form Controls ── */
.bs-label {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
}

.bs-select,
.bs-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
  margin-top: 4px;
}
.bs-select:focus,
.bs-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(255,255,255,0.07);
}
.bs-select option { background: #1e293b; color: #f1f5f9; }

.bs-input-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 0;
}

/* ── Export Cards ── */
.bs-export-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 6px;
}
.bs-export-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}
.bs-export-card-icon {
  font-size: 22px;
  line-height: 1;
  margin-top: 2px;
}
.bs-export-card-info { flex: 1; }
.bs-export-card-name { font-size: 13px; font-weight: 600; color: #cbd5e1; }
.bs-export-card-desc { font-size: 11px; color: #475569; margin-top: 2px; }

/* ── Business Card ── */
.bs-bcard {
  width: 480px;
  height: 274px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
}
.bs-bcard-front { }
.bs-bcard-back { }

/* ── ID Card ── */
.bs-id-card {
  width: 280px;
  height: 420px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* ── LinkedIn Banner ── */
.bs-linkedin-banner {
  width: 376px;
  height: 64px;
  position: relative;
  overflow: hidden;
}

/* ── GitHub Banner ── */
.bs-github-banner {
  width: 640px;
  height: 160px;
  position: relative;
  overflow: hidden;
}

/* ── QR Card ── */
.bs-qr-card {
  width: 340px;
  height: 340px;
  position: relative;
  overflow: hidden;
}

/* ── Portfolio Thumb ── */
.bs-portfolio-thumb {
  width: 400px;
  height: 300px;
  position: relative;
  overflow: hidden;
}

/* ── Resume Cover ── */
.bs-resume-cover {
  width: 420px;
  height: 594px;
  position: relative;
  overflow: hidden;
}

/* ── Email Signature Preview ── */
.bs-email-preview {
  background: #ffffff;
  border-radius: 8px;
  padding: 16px;
  width: 100%;
}

/* ── Modal ── */
.bs-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.bs-modal {
  background: #0f1320;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 28px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.bs-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 16px;
}
.bs-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.07);
  border: none;
  color: #64748b;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
}
.bs-modal-close:hover { background: rgba(255,255,255,0.12); color: #f1f5f9; }
.bs-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ── Toast Notifications ── */
.bs-toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.bs-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 20, 35, 0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #f1f5f9;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  pointer-events: all;
  max-width: 320px;
}
.bs-toast.show { opacity: 1; transform: translateX(0); }
.bs-toast-success { border-color: rgba(16,185,129,0.4); }
.bs-toast-success i { color: #10b981; }
.bs-toast-error { border-color: rgba(239,68,68,0.4); }
.bs-toast-error i { color: #ef4444; }
.bs-toast-info i { color: #60a5fa; }

/* ── Content Edit Panel ── */
.bs-apply-btn {
  width: 100%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.bs-apply-btn:hover {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59,130,246,0.35);
}

/* ── Shape Buttons ── */
.bs-shape-btns {
  display: flex;
  gap: 6px;
}
.bs-shape-btn {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #64748b;
  border-radius: 8px;
  padding: 7px 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.bs-shape-btn:hover { background: rgba(255,255,255,0.07); color: #94a3b8; }
.bs-shape-btn.active { border-color: #3b82f6; background: rgba(59,130,246,0.1); color: #60a5fa; }

/* ── QR Color Row ── */
.bs-qr-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.bs-qr-row label { font-size: 11px; color: #475569; }
.bs-qr-row input[type="color"] {
  width: 32px; height: 24px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  background: transparent;
  padding: 1px;
  cursor: pointer;
}

/* ── Email Sig Modal ── */
#bs-email-sig-modal .bs-email-preview {
  min-height: 100px;
  margin-bottom: 12px;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .bs-right-panel { width: 260px; min-width: 260px; }
}

@media (max-width: 1024px) {
  .bs-sidebar {
    width: 52px;
    min-width: 52px;
    padding: 12px 0;
  }
  .bs-sidebar .bs-sidebar-section-label,
  .bs-sidebar .bs-recent-list,
  .bs-sidebar .bs-sidebar-divider,
  .bs-asset-btn span:not(.bi) { display: none; }
  .bs-asset-btn {
    justify-content: center;
    padding: 10px;
  }
  .bs-asset-btn i { width: auto; margin: 0; }
  .bs-asset-btn.active { border-left: none; border-bottom: 2px solid #3b82f6; }
  .bs-right-panel { width: 240px; min-width: 240px; }
}

@media (max-width: 768px) {
  .bs-body { flex-direction: column; }
  .bs-sidebar {
    width: 100%;
    min-width: unset;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 0;
    flex-shrink: 0;
    scrollbar-width: none;
  }
  .bs-sidebar::-webkit-scrollbar { display: none; }
  .bs-sidebar .bs-sidebar-section-label,
  .bs-sidebar .bs-recent-list,
  .bs-sidebar .bs-sidebar-divider { display: none; }
  .bs-asset-btn { flex-direction: column; gap: 3px; padding: 6px 10px; font-size: 10px; }
  .bs-asset-btn i { font-size: 18px; width: auto; }
  .bs-asset-btn.active { border-left: none; border-bottom: 2px solid #3b82f6; }
  .bs-right-panel {
    width: 100%;
    min-width: unset;
    height: 280px;
    min-height: 280px;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
  }
  .bs-main { height: auto; flex: 1; }
  .bs-preview-area { padding: 20px 12px 12px; }
  .bs-preview-canvas { padding: 20px; }
  .bs-topbar { padding: 0 12px; }
  .bs-brand-title { font-size: 15px; }
  .bs-topbar-actions .bs-action-btn span { display: none; }
}

/* ── Card Shadow & Hover ── */
#bs-card-container > * {
  box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 8px 24px rgba(0,0,0,0.4);
  transition: box-shadow 0.3s, transform 0.3s;
}
#bs-card-container > *:hover {
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 12px 32px rgba(0,0,0,0.5);
  transform: translateY(-2px);
}

/* ── Card Loading State ── */
.bs-card-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: #334155;
  font-size: 13px;
  gap: 8px;
}
.bs-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: bs-spin 0.7s linear infinite;
}
@keyframes bs-spin { to { transform: rotate(360deg); } }

/* ── Preview zoom indicator ── */
.bs-zoom-badge {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #334155;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* ── Category filter pills ── */
.bs-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.bs-cat-pill {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  color: #475569;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.bs-cat-pill:hover { color: #94a3b8; background: rgba(255,255,255,0.07); }
.bs-cat-pill.active { background: rgba(59,130,246,0.15); border-color: #3b82f6; color: #60a5fa; }

/* ── Compatibility aliases (HTML / JS naming variations) ── */

/* Sidebar label — alias for .bs-sidebar-section-label */
.bs-sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #475569;
  padding: 12px 16px 6px;
}

/* Topbar brand block */
.bs-topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.bs-topbar-title {
  font-size: 17px;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
.bs-topbar-badge {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 5px;
  text-transform: uppercase;
}

/* Generic button variants — alias for .bs-action-btn */
.bs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.bs-btn:hover { background: rgba(255,255,255,0.12); color: #f1f5f9; }
.bs-btn-ghost {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: #94a3b8;
}
.bs-btn-ghost:hover { background: rgba(255,255,255,0.1); color: #f1f5f9; }
.bs-btn-primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.bs-btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(59,130,246,0.4);
}

/* Chip row — alias for .bs-chips-row */
.bs-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 4px;
}

/* Toggle track — alias for .bs-toggle-slider */
.bs-toggle-track {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 21px;
  transition: 0.2s;
  border: 1px solid rgba(255,255,255,0.1);
}
.bs-toggle-track::before {
  content: '';
  position: absolute;
  height: 15px;
  width: 15px;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: #64748b;
  border-radius: 50%;
  transition: 0.2s;
}
.bs-toggle input:checked + .bs-toggle-track { background: rgba(59,130,246,0.3); border-color: #3b82f6; }
.bs-toggle input:checked + .bs-toggle-track::before { transform: translateY(-50%) translateX(17px); background: #60a5fa; }

/* Theme swatch color dots — alias for .bs-swatch-c / .bs-swatch-name */
.bs-sw-c {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
  display: inline-block;
}
.bs-sw-name {
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bs-theme-swatch.active .bs-sw-name { color: #94a3b8; }

/* Template thumb — alias for .bs-tpl-preview */
.bs-tpl-thumb {
  width: 100%;
  height: 36px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 6px 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
}
.bs-tpl-line {
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
}
.bs-tpl-line-1 { width: 70%; }
.bs-tpl-line-2 { width: 50%; }
.bs-tpl-line-3 { width: 85%; }
.bs-tpl-btn.active .bs-tpl-line { background: rgba(59,130,246,0.5); }

/* Color row — alias for .bs-color-picker-row */
.bs-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  gap: 8px;
}
.bs-color-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bs-color-preview {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  display: inline-block;
}
.bs-reset-colors {
  font-size: 11px;
  color: #475569;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 0;
  font-family: inherit;
  transition: color 0.15s;
}
.bs-reset-colors:hover { color: #94a3b8; }

/* Section label inside panel tabs */
.bs-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #475569;
  margin: 12px 0 6px;
}
.bs-section-label:first-child { margin-top: 0; }

/* Export cards wrapper */
.bs-export-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Override bs-export-card icon/text layout from the HTML (uses <i> + <div>) */
.bs-export-card i {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}
.bs-export-card strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
}
.bs-export-card span {
  font-size: 11px;
  color: #475569;
}

/* Modal subtitle */
.bs-modal-sub {
  font-size: 12px;
  color: #475569;
  margin-top: 2px;
}
.bs-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.bs-modal-body { }

/* Hint text */
.bs-hint {
  font-size: 11px;
  color: #475569;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* Empty state */
.bs-empty-msg {
  font-size: 11px;
  color: #334155;
  padding: 8px 16px;
  font-style: italic;
}

/* Recent item text */
.bs-recent-name { font-size: 12px; font-weight: 500; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-recent-meta { font-size: 10px; color: #334155; margin-top: 1px; }

/* Bootstrap utility overrides inside bs-layout (in case needed) */
.bs-layout .mt-2 { margin-top: 0.5rem !important; }
.bs-layout .mt-3 { margin-top: 1rem !important; }
.bs-layout .w-100 { width: 100% !important; }
.bs-layout .me-1 { margin-right: 0.25rem !important; }
.bs-layout .me-2 { margin-right: 0.5rem !important; }
.bs-layout .d-none { display: none !important; }

/* Responsive: hide badge and title text on small topbar */
@media (max-width: 480px) {
  .bs-topbar-title { display: none; }
  .bs-topbar-badge { display: none; }
  .bs-topbar-actions .bs-btn span { display: none; }
}

/* ── Export format buttons (PNG / PDF / Print row under preview) ── */
.bs-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.bs-export-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #f1f5f9;
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}
.bs-export-btn i { font-size: 14px; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE LAYOUT
   • Desktop  (≥992px) : original 3-column sidebar/preview/panel
   • Mobile & Tablet (<992px) : sticky tab bar + sliding drawer
   ══════════════════════════════════════════════════════════ */

/* ── Base: shared drawer + tab-bar elements (hidden on desktop) ── */
.bs-drawer {
  display: flex;
  flex-direction: column;
  background: rgba(11, 11, 22, 0.99);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.bs-drawer-handle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.bs-drawer-grip {
  width: 38px; height: 4px;
  background: rgba(255,255,255,0.14);
  border-radius: 2px;
  flex-shrink: 0;
}
.bs-drawer-title {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
}
.bs-drawer-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.bs-drawer-close:hover { background: rgba(255,255,255,0.14); color: #f1f5f9; }
.bs-drawer-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.bs-drawer-body::-webkit-scrollbar { width: 4px; }
.bs-drawer-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Drawer panels */
.bs-dp { display: none; }
.bs-dp.bs-dp-active { display: block; }

/* Asset grid */
.bs-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  padding: 4px 0 8px;
}
.bs-asset-grid .bs-asset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 14px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  color: #64748b;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: center;
  border-radius: 12px;
  border-left: none;
}
.bs-asset-grid .bs-asset-btn i { font-size: 22px; width: auto; }
.bs-asset-grid .bs-asset-btn:hover { background: rgba(255,255,255,0.08); color: #cbd5e1; border-color: rgba(255,255,255,0.13); }
.bs-asset-grid .bs-asset-btn.active { background: rgba(59,130,246,0.15); color: #60a5fa; border-color: rgba(59,130,246,0.3); border-left: none; }
.bs-asset-grid .bs-asset-btn.active i { color: #60a5fa; }

/* Tab bar base */
.bs-tab-bar { display: flex; }
.bs-tab {
  display: flex;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
  position: relative;
  font-family: inherit;
  color: #475569;
  font-weight: 500;
}
.bs-tab:hover { color: #94a3b8; }

/* ─────────────────────────────────────────────
   DESKTOP  ≥992px  — original 3-column layout
   Tab bar = left sidebar  |  Drawer = right panel
   ───────────────────────────────────────────── */
@media (min-width: 992px) {
  /* body stays row (original) */
  .bs-body {
    flex-direction: row;
    position: relative;
    overflow: hidden;
  }

  /* Tab bar → left sidebar */
  .bs-tab-bar {
    width: 210px;
    min-width: 210px;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    border-top: none;
    border-right: 1px solid rgba(255,255,255,0.07);
    background: rgba(8, 8, 18, 0.9);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 0;
    order: 1;
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.07) transparent;
  }
  .bs-tab-bar::-webkit-scrollbar { width: 3px; }

  .bs-tab {
    height: 44px;
    min-width: auto;
    max-width: none;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    font-size: 13px;
    text-align: left;
    border-radius: 0;
    border-left: 2px solid transparent;
  }
  .bs-tab i { font-size: 16px; }
  .bs-tab span { font-size: 13px; display: block; }
  .bs-tab.active {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.09);
    border-left-color: #3b82f6;
  }
  .bs-tab.active::after { display: none; }

  /* Main preview → centre */
  .bs-main {
    flex: 1;
    min-width: 0;
    order: 2;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Drawer → right panel (always visible, static) */
  .bs-drawer {
    position: static !important;
    width: 300px;
    min-width: 300px;
    max-height: none;
    height: 100%;
    transform: none !important;
    border-top: none;
    border-left: 1px solid rgba(255,255,255,0.07);
    border-radius: 0;
    box-shadow: none;
    order: 3;
    flex-shrink: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(8, 8, 18, 0.9);
  }

  /* Grip + close not needed on desktop */
  .bs-drawer-grip,
  .bs-drawer-close { display: none; }

  /* Drawer handle becomes panel heading */
  .bs-drawer-handle {
    height: 48px;
    padding: 0 16px;
    background: rgba(6, 6, 14, 0.6);
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .bs-drawer-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #475569;
  }

  /* Right-panel content: prevent overflow */
  .bs-drawer-body {
    padding: 14px 14px 20px;
    overflow-x: hidden;
  }

  /* Single-column theme grid — fits 300px panel without clipping */
  .bs-theme-grid {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  /* Template grid: 2 compact columns */
  .bs-template-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Asset grid in right panel: 3 compact columns */
  .bs-asset-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .bs-asset-grid .bs-asset-btn {
    padding: 10px 6px;
    font-size: 10.5px;
  }
  .bs-asset-grid .bs-asset-btn i { font-size: 18px; }

  /* Ensure all dp panels can't overflow the panel */
  .bs-dp, .bs-drawer-body > * { min-width: 0; max-width: 100%; }
  .bs-theme-swatch { min-width: 0; }
  .bs-sw-name { max-width: 100%; }
}

/* ─────────────────────────────────────────────
   MOBILE & TABLET  <992px  — tab bar + drawer
   ───────────────────────────────────────────── */
@media (max-width: 991px) {
  .bs-body {
    flex-direction: column;
    position: relative;
    overflow: hidden;
  }

  .bs-main {
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Sliding drawer */
  .bs-drawer {
    position: absolute;
    bottom: 64px;
    left: 0;
    right: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.55);
    transform: translateY(105%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 50;
    max-height: 62vh;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  .bs-drawer.open { transform: translateY(0); }

  /* Sticky bottom tab bar */
  .bs-tab-bar {
    height: 64px;
    min-height: 64px;
    flex-shrink: 0;
    background: rgba(8, 8, 18, 0.98);
    border-top: 1px solid rgba(255,255,255,0.08);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    position: relative;
    z-index: 60;
  }
  .bs-tab-bar::-webkit-scrollbar { display: none; }

  .bs-tab {
    flex: 1;
    min-width: 62px;
    max-width: 100px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px 6px;
    font-size: 10px;
  }
  .bs-tab i { font-size: 19px; line-height: 1; }
  .bs-tab.active { color: #f59e0b; }
  .bs-tab.active::after {
    content: '';
    position: absolute;
    top: 0; left: 22%; right: 22%;
    height: 2px;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    border-radius: 0 0 3px 3px;
  }
}

/* ── Mobile small (<640px) ── */
@media (max-width: 640px) {
  .bs-drawer { max-height: 70vh; }
  .bs-asset-grid { grid-template-columns: repeat(3, 1fr); }
  .bs-tab { min-width: 50px; font-size: 9px; }
  .bs-tab i { font-size: 17px; }
  .bs-topbar { padding: 0 10px; gap: 8px; }
  .bs-topbar-actions { gap: 6px; }
  .bs-topbar-actions .bs-btn span { display: none; }
}

/* ── Very small (<360px) ── */
@media (max-width: 360px) {
  .bs-tab span { display: none; }
  .bs-tab { min-width: 40px; }
  .bs-tab i { font-size: 20px; }
  .bs-tab-bar { height: 52px; min-height: 52px; }
  .bs-drawer { bottom: 52px; }
}
