/* Chameleon Design - adapted from design.html */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-deep: #0a0e17;
  --bg-surface: #111827;
  --bg-card: #1a2235;
  --bg-elevated: #222d42;
  --border-subtle: rgba(99, 132, 255, 0.12);
  --border-active: rgba(99, 132, 255, 0.35);
  --accent: #6384ff;
  --accent-glow: rgba(99, 132, 255, 0.25);
  --accent-bright: #8da6ff;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --text-primary: #e8ecf4;
  --text-secondary: #d2d2d2;
  --text-muted: #d2d2d2;
  --orange: #fb923c;
  --cyan: #22d3ee;
}

* { box-sizing: border-box; }

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  margin: 0;
  min-height: 100vh;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Top bar (navbar) */
.topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.topbar-logo .dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 12px var(--accent-glow);
}
.topbar-home-link {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.topbar-home-link:hover {
  color: var(--accent-bright);
  border-color: var(--border-active);
  background: rgba(99, 132, 255, 0.08);
}
.topbar-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}
.topbar .nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: 0.88rem;
}
.topbar .nav-link:hover {
  color: var(--text-primary) !important;
}

/* Buttons */
.btn-accent {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.55rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-accent:hover {
  background: var(--accent-bright);
  box-shadow: 0 4px 20px var(--accent-glow);
  transform: translateY(-1px);
  color: #fff;
}
.btn-outline-subtle {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.82rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-outline-subtle:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
  background: rgba(99, 132, 255, 0.06);
}
.btn-danger-subtle {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.2);
  padding: 0.35rem 0.75rem;
  border-radius: 5px;
  font-weight: 500;
  font-size: 0.78rem;
  transition: all 0.2s;
}
.btn-danger-subtle:hover {
  background: rgba(248, 113, 113, 0.18);
}

/* Form controls */
.form-control-dark {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  transition: border-color 0.2s;
}
.form-control-dark::placeholder { color: var(--text-muted); }
.form-control-dark:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
  outline: none;
}
select.form-control-dark,
.select-dark {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.84rem;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: menulist;
}
select.form-control-dark:focus,
.select-dark:focus {
  border-color: var(--accent) !important;
  outline: none;
}

/* Import tab */
.import-tab { padding-top: 0; }
.import-setup-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-bright);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
}
.import-setup-link:hover { color: var(--accent); text-decoration: underline; }
.import-action-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
}
.import-action-link:hover { color: var(--accent-bright); text-decoration: underline; }
.import-wizard-panel {
  width: min(920px, calc(100vw - 4rem));
  max-width: 980px;
  min-width: min(760px, calc(100vw - 4rem));
}
.import-wizard-table { margin-bottom: 0; }
.import-wizard-table tbody tr:last-child td { border-bottom: none; }

/* Main layout */
.main-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - 53px);
  overflow: hidden;
}

/* Sidebar / tree */
.sidebar-panel {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-header {
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-header h6 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0;
}
.item-count-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-deep);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}
.sidebar-search {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-search .search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.sidebar-search .search-wrap .search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.82rem;
  pointer-events: none;
}
.sidebar-search .search-wrap.search-active .btn-search-clear {
  position: absolute;
  right: 0.5rem;
  top: 30%;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-full-view {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--accent-bright);
  text-decoration: none;
}
.back-to-full-view:hover {
  color: var(--accent);
  text-decoration: underline;
}
.sidebar-search input {
  width: 100%;
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.45rem 0.7rem 0.45rem 2rem;
  border-radius: 6px;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
}
.sidebar-search .search-wrap.search-active input {
  padding-right: 2rem;
}
.sidebar-search input:focus { border-color: var(--accent); }
.tree-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

/* Tree nodes */
.tree-node { user-select: none; }
.tree-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  font-size: 0.84rem;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  position: relative;
}
.tree-row:hover {
  background: rgba(99, 132, 255, 0.06);
}
.tree-row.selected {
  background: rgba(99, 132, 255, 0.1);
  border-left-color: var(--accent);
}
.tree-toggle {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.tree-toggle.open { transform: rotate(90deg); }
.tree-toggle-placeholder {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
}
.tree-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.tree-icon.site { color: var(--cyan); }
.tree-icon.folder { color: var(--warning); }
.tree-icon.page { color: var(--accent-bright); }
.tree-icon.component { color: var(--orange); }
.tree-icon.media { color: var(--success); }
.tree-icon.data { color: var(--danger); }
.tree-icon.item { color: var(--text-muted); }
.tree-icon.tree-icon-ghost { color: var(--danger); }
.tree-row.excluded {
  opacity: 0.4;
  text-decoration: line-through;
}
.tree-badges {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-shrink: 0;
}
.tree-badge-excluded {
  font-size: 0.6rem;
  color: var(--danger);
  background: rgba(248,113,113,0.12);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  font-weight: 600;
}
.tree-badge-import {
  font-size: 0.58rem;
  color: var(--accent-bright);
  background: rgba(125, 211, 252, 0.12);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  font-weight: 600;
}
.tree-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tree-children { padding-left: 1.1rem; }

/* Search results list */
.search-results-list {
  padding: 0.5rem 0;
  font-size: 0.84rem;
}
.search-result-row {
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}
.search-result-row:hover {
  background: rgba(99, 132, 255, 0.06);
}
.search-result-row.selected {
  background: rgba(99, 132, 255, 0.1);
  border-left-color: var(--accent);
}
.search-result-path {
  color: var(--text-muted);
  font-size: 0.78rem;
}
.search-result-name {
  color: var(--text-primary);
  font-weight: 500;
}
.search-no-results {
  padding: 1.5rem 0.75rem;
  color: var(--text-muted);
  text-align: center;
}
.btn-search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.25rem;
  cursor: pointer;
  margin-left: 0.25rem;
}
.btn-search-clear:hover {
  color: var(--accent);
}
.detail-link {
  color: var(--accent-bright);
  text-decoration: none;
}
.detail-link:hover {
  text-decoration: underline;
}

/* Content area */
.content-area {
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg-deep);
}

/* Stat cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border-active); }
.stat-card .stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.stat-card .stat-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}
.stat-card-clickable {
  cursor: pointer;
}
.stat-card-clickable:hover {
  border-color: var(--border-active);
}

/* Content Types sample modal (troubleshooting) */
.dashboard-sample-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.dashboard-sample-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dashboard-sample-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}
.dashboard-sample-header h6 { margin: 0; font-size: 0.95rem; }
.dashboard-sample-body {
  padding: 1.25rem;
  overflow-y: auto;
}

/* Dashboard: equal height stat tiles */
.dashboard-stat-row {
  display: flex;
  flex-wrap: wrap;
}
.dashboard-stat-row .col-md-3 {
  display: flex;
}
.dashboard-stat-row .stat-card {
  flex: 1;
  min-height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Tables */
.table-dark-custom {
  width: 100%;
  font-size: 0.84rem;
}
.table-dark-custom thead th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.table-dark-custom tbody td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}
.table-dark-custom tbody tr:hover td {
  background: rgba(99, 132, 255, 0.04);
}
.btn-expand {
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
  transition: all 0.15s;
}
.btn-expand:hover {
  background: rgba(99, 132, 255, 0.1);
  color: var(--accent);
  border-color: var(--accent);
}
.table-dark-custom .field-row td {
  padding-left: 2.5rem;
  font-size: 0.8rem;
}

/* Detail panel */
.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}
.detail-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.detail-body { padding: 1.25rem; }
.detail-field-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.detail-field-value {
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}
.chip-accent { background: rgba(99,132,255,0.12); color: var(--accent-bright); }
.chip-success { background: rgba(52,211,153,0.12); color: var(--success); }
.chip-warning { background: rgba(251,191,36,0.12); color: var(--warning); }
.chip-danger { background: rgba(248,113,113,0.12); color: var(--danger); }
.chip-cyan { background: rgba(34,211,238,0.12); color: var(--cyan); }

/* Section card */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.section-card-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-card-header h6 {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0;
}
.section-card-body {
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}
.chip-accent { background: rgba(99,132,255,0.12); color: var(--accent-bright); }
.chip-success { background: rgba(52,211,153,0.12); color: var(--success); }
.chip-warning { background: rgba(251,191,36,0.12); color: var(--warning); }
.chip-danger { background: rgba(248,113,113,0.12); color: var(--danger); }
.chip-cyan { background: rgba(34,211,238,0.12); color: var(--cyan); }

/* Tabs */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 1.5rem;
  background: var(--bg-surface);
}
.tab-item {
  padding: 0.75rem 1.25rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.tab-item:hover { color: var(--text-secondary); }
.tab-item.active {
  color: var(--accent-bright);
  border-bottom-color: var(--accent);
}
.tab-count {
  font-size: 0.7rem;
  background: var(--bg-elevated);
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-weight: 600;
}

/* Note input */
.note-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-size: 0.84rem;
  font-family: 'IBM Plex Sans', sans-serif;
  resize: vertical;
  min-height: 70px;
  outline: none;
  transition: border-color 0.2s;
}
.note-input:focus { border-color: var(--accent); }

.tree-badge-note {
  width: 6px; height: 6px;
  background: var(--warning);
  border-radius: 50%;
}

/* Modal */
.modal-content {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 10px !important;
  color: var(--text-primary);
}
.modal-header {
  background: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
}
.modal-header .close, .modal-header .btn-close {
  color: var(--text-muted) !important;
  opacity: 1;
}
.modal-body {
  background: var(--bg-card) !important;
  color: var(--text-primary);
}
.modal-footer {
  background: var(--bg-surface) !important;
  border-top: 1px solid var(--border-subtle) !important;
}
.modal-body .table {
  color: var(--text-secondary);
}
.modal-body .table thead th {
  background: var(--bg-elevated) !important;
  color: var(--text-muted) !important;
  border-color: var(--border-subtle) !important;
}
.modal-body .form-control {
  background: var(--bg-elevated) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-primary) !important;
}
.modal-body .form-control:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
}
.modal-backdrop { background: rgba(0,0,0,0.6) !important; }

/* Connection trigger */
.connection-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff !important;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}
.connection-trigger:hover {
  background: var(--accent-bright);
  box-shadow: 0 4px 20px var(--accent-glow);
  color: #fff !important;
}

.connection-change-link {
  color: var(--accent-bright);
  font-size: 0.82rem;
  font-weight: 500;
  margin-left: 0.75rem;
  text-decoration: none;
}
.connection-change-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.connection-status-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin-left: 0.65rem;
  vertical-align: middle;
}
.connection-action-sep {
  color: var(--text-muted);
  user-select: none;
}
.connection-refresh-link {
  color: var(--accent-bright);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
}
.connection-refresh-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
.connection-refresh-link.is-busy {
  opacity: 0.55;
  pointer-events: none;
}
.connection-action-kbd {
  display: inline-block;
  font-size: 0.65rem;
  font-family: inherit;
  line-height: 1.2;
  padding: 0.1rem 0.38rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  color: var(--text-muted);
  margin-left: 0.15rem;
  vertical-align: middle;
}

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(52, 211, 153, 0.06);
  border-bottom: 1px solid rgba(52, 211, 153, 0.15);
  font-size: 0.78rem;
  color: var(--success);
}
.status-dot {
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(52,211,153,0.4);
}

/* Splitter */
.splitter-handle {
  background: var(--bg-elevated) !important;
  flex-shrink: 0;
}
.splitter-handle:hover {
  background: var(--border-active) !important;
}
.splitter-handle:active {
  background: var(--accent) !important;
}

/* Cards */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary);
}
.card-header {
  background: var(--bg-surface) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-primary) !important;
}
.card-body { color: var(--text-secondary); }
.card-title { color: var(--text-primary) !important; }

/* Alerts */
.alert-info {
  background: rgba(99, 132, 255, 0.08) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-secondary) !important;
}
.alert-warning {
  background: rgba(251, 191, 36, 0.08) !important;
  border-color: rgba(251, 191, 36, 0.2) !important;
  color: var(--warning) !important;
}
.alert-danger {
  background: rgba(248, 113, 113, 0.08) !important;
  border-color: rgba(248, 113, 113, 0.2) !important;
  color: var(--danger) !important;
}

/* Nav tabs (Bootstrap) */
.nav-tabs {
  border-color: var(--border-subtle) !important;
}
.nav-tabs .nav-link {
  color: var(--text-muted) !important;
  border-color: transparent !important;
}
.nav-tabs .nav-link:hover {
  color: var(--text-secondary) !important;
}
.nav-tabs .nav-link.active {
  color: var(--accent-bright) !important;
  background: transparent !important;
  border-color: var(--border-subtle) var(--border-subtle) var(--bg-deep) !important;
  border-bottom-color: var(--accent) !important;
}

/* Footer */
.footer {
  background: var(--bg-surface) !important;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted) !important;
}
.footer a { color: var(--text-secondary) !important; }

/* Connect panel (when not connected) */
.connect-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 2.5rem;
  max-width: 600px;
}
.connect-panel h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.connect-panel p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

/* Connection dialog overlay (design-style popup) - same appearance from Change or Manage Connections */
.connection-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 2rem;
}
.connection-dialog-panel {
  width: min(600px, calc(100vw - 4rem));
  min-width: 520px;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 0;
}
/* Import wizard + edit import should be wider on desktop */
.connection-dialog-panel.import-wizard-panel {
  width: min(920px, calc(100vw - 4rem));
  max-width: 980px;
  min-width: min(760px, calc(100vw - 4rem));
}
/* Manage Connections / Sitefinity connect dialog */
.connection-dialog-panel.connection-dialog-panel--wide {
  width: min(1000px, calc(100vw - 4rem));
  max-width: 1000px;
  min-width: min(520px, calc(100vw - 4rem));
}

/* Reusable success / error modals */
.message-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.75rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
.message-modal-dialog {
  position: relative;
  /* Default max width when dialogWidth prop not applied (e.g. devtools); JS sets max-width to 600px */
  width: min(600px, calc(100vw - 3.5rem));
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 2rem 1.85rem 1.75rem;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
  text-align: center;
  margin: 0;
}
.message-modal-dialog--success {
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(34, 197, 94, 0.08);
}
.message-modal-dialog--error {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(239, 68, 68, 0.08);
}
.message-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  line-height: 1;
}
.message-modal-close:hover {
  color: var(--text-primary);
}
.message-modal-icon-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.message-modal-icon-ring--success {
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid rgba(34, 197, 94, 0.45);
}
.message-modal-icon-ring--error {
  background: rgba(239, 68, 68, 0.12);
  border: 2px solid rgba(239, 68, 68, 0.45);
}
.message-modal-check {
  font-size: 1.75rem;
  color: #22c55e;
  line-height: 1;
}
.message-modal-cross {
  font-size: 1.75rem;
  color: #ef4444;
  line-height: 1;
  font-weight: 700;
}
.message-modal-title {
  margin: 0 0 0.6rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}
.message-modal-text {
  margin: 0 0 1.35rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.message-modal-text--error {
  color: var(--text-primary);
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}
.message-modal-details {
  text-align: left;
  margin: 0 0 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  padding: 0.65rem 0.75rem;
}
.message-modal-details-summary {
  cursor: pointer;
  color: var(--accent-bright);
  font-size: 0.83rem;
  font-weight: 500;
}
.message-modal-details-pre {
  margin: 0.5rem 0 0;
  padding: 0.6rem;
  font-size: 0.74rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow-y: auto;
  color: var(--text-muted);
}
.message-modal-btn {
  min-width: 7rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.connection-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.connection-dialog-header h2 {
  margin: 0;
}
.connection-dialog-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.1rem;
  line-height: 1;
}
.connection-dialog-close:hover {
  color: var(--text-primary);
}
.connection-dialog-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}
.connection-field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.4rem;
}

/* Connection test / repository feedback (dialogs + sidebar) */
.connection-test-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.connection-test-feedback {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.35;
}
.connection-test-feedback--success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: var(--text-primary);
}
.connection-test-feedback--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--text-primary);
}
.connection-test-feedback__title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.connection-test-feedback__brief {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.connection-test-feedback details,
.connection-result-alert__details {
  margin-top: 0.45rem;
}
.connection-test-feedback summary,
.connection-result-alert__details summary {
  cursor: pointer;
  color: var(--accent-bright);
  font-size: 0.78rem;
  font-weight: 500;
  user-select: none;
}
.connection-test-feedback pre,
.connection-result-alert__pre {
  margin: 0.4rem 0 0;
  padding: 0.5rem 0.6rem;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 0.72rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
  color: var(--text-secondary);
}
.connection-result-alert {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.35;
}
.connection-result-alert--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.connection-result-alert--warning {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.4);
}
.connection-result-alert__title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.connection-result-alert__brief {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* Fade in */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.35s ease both; }

/* Spinner / loading */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-ring {
  width: 48px; height: 48px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem;
}
.spinner-ring-sm {
  width: 14px; height: 14px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.dashboard-loading-overlay {
  text-align: center;
  padding: 4rem 2rem;
}
.dashboard-loading-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.dashboard-loading-sub {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}
.dashboard-loading-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 1rem;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}
.tab-item.tab-loading { color: var(--accent-bright); }
