/* =====================
   MKP WebHub — Component Styles
   Phase 2: Backoffice, Modals, Forms, Tabs
   ===================== */

/* Tab Bar */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Card Header (title + actions) */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Package Cards */
.package-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.package-card.inactive { opacity: 0.5; }

.package-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.package-name {
  font-weight: 600;
  font-size: 16px;
  margin-right: 8px;
}

.package-price {
  color: var(--accent);
  font-weight: 600;
}

.package-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.package-features {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* Tags */
.tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-hover);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.tag-blue { background: rgba(33,150,243,0.15); color: #64B5F6; }
.tag-orange { background: rgba(234,134,35,0.15); color: var(--accent); }
.tag-green { background: rgba(76,175,80,0.15); color: #81C784; }
.tag-red { background: rgba(244,67,54,0.15); color: #E57373; }

/* V1.0.16 polish 47 · product chip · drag-to-reorder + REF badge for first */
.product-chip { transition: opacity 120ms ease, transform 120ms ease, box-shadow 120ms ease; }
.product-chip:hover .chip-drag-handle { color: var(--accent); }
.product-chip.is-ref {
  border: 1px solid rgba(234,134,35,0.6);
  box-shadow: 0 0 0 2px rgba(234,134,35,0.18);
  background: rgba(234,134,35,0.22);
}
.product-chip.chip-drag-over {
  border: 2px dashed var(--accent);
  transform: scale(1.04);
}
.chip-drag-handle { font-size: 10px; line-height: 1; }
.chip-ref-badge {
  display: inline-block;
  font-size: 9px; font-weight: 800;
  padding: 2px 6px;
  background: var(--accent);
  color: #000;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mini-tag {
  display: inline-block;
  padding: 1px 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 560px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 16px; }

.btn-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.btn-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* Feature Checkbox Groups */
.feature-group {
  margin-bottom: 16px;
}

.feature-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feature-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 13px;
}

.feature-check code {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: auto;
}

.feature-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-hover);
  border-radius: 20px;
  transition: 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 2px; bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle input:checked + .toggle-slider { background: var(--success); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

/* Section Title */
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin: 20px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

/* Forms */
.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row label {
  min-width: 120px;
  font-size: 13px;
  color: var(--text-secondary);
}

.form-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

.form-input:focus { border-color: var(--accent); }

.form-input-inline {
  padding: 4px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* Asset Grid */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.asset-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
}

/* V1.0.16 polish 46 · switched from CSS bg-url to <img> tag for onerror
   fallback. CSS bg-url has no error event so dangling DB records (file
   missing on disk) showed as silent black squares · now we get a clear
   "broken_image" placeholder. */
.asset-img-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  background-color: var(--bg-primary);
  cursor: pointer;
  overflow: hidden;
}
.asset-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.asset-img-broken {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--text-muted, #737373);
}
.asset-img-broken .material-symbols-rounded { font-size: 36px; opacity: 0.5; }
.asset-img-broken-lbl { font-size: 10px; opacity: 0.7; }
.asset-img-wrap.img-broken .asset-img-broken { display: flex; }
.asset-img-wrap.img-broken { background-color: rgba(239,68,68,0.04); border: 1px dashed rgba(239,68,68,0.2); }

.asset-info {
  padding: 8px;
}

.asset-name {
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.asset-card .btn { margin: 4px 8px 8px; }

/* Code Editor */
.code-editor {
  width: 100%;
  padding: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: #C8E6C9;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  tab-size: 2;
}

.code-editor:focus { border-color: var(--accent); }

/* Bar Chart (simple) */
.bar-bg {
  width: 100%;
  height: 12px;
  background: var(--bg-primary);
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  transition: width 0.3s;
}

/* Mini Progress Bar */
.mini-progress {
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.mini-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
  min-width: 3px;
}

/* Mini Stat */
.mini-stat {
  text-align: center;
  padding: 8px;
  background: var(--bg-primary);
  border-radius: var(--radius);
}

.mini-stat-val {
  font-size: 24px;
  font-weight: 700;
}

.mini-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Quick Actions Grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11px;
  transition: all 0.15s;
  position: relative;
  cursor: pointer;
}

.action-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.action-btn .material-symbols-rounded { font-size: 24px; }

.action-btn.locked {
  opacity: 0.35;
  cursor: not-allowed;
}

.action-btn .lock-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
}

/* Quick Actions (legacy) */
.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Table cells */
.cell-truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-cell {
  white-space: nowrap;
}

.action-cell .btn { margin-right: 2px; }

/* Create form */
.create-form {
  max-width: 600px;
}

.create-form .form-row {
  margin-bottom: 16px;
}

.create-form textarea.form-input {
  resize: vertical;
  min-height: 60px;
}

/* Live Monitor */
.live-panel {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 200px;
}

.live-log {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  padding: 8px;
}

.log-line {
  padding: 2px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  line-height: 1.6;
}

.log-line:hover { background: var(--bg-hover); }

.log-time {
  color: var(--text-muted);
  margin-right: 8px;
  font-size: 11px;
}

.log-line.log-success { color: var(--success); }
.log-line.log-error { color: var(--error); }
.log-line.log-info { color: var(--text-primary); }

.live-status-panel {
  padding: 16px;
}

.live-status-panel > div {
  padding: 4px 0;
}

.live-indicator {
  font-weight: 700;
  color: var(--error);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.filter-group label {
  font-size: 11px;
  color: var(--text-muted);
}

.form-input-sm {
  padding: 4px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  width: 100px;
}

.form-input-sm:focus { border-color: var(--accent); outline: none; }

/* Sortable columns */
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--accent); }

/* Comment list */
.comment-list {
  max-height: 300px;
  overflow-y: auto;
}

.comment-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.comment-item:last-child { border-bottom: none; }

/* Example block */
.example-block {
  background: var(--bg-primary);
  border-radius: 4px;
  padding: 8px 10px;
  margin: 4px 0;
  font-size: 13px;
  line-height: 1.4;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 16px;
  transition: all 0.2s;
  cursor: pointer;
}

.drop-zone.active, .drop-zone:hover {
  border-color: var(--accent);
  background: rgba(234, 134, 35, 0.05);
  color: var(--accent);
}

/* Asset Card enhanced */
.asset-card {
  position: relative;
}

.asset-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(234, 134, 35, 0.3);
}

.asset-select {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
}

.asset-select input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

.asset-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
  padding: 4px 8px 8px;
}

/* Folder Card */
.folder-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.folder-name { font-weight: 500; margin: 6px 0; }
.folder-actions { display: flex; gap: 4px; justify-content: center; }

/* Platform Card */
.platform-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.platform-icon { font-size: 36px; margin-bottom: 4px; }
.platform-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.platform-meta { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }

/* Template Card */
.template-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.template-preview {
  height: 120px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-info {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.template-actions {
  padding: 4px 12px 8px;
  display: flex;
  gap: 4px;
}

/* Device Card */
.device-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Room Card (LIVE) */
.room-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.room-card:hover { border-color: var(--accent); }
.room-card.active { border-color: var(--accent); background: rgba(234,134,35,0.06); }

.room-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.room-card-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* Style Card */
.style-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  transition: all 0.2s;
}

.style-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.style-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.style-card-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  background: var(--bg-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.style-card-name {
  font-weight: 600;
  font-size: 14px;
}

.style-card-preset {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.style-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
  min-height: 22px;
}

.style-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* 2026-04-30 (boss bug fix · Style card buttons invisible):
   Default .btn-secondary + .btn-danger had near-zero contrast on dark card bg.
   Boss test confirmed green/red gives clear visibility. Apply explicit colors
   only inside .style-card-footer to avoid affecting other pages. */
.style-card-footer .btn {
  padding: 6px 12px;
  font-weight: 600;
  font-size: 12px;
  min-width: 50px;
  border-radius: 6px;
  transition: filter 0.12s, transform 0.08s;
}
.style-card-footer .btn:active { transform: scale(0.96); }
.style-card-footer .btn-secondary {
  background: #22c55e;
  color: #fff;
  border: 1px solid #16a34a;
}
.style-card-footer .btn-secondary:hover {
  background: #16a34a;
  filter: brightness(1.08);
}
.style-card-footer .btn-danger {
  background: #ef4444;
  color: #fff;
  border: 1px solid #dc2626;
}
.style-card-footer .btn-danger:hover {
  background: #dc2626;
  filter: brightness(1.08);
}

/* Dashboard Welcome Banner */
.dash-welcome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(234,134,35,0.08) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}

.dash-greeting {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.dash-welcome-actions {
  display: flex;
  gap: 8px;
}

.dash-active-job {
  border-color: var(--accent) !important;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(234,134,35,0.04) 100%);
}

/* Dashboard Health Grid */
.dash-health-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.dash-health-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-primary);
  border-radius: 8px;
}

@media (max-width: 768px) {
  .dash-welcome {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  .dash-greeting { font-size: 18px; }
  .dash-welcome-actions { justify-content: center; }
  .dash-health-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Upgrade Modal (SaaS) */
.upgrade-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.upgrade-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 700px;
  width: 90vw;
  text-align: center;
  position: relative;
  animation: scaleIn 0.25s ease;
}

.upgrade-icon { font-size: 48px; margin-bottom: 8px; }
.upgrade-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.upgrade-desc { color: var(--text-secondary); margin-bottom: 24px; font-size: 14px; }

.upgrade-packages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.upgrade-pkg {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  position: relative;
  transition: border-color 0.2s;
}

.upgrade-pkg.featured {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(234,134,35,0.15);
}

.upgrade-pkg-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #000;
  padding: 2px 12px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.upgrade-pkg-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.upgrade-pkg-price { font-size: 28px; font-weight: 800; color: var(--accent); margin-bottom: 12px; }
.upgrade-pkg-price span { font-size: 14px; color: var(--text-muted); font-weight: 400; }

.upgrade-pkg-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
}

.upgrade-pkg-features li {
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.upgrade-pkg-features li::before { content: '✓ '; color: var(--accent); }

.upgrade-pkg .btn { width: 100%; }

@media (max-width: 768px) {
  .upgrade-packages { grid-template-columns: 1fr; }
}

/* Output Canvas (Intelligent Flow) */
.output-canvas { margin-bottom: 12px; }

.output-block { margin-bottom: 8px; }
.output-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.output-text { background: var(--bg-primary); padding: 8px 10px; border-radius: 6px; font-size: 13px; line-height: 1.5; word-break: break-word; }

/* Matrix Grid */
.matrix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; }
.matrix-item { background: var(--bg-primary); padding: 8px 10px; border-radius: 6px; border-left: 3px solid var(--accent); }
.matrix-key { font-size: 10px; color: var(--text-muted); text-transform: uppercase; display: block; }
.matrix-val { font-size: 13px; color: var(--text-primary); }

/* UGC Scored Table */
.ugc-table { display: flex; flex-direction: column; gap: 4px; }
.ugc-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg-primary); border-radius: 6px; cursor: pointer; transition: all 0.15s; border: 1px solid transparent; }
.ugc-row:hover { border-color: var(--accent); }
.ugc-row.winner { border-color: var(--accent); background: rgba(234,134,35,0.08); }
.ugc-rank { font-size: 16px; font-weight: 700; min-width: 28px; text-align: center; }
.ugc-content { flex: 1; min-width: 0; }
.ugc-user { font-size: 11px; color: var(--accent); font-weight: 600; }
.ugc-text { font-size: 12px; color: var(--text-secondary); }
.ugc-score { font-size: 14px; font-weight: 700; color: var(--accent); }

/* Extend Prompts List */
.extend-prompts-list { display: flex; flex-direction: column; gap: 4px; }
.extend-prompt-item { display: flex; align-items: center; gap: 8px; background: var(--bg-primary); padding: 6px 10px; border-radius: 6px; }
.extend-num { width: 24px; height: 24px; background: var(--accent); color: #000; border-radius: 50%; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.extend-text { flex: 1; font-size: 12px; }

/* Breadcrumb */
.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { margin: 0 6px; color: var(--text-muted); }

/* Onboarding Step */
.onboard-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: var(--text-primary);
}
.onboard-step:hover { border-color: var(--accent); background: rgba(234,134,35,0.06); }

/* Floating Pause Bar */
.pause-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 8000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp { from { transform: translateX(-50%) translateY(100px); } to { transform: translateX(-50%) translateY(0); } }

.pause-bar-status { font-size: 12px; font-weight: 600; }
.pause-bar-progress { font-size: 11px; color: var(--text-muted); }

/* Job Summary Modal */
.summary-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.summary-stat { text-align: center; padding: 12px; background: var(--bg-primary); border-radius: 8px; }
.summary-stat-val { font-size: 24px; font-weight: 800; }
.summary-stat-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* Context Menu */
.ctx-menu {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  z-index: 9000;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: scaleIn 0.15s ease;
}

.ctx-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
}

.ctx-item:hover { background: var(--bg-hover); }

/* Queue Reorder Buttons */
.btn-reorder {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.btn-reorder:hover { color: var(--accent); }

/* Searchable Select Dropdown */
.searchable-select { position: relative; }

.dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s;
}

.dropdown-item:hover { background: var(--bg-hover); color: var(--accent); }

/* Command Palette */
.cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  animation: fadeIn 0.15s ease;
}

.cmd-box {
  width: 480px;
  max-width: 90vw;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  animation: scaleIn 0.2s ease;
}

.cmd-input {
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  font-family: var(--font);
}

.cmd-input::placeholder { color: var(--text-muted); }

.cmd-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  color: var(--text-secondary);
  font-size: 14px;
}

.cmd-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Folder Section */
.folder-section { margin-bottom: 16px; }

/* Provider Cards */
.provider-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.provider-card.active { border-color: var(--success); }

.provider-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.provider-models {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* Output blocks */
.output-block {
  margin-bottom: 12px;
}

.output-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.output-text {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 16px;
}

/* Text helpers */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
code {
  background: var(--bg-primary);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: #81C784;
}
