/* ==================== GENERAL ==================== */
/* Variables are now defined in _variables.css */
body { font-family: var(--font-family-primary, 'FZ Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif); color: var(--text-color); background-color: var(--color-bg-light); }
.btn { display: inline-block; padding: 8px 16px; border: 1px solid transparent; border-radius: 6px; font-size: var(--font-size-md); font-weight: 500; cursor: pointer; transition: all 0.2s ease; margin: 2px;}
.btn-primary { background-color: var(--color-primary); color: white; border-color: var(--color-primary); }
.btn-secondary { background-color: var(--bg-surface); color: var(--text-color); border-color: var(--border-color); }
.icon-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: 6px; }
.icon-btn:hover { color: var(--color-primary); background: var(--light-bg); }
.scrollable { overflow: auto; }

/* ==================== PROJECTS VIEW ==================== */
.projects-view { padding: 24px; max-width: 1400px; margin: 0 auto; height: calc(100vh - 56px); box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; }
.projects-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.projects-header h1 { font-size: var(--font-size-xxxl); font-weight: 700; color: var(--text-color); }
.projects-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; flex: 1; overflow-y: auto; padding-right: 6px; align-content: start; }
.project-card { background-color: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; transition: all 0.2s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.05); display: flex; flex-direction: column; height: 420px; }
.project-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-2px); }
.project-thumb {
  height: 160px;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.project-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-thumb-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(10px);
  transform: scale(1.06);
  transition: filter 0.45s ease, transform 0.45s ease;
  will-change: filter, transform;
}
.project-thumb-img.loaded {
  filter: blur(0);
  transform: scale(1);
}
.project-thumb.small {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.project-thumb.small img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.project-thumb.small .project-thumb-img {
  border-radius: 8px;
}
.project-body { padding: 18px 20px; display: grid; grid-template-rows: 56px 48px 36px 42px; row-gap: 10px; flex: 1; min-height: 0; }
.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin: 0; min-height: 56px; }
.project-card-header h2 {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-color);
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  display: -webkit-box;
  /* -webkit-line-clamp: 2; */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-description {
  color: var(--text-muted);
  font-size: var(--font-size-md);
  margin: 0;
  line-height: 1.5;
  min-height: 48px;
  display: -webkit-box;
  /* -webkit-line-clamp: 2; */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin: 0; font-size: var(--font-size-base); color: var(--text-muted); align-items: center; }
.meta-item { display: flex; align-items: center; gap: 4px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-actions { display: flex; gap: 8px; margin-top: 0; align-items: center; }
.projects-list.list { display: flex; flex-direction: column; gap: 12px; }
.project-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; align-items: center; column-gap: 16px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 10px; padding: 16px 20px; transition: all 0.2s ease; min-height: 112px; }
.project-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.row-left { display: flex; align-items: center; gap: 16px; flex: 1; }
.row-left .info { flex: 1; min-width: 0; }
.row-left .name {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-left .desc {
  font-size: var(--font-size-md);
  color: var(--text-muted);
  line-height: 1.4;
  min-height: 38px;
  display: -webkit-box;
  /* -webkit-line-clamp: 2; */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row-center { color: var(--text-muted); font-size: var(--font-size-md); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-right { display: flex; align-items: center; gap: 8px; }

/* ==================== SKELETON LOADING ==================== */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.skeleton-block {
  background: var(--gray-200, #e5e7eb);
  border-radius: 4px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.project-card.skeleton { pointer-events: none; cursor: default; }
.project-card.skeleton:hover { transform: none; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.skeleton-thumb { width: 100%; height: 160px; border-radius: 0; }
.skeleton-body { padding: 18px 20px; display: grid; grid-template-rows: 56px 48px 36px 42px; row-gap: 10px; }
.skeleton-title-line { height: 18px; width: 68%; margin-bottom: 8px; }
.skeleton-title-line-2 { height: 18px; width: 44%; }
.skeleton-desc-line { height: 13px; width: 100%; margin-bottom: 6px; }
.skeleton-desc-line-2 { height: 13px; width: 72%; }
.skeleton-meta-row { display: flex; gap: 12px; align-items: center; }
.skeleton-meta-item { height: 12px; width: 80px; }
.skeleton-btn { height: 34px; width: 76px; border-radius: 6px; }
.project-row.skeleton { pointer-events: none; cursor: default; }
.project-row.skeleton:hover { box-shadow: none; }
.skeleton-row-thumb { width: 80px; height: 80px; border-radius: 8px; flex-shrink: 0; }
.skeleton-row-name { height: 16px; width: 55%; margin-bottom: 8px; }
.skeleton-row-desc { height: 13px; width: 90%; margin-bottom: 5px; }
.skeleton-row-desc-2 { height: 13px; width: 65%; }
.skeleton-row-meta { height: 13px; width: 100px; }
.skeleton-row-btn { height: 34px; width: 76px; border-radius: 6px; }

/* ==================== PROJECT DETAIL VIEW ==================== */
.project-shell { display: grid; grid-template-columns: 220px 1fr; gap: 16px; height: calc(100vh - 72px); transition: grid-template-columns .25s ease; }
.project-shell:has(.project-nav.collapsed) { grid-template-columns: 60px 1fr; }
/* Nav màu trung tính; màu chữ đen mặc định, chỉ active mới trắng */
.project-nav { background: transparent; color: inherit; border-radius: 8px; padding: 0; display:flex; flex-direction:column; transition: all .25s ease; }
.project-nav .nav-item { background:transparent; border:none; color: var(--text-color); text-align:left; padding:13px 16px; cursor:pointer; font-weight: 500; display: flex; align-items: center; gap: 12px; transition: all .2s ease; border-radius: 8px; height: 45px;}
.project-nav .nav-item svg { flex-shrink: 0; width: 18px; height: 18px; }
.project-nav .nav-item .nav-label { white-space: nowrap; overflow: hidden; transition: opacity .2s ease, width .2s ease; flex: 1; min-width: 0; }
.project-nav .nav-item.active { background: var(--color-primary); color: var(--bg-surface); }

/* Collapsed navigation - show only icons */
/* .project-nav.collapsed { width: 60px; } */
.project-nav.collapsed .nav-item { padding: 13px 16px; justify-content: center; gap: 12px; }
.project-nav.collapsed .nav-label { flex: 0; width: 0; opacity: 0; overflow: hidden; }
/* .project-nav.collapsed .nav-items { align-items: center; } */
.project-main {
  background: var(--cde-surface, var(--bg-surface));
  border: 1px solid var(--cde-border, var(--border-color));
  border-radius: 10px;
  padding: 16px;
  overflow: auto;
  font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: var(--cde-fs-md, 13px);
  color: var(--cde-text, var(--text-color));
  position: relative;
}
.section { display:none; } .section.active { display:block; }
.data-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.data-grid { display:grid; grid-template-columns: 300px 1fr; gap:16px; height: calc(100% - 48px); }
.folder-pane, .file-pane { border:1px solid var(--border-color); border-radius:8px; overflow:hidden; display:flex; flex-direction:column; }
.pane-header { padding:10px 12px; font-weight:700; border-bottom:1px solid var(--border-color); background:var(--gray-100); }
.file-list-container, .folder-tree-container { flex:1; }
.file-table.head, .file-row { align-items:center; padding:8px 12px; border-bottom:1px solid var(--border-color); }
.file-table.head { font-weight:600; background:var(--gray-100); }
.file-row:hover { background:var(--gray-50); }
.file-row .cell.name { font-weight: 600; }
.file-row .file-status { font-size: var(--font-size-base); color: var(--text-muted); }

/* ==================== CLASH DETECTION (Project Detail) ==================== */
.clash-section { display: flex; flex-direction: column; gap: 16px; }
.clash-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.clash-subtitle { margin: 4px 0 0; color: var(--text-muted); font-size: var(--font-size-base); }
.clash-actions { display: flex; gap: 8px; }
.clash-actions-row { align-items: flex-end; flex-wrap: wrap; }
.clash-inline { display: inline-flex; align-items: center; gap: 8px; padding: 2px 6px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-surface); }
.clash-inline label { font-size: var(--font-size-base); color: var(--text-muted); font-weight: 600; }
.clash-select { border: none; outline: none; padding: 6px 8px; font-size: var(--font-size-base); background: transparent; min-width: 220px; }
.clash-table th { position: relative; }
.clash-table th.sortable { cursor: pointer; user-select: none; }
.clash-table th.sortable:hover { color: var(--primary-color); }

/* ==================== ACC-like Clash Matrix ==================== */
.acc-clashes { display: flex; flex-direction: column; gap: 10px; }
.acc-header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.acc-title { font-size: var(--font-size-xxxl); font-weight: 600; letter-spacing: -0.02em; }
.acc-header-right { display:flex; gap:12px; align-items:center; }
.acc-link { color: var(--color-primary); text-decoration:none; font-size:var(--font-size-base); }
.acc-btn-link { background:transparent; border:none; color: var(--color-primary); font-weight:600; cursor:pointer; }
.acc-tabs { display:flex; gap:16px; margin-left: 10px; }
.acc-tab { background:transparent; border:none; padding:8px 0; cursor:pointer; color: var(--text-secondary); font-weight:600; }
.acc-tab.active { color: var(--color-primary); border-bottom:2px solid var(--color-primary); }
.acc-toolbar { display:flex; gap:12px; align-items:center; }
.acc-search { flex: 1; }
.acc-input { width:100%; padding:10px 12px; border:1px solid var(--border-color); border-radius:6px; font-size:var(--font-size-md); }
.acc-select { padding:10px 12px; border:1px solid var(--border-color); border-radius:6px; font-size:var(--font-size-md); background: var(--bg-surface); min-width: 220px; }
.acc-body { display:grid; grid-template-columns: 1fr 320px; gap:12px; min-height: 420px; }
.acc-matrix-wrap { border:1px solid var(--border-color); border-radius:10px; background: var(--bg-surface); overflow:auto; }
.acc-side { border:1px solid var(--border-color); border-radius:10px; background: var(--bg-surface); overflow:auto; }
.acc-muted { color: var(--text-muted); }
.acc-footer { display:flex; justify-content:space-between; align-items:center; padding: 6px 2px; color: var(--text-secondary); }
.acc-footer-strong { font-weight:700; }

.acc-matrix { min-width: 920px; }
/* .acc-row { display:grid; grid-template-columns: 320px repeat(auto-fit, minmax(84px, 1fr)); } */
.acc-cell { border-right:1px solid var(--border-color); border-bottom:1px solid var(--border-color); padding:10px 10px; font-size:var(--font-size-base); }
.acc-cell:last-child { border-right:none; }
.acc-header-row .acc-cell { position: sticky; top: 0; background: var(--bg-surface); z-index: 3; }
.acc-corner { position: sticky; left: 0; z-index: 4; background: var(--bg-surface); }
.acc-row-head { position: sticky; left: 0; background: var(--bg-surface); z-index: 2; }
.acc-col-head { height: 170px; display:flex; align-items:flex-end; justify-content:center; }
.acc-rot { display:inline-block; transform: rotate(-90deg); transform-origin: left bottom; width: 160px; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; }
.acc-ellipsis { display:block; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; }

.acc-val { text-align:center; cursor:pointer; user-select:none; }
.acc-zero { background: var(--bg-surface); color: var(--text-primary); }
.acc-na { background: var(--gray-100); color: var(--text-muted); }
.acc-diag { background: var(--gray-50); }
.acc-hot { background: var(--color-warning); color: var(--text-primary); font-weight:700; }
.acc-hi .acc-val, .acc-cell.acc-hi { background: var(--color-primary-lightest) !important; }
.acc-row.acc-hi .acc-row-head { background: var(--color-primary-lightest) !important; }
.acc-cell.acc-hi { background: var(--color-primary-lightest) !important; }

.acc-side-empty { padding: 14px; }
.acc-side-panel { padding: 14px; display:flex; flex-direction:column; gap:10px; }
.acc-side-title { font-weight:700; }
.acc-side-sub { color: var(--text-muted); font-size: var(--font-size-base); }
.acc-side-pair { display:flex; align-items:center; gap:8px; flex-wrap: wrap; }
.acc-chip { border:1px solid var(--border-color); border-radius: 999px; padding: 6px 10px; background: var(--bg-surface); cursor:pointer; font-size: var(--font-size-base); }
.acc-side-list { display:flex; flex-direction:column; gap:10px; }
.acc-side-item { border:1px solid var(--border-color); border-radius:10px; padding:10px; background: var(--bg-surface); }
.acc-side-item-title { font-weight:700; margin-bottom:4px; }
.acc-side-item-desc { color: var(--text-secondary); font-size: var(--font-size-base); margin-bottom:8px; }

.acc-tooltip { position: fixed; z-index: 9999; background: rgba(17,24,39,0.92); color:var(--bg-surface); padding:6px 8px; border-radius:6px; font-size:var(--font-size-sm); pointer-events:none; opacity:0; transition: opacity .12s ease; max-width: 260px; }
.clash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.clash-card { border: 1px solid var(--border-color); border-radius: 10px; padding: 14px; background: var(--bg-surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.clash-card-header { display: flex; justify-content: space-between; align-items: center; font-size: var(--font-size-base); color: var(--text-muted); }
.clash-tag { background: var(--color-primary-lightest); color: var(--text-primary); padding: 4px 8px; border-radius: 12px; font-weight: 600; }
.clash-badge { background: var(--color-primary-lightest); color: var(--color-primary); padding: 4px 10px; border-radius: 12px; font-weight: 600; }
.clash-badge-accent { background: var(--color-warning-bg); color: var(--color-warning-dark); }
.clash-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.clash-list, .clash-issue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; color: var(--text-primary); font-size: var(--font-size-base); }
.issue-id { display: inline-block; min-width: 56px; font-weight: 700; color: var(--color-primary); }
.clash-stats { display: flex; gap: 12px; }
.clash-stat { background: var(--gray-50); border: 1px solid var(--border-color); border-radius: 8px; padding: 8px 12px; min-width: 90px; text-align: center; }
.clash-stat strong { display: block; font-size: var(--font-size-xl); color: var(--color-primary); }
.clash-stat span { color: var(--text-muted); font-size: var(--font-size-base); }
.clash-tabs { display: inline-flex; gap: 4px; background: var(--bg-light); padding: 4px; border-radius: 10px; border: 1px solid var(--border-color); }
.clash-tab-btn { border: none; background: transparent; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--text-secondary); font-size: var(--font-size-md); transition: all 0.2s ease; }
.clash-tab-btn:hover { color: var(--primary-blue); background: rgba(59, 130, 246, 0.08); }
.clash-tab-btn.active { background: white; color: var(--primary-blue); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.clash-tab-content { display: none; border: 1px solid var(--border-color); border-radius: 10px; padding: 12px; background: var(--bg-surface); }
.clash-tab-content.active { display: block; }
.clash-table-wrapper { border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; background: var(--bg-surface); margin-top: 10px; }
.clash-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-md); }
.clash-table thead { background: var(--gray-100); }
.clash-table th, .clash-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-color); text-align: left; }
.clash-table tr:hover { background: var(--gray-50); }
.clash-actions-row { align-items: flex-start; flex-wrap: wrap; gap: 16px; }
.clash-group { display:flex; flex-direction:column; gap:6px; flex: 1; min-width: 250px; max-width: 300px; }
.clash-label { font-size:var(--font-size-sm); font-weight:600; color: var(--text-muted); }
.clash-model-list { width: 100%; min-width: 200px; max-height:140px; overflow-y:auto; background: var(--gray-100); border-radius:8px; padding:6px 8px; }
.clash-model-item { display:flex; align-items:center; gap:8px; padding:4px 6px; border-radius:6px; cursor:pointer; font-size:var(--font-size-base); }
.clash-model-item:hover { background: var(--color-primary-lightest); }
.clash-model-item input[type="checkbox"] { width:14px; height:14px; cursor:pointer; }
.clash-model-name { flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display: flex; align-items: center; gap: 4px; }
.clash-model-name .model-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.clash-model-name .model-version {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.clash-hint { font-size: var(--font-size-sm); color: var(--text-muted); padding: 8px; text-align: center; line-height: 1.5; }
.clash-matrix-output { margin-top: 10px; border: 1px solid var(--border-color); border-radius: 10px; overflow: auto; background: var(--bg-surface); }
.clash-matrix-loading { padding: 14px; color: var(--text-muted); }
.mx-grid { width: 100%; display: flex; flex-direction: column; }
.mx-row { display: flex; width: 100%; }
.mx-cell { padding: 8px 10px; border-bottom: 1px solid var(--border-color); border-right: 1px solid var(--border-color); font-size: var(--font-size-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }
.mx-corner { width: 20%; flex: 0 0 20%; background: var(--gray-100); }
.mx-cell:last-child { border-right: none; }
.mx-header .mx-cell { background: var(--gray-100); font-weight: 700; }
.mx-head { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.mx-head .model-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.mx-head .model-version {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.mx-val { text-align: center; background: var(--color-warning-bg); }
.mx-hi { background: var(--color-primary-lightest) !important; color: var(--color-primary); }
.clash-empty { border: 1px dashed var(--gray-300); border-radius: 10px; padding: 14px; background: var(--gray-50); color: var(--text-muted); margin-top: 10px; }
.clash-space-list { margin-top: 10px; }

/* Project Detail Clash Matrix (moved from clashSection.ts inline styles) */
#section-clash .clash-summary-bar {
  display: flex;
  gap: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
#section-clash .clash-summary-item { color: #495057; }
#section-clash .clash-summary-value { font-weight: 600; }
#section-clash .clash-summary-total { font-weight: 600; }
#section-clash .clash-summary-open { color: #f59e0b; }
#section-clash .clash-summary-progress { color: #3b82f6; }
#section-clash .clash-summary-resolved { color: #22c55e; }
#section-clash .clash-summary-closed { color: #6366f1; }
#section-clash .clash-summary-date { color: #999; margin-left: auto; }

#section-clash .clash-matrix.autodesk-grid {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  overflow: hidden;
}
#section-clash .clash-matrix.autodesk-grid .clash-matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}
#section-clash .clash-matrix.autodesk-grid .clash-matrix-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  flex-shrink: 0;
}
#section-clash .clash-matrix.autodesk-grid .clash-matrix-info {
  font-size: 12px;
  color: #64748b;
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* ── Hard / Soft clash mode switch ── */
#section-clash .clash-mode-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
}
#section-clash .clash-mode-switch {
  display: flex;
  align-items: center;
  background: #e8f0fe;
  border-radius: 8px;
  padding: 3px;
  flex-shrink: 0;
}
#section-clash .clash-mode-tab {
  padding: 5px 18px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #0066cc;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1.5;
  white-space: nowrap;
}
#section-clash .clash-mode-tab:hover {
  background: rgba(0, 102, 204, 0.1);
}
#section-clash .clash-mode-tab.active {
  background: #0066cc;
  color: #fff;
}
#section-clash .clash-clearance-input {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #64748b;
  flex-shrink: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
#section-clash .clash-clearance-input.visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
#section-clash .clash-clearance-input label {
  white-space: nowrap;
  font-weight: 500;
}
#section-clash .clash-clearance-input input {
  width: 56px;
  padding: 3px 6px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #1e293b;
  text-align: right;
  outline: none;
}
#section-clash .clash-clearance-input input:focus {
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0,102,204,0.12);
}
#section-clash .clash-clearance-input span {
  color: #94a3b8;
}
#section-clash .clash-matrix.autodesk-grid .clash-matrix-table-wrapper {
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
}
#section-clash .clash-matrix.autodesk-grid .clash-matrix-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
  --matrix-col-width: calc(100% / var(--matrix-col-count, 3));
}
#section-clash .clash-matrix.autodesk-grid .clash-matrix-grid col.matrix-col {
  width: var(--matrix-col-width);
}
#section-clash .clash-matrix.autodesk-grid .clash-matrix-grid th,
#section-clash .clash-matrix.autodesk-grid .clash-matrix-grid td {
  border: 1px solid #e2e8f0;
  padding: 8px;
  text-align: center;
  white-space: nowrap;
  width: var(--matrix-col-width);
  min-width: var(--matrix-col-width);
  max-width: var(--matrix-col-width);
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}
#section-clash .clash-matrix.autodesk-grid .clash-matrix-grid th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  position: sticky;
  top: 0;
  z-index: 10;
}
#section-clash .clash-matrix.autodesk-grid .clash-matrix-grid th.corner-cell {
  background: #f1f5f9;
  left: 0;
  z-index: 20;
}
#section-clash .clash-matrix.autodesk-grid .clash-matrix-grid th.th-model-a {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 15;
}
#section-clash .clash-matrix.autodesk-grid .clash-matrix-grid th.corner-cell,
#section-clash .clash-matrix.autodesk-grid .clash-matrix-grid th.th-model-a,
#section-clash .clash-matrix.autodesk-grid .clash-matrix-grid th.th-model-b,
#section-clash .clash-matrix.autodesk-grid .clash-matrix-grid td.matrix-cell {
  width: var(--matrix-col-width);
  min-width: var(--matrix-col-width);
  max-width: var(--matrix-col-width);
}

#section-clash .clash-matrix.autodesk-grid .matrix-cell {
  height: 40px;
  cursor: default;
  transition: background 0.15s;
}
#section-clash .clash-matrix.autodesk-grid .matrix-cell.loading {
  color: #94a3b8;
  vertical-align: middle;
}
#section-clash .clash-matrix.autodesk-grid .matrix-cell.diagonal {
  background: #f1f5f9 !important;
  color: #94a3b8;
  cursor: not-allowed;
}
#section-clash .clash-matrix.autodesk-grid .matrix-cell.no-clash {
  background: #f0fdf4;
  color: #166534;
  cursor: pointer;
}
#section-clash .clash-matrix.autodesk-grid .matrix-cell.no-clash:hover { background: #dcfce7; }
#section-clash .clash-matrix.autodesk-grid .matrix-cell.has-clash-low {
  background: #fef9c3;
  color: #854d0e;
  cursor: pointer;
  font-weight: 600;
}
#section-clash .clash-matrix.autodesk-grid .matrix-cell.has-clash-low:hover { background: #fef08a; }
#section-clash .clash-matrix.autodesk-grid .matrix-cell.has-clash-medium {
  background: #fed7aa;
  color: #9a3412;
  cursor: pointer;
  font-weight: 600;
}
#section-clash .clash-matrix.autodesk-grid .matrix-cell.has-clash-medium:hover { background: #fdba74; }
#section-clash .clash-matrix.autodesk-grid .matrix-cell.has-clash-high {
  background: #fecaca;
  color: #991b1b;
  cursor: pointer;
  font-weight: 600;
}
#section-clash .clash-matrix.autodesk-grid .matrix-cell.has-clash-high:hover { background: #fca5a5; }
#section-clash .clash-matrix.autodesk-grid .matrix-cell.error {
  background: #fef2f2;
  color: #991b1b;
}
#section-clash .clash-matrix.autodesk-grid .clash-matrix-cell-meta {
  opacity: 0.7;
  font-size: 0.75em;
}
#section-clash .clash-matrix.autodesk-grid .cell-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #e2e8f0;
  border-top-color: #0066cc;
  border-radius: 50%;
  animation: cell-spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes cell-spin {
  to { transform: rotate(360deg); }
}
#section-clash .clash-matrix.autodesk-grid .matrix-cell.cell-new {
  animation: clash-matrix-highlight-new 0.5s ease-out;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5), inset 0 0 4px rgba(34, 197, 94, 0.3);
}

#section-clash .self-clash.autodesk-grid {
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 20px;
}
#section-clash .self-clash.autodesk-grid .self-clash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}
#section-clash .self-clash.autodesk-grid .self-clash-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}
#section-clash .self-clash.autodesk-grid .self-clash-info {
  font-size: 12px;
  color: #64748b;
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 10px;
}
#section-clash .self-clash.autodesk-grid .self-clash-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}
#section-clash .self-clash.autodesk-grid .self-clash-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  min-width: 150px;
}
#section-clash .self-clash.autodesk-grid .self-clash-model-name {
  font-size: 12px;
  color: #475569;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}
#section-clash .self-clash.autodesk-grid .self-clash-count {
  font-size: 14px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
#section-clash .self-clash.autodesk-grid .self-clash-count.loading { color: #94a3b8; }
#section-clash .self-clash.autodesk-grid .self-clash-count.no-clash { background: #f0fdf4; color: #166534; }
#section-clash .self-clash.autodesk-grid .self-clash-count.no-clash:hover { background: #dcfce7; }
#section-clash .self-clash.autodesk-grid .self-clash-count.has-clash-low { background: #fef9c3; color: #854d0e; }
#section-clash .self-clash.autodesk-grid .self-clash-count.has-clash-low:hover { background: #fef08a; }
#section-clash .self-clash.autodesk-grid .self-clash-count.has-clash-medium { background: #fed7aa; color: #9a3412; }
#section-clash .self-clash.autodesk-grid .self-clash-count.has-clash-medium:hover { background: #fdba74; }
#section-clash .self-clash.autodesk-grid .self-clash-count.has-clash-high { background: #fecaca; color: #991b1b; }
#section-clash .self-clash.autodesk-grid .self-clash-count.has-clash-high:hover { background: #fca5a5; }
#section-clash .self-clash.autodesk-grid .self-clash-count.error { background: #fef2f2; color: #991b1b; }

@keyframes clash-matrix-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes clash-matrix-highlight-new {
  0% {
    transform: scale(1.05);
    background-color: rgba(34, 197, 94, 0.2);
  }
  100% {
    transform: scale(1);
  }
}

/* ==================== SETTINGS PAGE ==================== */
.settings-container { display:grid; grid-template-columns:1fr 1fr; gap:24px; margin-top:16px; }
.setting-category { border: 1px solid var(--border-color); border-radius:8px; padding:16px; }
.setting-category h4 { margin-bottom:12px; }
.setting-item { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }

/* ==================== FILE VIEWER VIEW ==================== */
.file-viewer-view { display: flex; flex-direction: column; height: calc(100vh - 56px); }
.viewer-header { display: flex; align-items: center; padding: 12px 16px; background-color: var(--bg-surface); border-bottom: 1px solid var(--border-color); gap: 12px; position: relative; }
.viewer-header h1 { font-size: var(--font-size-xl); font-weight: 600; flex: 1; color: var(--text-color); }
.viewer-header .btn-back { background-color: var(--light-bg); color: var(--text-color); border: 1px solid var(--border-color); }
.viewer-shell { display: grid; grid-template-columns: 260px 1fr 280px; gap: 12px; padding: 12px; flex:1; }
.viewer-left, .viewer-right { display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.viewer-center { position: relative; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.viewer-container { position: absolute; inset: 0; background-color: var(--gray-100); }
.panel-header { padding: 10px 12px; font-weight: 600; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background-color: var(--bg-surface); color: var(--text-color); }
.panel-header span { color: var(--text-color); }
.panel-body { flex: 1; padding: 8px 10px; background-color: var(--bg-surface); color: var(--text-color); overflow: hidden; display: flex; flex-direction: column; position: relative; z-index: 1; }
.viewer-progress { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; min-width: 240px; background: rgba(255,255,255,0.95); border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow-lg); z-index: 10; }
.vp-bar { width: 100%; height: 8px; background: var(--gray-200); border-radius: 6px; overflow: hidden; }
.vp-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--color-primary), var(--color-primary-lighter)); transition: width 0.2s ease; }
.vp-text { font-size: var(--font-size-base); color: var(--text-color); text-align: center; font-weight: 500; }

/* ==================== PROJECT 3D VIEW ==================== */
.project-3d-view { display: flex; flex-direction: column; height: 100%; width: 100%; overflow: hidden; }
.viewer-header { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; background: var(--bg-surface); border-bottom: 1px solid var(--border-color); min-height: 36px; flex-shrink: 0; }
.viewer-header h1 { font-size: var(--font-size-base); font-weight: 600; margin: 0; }
.viewer-shell-3d { display: flex; flex-direction: row; gap: 0; flex: 1; height: 100%; width: 100%; overflow: hidden; }
.viewer-left-3d { display: flex; flex-direction: column; background: var(--bg-surface); border-right: 1px solid var(--border-color); overflow: hidden; height: 100%; position: relative; width: 280px; flex-basis: 280px; flex-shrink: 0; }
.viewer-right-3d { display: flex; flex-direction: column; background: var(--bg-surface); overflow: hidden; height: 100%; position: relative; width: 300px; flex-basis: 300px; flex-shrink: 0; }
.viewer-center-3d { flex: 1; min-width: 0; position: relative; background-color: var(--gray-100); height: 100%; overflow: hidden; }
.viewer-right-3d { border-right: none; border-left: 1px solid var(--border-color); }
.panel-tabs { display: flex; flex-shrink: 0; border-bottom: 1px solid var(--border-color); background: var(--gray-50); position: relative; z-index: 1000; pointer-events: auto; }
.panel-tab { flex: 1; padding: 12px 16px; border: none; background: transparent; cursor: pointer; font-size: var(--font-size-base); font-weight: 500; color: var(--text-secondary); transition: all 0s; border-bottom: 2px solid transparent; position: relative; z-index: 1001; pointer-events: auto; }
.panel-tab:hover { background: var(--gray-100); color: var(--text-primary); }
.panel-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); background: var(--bg-surface); }
.viewer-center-3d #viewer-container { position: absolute; inset: 0; width: 100%; height: 100%; }
.viewer-center-3d #viewer-toolbar-container { position: absolute; top: 16px; left: 16px; z-index: 100; }

/* ==================== Unified ModelTree ==================== */
.model-tree { position: relative; height: 100%; }
.model-tree .mt-scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; }
.mt-root { min-width: 260px; }
.mt-row { display: grid; grid-template-columns: 22px 16px 18px 1fr 24px; align-items: center; gap: 6px; height: 34px; padding: 0 8px; white-space: nowrap; }
.mt-row.mt-file { grid-template-columns: 22px 28px 16px 18px 1fr 24px; }
.mt-row:hover { background-color: var(--gray-50); }
.mt-row.mt-active { background-color: var(--color-primary-lightest); }
.mt-row.mt-element { cursor: pointer; transition: background-color 0.15s ease; }
.mt-row.mt-element:hover { background-color: var(--color-primary-lightest); }
.mt-row.mt-element.mt-selected { background-color: var(--color-primary-light); border-left: 3px solid var(--color-primary); font-weight: 500; }
.mt-row.mt-element.mt-selected .mt-name { color: var(--color-primary-dark); }
.mt-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mt-icon svg, .mt-toggle svg, .mt-visibility svg { width: 16px; height: 16px; }
.mt-toggle svg { transition: transform 0.2s ease; transform-origin: center; }
.mt-toggle.open svg { transform: rotate(90deg); }
.mt-visibility { background: transparent; border: 1px solid var(--border-color); border-radius: 4px; width: 24px; height: 24px; display: flex; align-items:center; justify-content:center; cursor: pointer; }
.mt-visibility:hover { background-color: var(--color-primary); border-color: var(--color-primary); }
.mt-visibility:hover svg { stroke: var(--bg-surface); }
.mt-row.mt-file:not(.mt-loaded) .mt-visibility { opacity: 0.6; border-color: var(--gray-300); background-color: var(--gray-100); }
.mt-row.mt-file:not(.mt-loaded) .mt-visibility svg { stroke: var(--text-muted); }
.mt-row.mt-file:not(.mt-loaded) .mt-visibility:hover { background-color: var(--gray-200); border-color: var(--gray-400); }
.mt-row.mt-file.mt-loaded[data-visible="true"] .mt-visibility { background-color: var(--color-primary); border-color: var(--color-primary); }
.mt-row.mt-file.mt-loaded[data-visible="true"] .mt-visibility svg { stroke: var(--bg-surface); }
.mt-row.mt-file.mt-loaded[data-visible="false"] .mt-visibility { background-color: var(--gray-100); border-color: var(--gray-300); }
.mt-row.mt-file.mt-loaded[data-visible="false"] .mt-visibility svg { stroke: var(--text-muted); }
.mt-checkbox input { width: 16px; height: 16px; cursor: pointer; }
.tree-folder-item { margin-bottom: 2px; }
.tree-folder-header { display: flex; align-items: center; gap: 6px; padding: 8px 12px; cursor: pointer; transition: background-color 0.2s ease; user-select: none; }
.tree-folder-header:hover { background-color: var(--gray-50); }
.tree-file-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; transition: background-color 0.2s ease; }
.tree-file-item:hover { background-color: var(--gray-50); }
.tree-toggle { display: flex; align-items: center; width: 12px; height: 12px; flex-shrink: 0; }
.tree-toggle svg { width: 100%; height: 100%; }
.tree-children { margin-left: 0; }
.tree-icon { display: flex; align-items: center; width: 18px; height: 18px; flex-shrink: 0; }
.tree-icon svg { width: 100%; height: 100%; }
.tree-name { flex: 1; font-size: var(--font-size-base); color: var(--text-color); }
.tree-load-btn { background: transparent; border: 1px solid var(--border-color); border-radius: 4px; padding: 4px 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; transition: all 0.2s ease; margin-left: auto; }
.tree-load-btn:hover { background-color: var(--color-primary); border-color: var(--color-primary); }
.tree-load-btn:hover svg { stroke: var(--bg-surface); }
.tree-load-btn svg { width: 16px; height: 16px; }
/* ==================== REVISION CLOUDS PANEL ==================== */
.revision-clouds-panel { display: flex; flex-direction: column; height: 100%; background-color: var(--bg-surface); }
.revision-clouds-panel .panel-header { padding: 12px 16px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background-color: var(--gray-50); }
.revision-clouds-panel .panel-header h3 { margin: 0; font-size: var(--font-size-xl); font-weight: 600; color: var(--text-color); }
.revision-clouds-panel .panel-body { flex: 1; padding: 12px; overflow-y: auto; }
.revision-clouds-panel .no-clouds-message { display: flex; align-items: center; justify-content: center; height: 200px; color: var(--text-muted); font-size: var(--font-size-md); }
.revision-clouds-panel .cloud-item { background-color: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 8px; padding: 12px; margin-bottom: 12px; transition: all 0.2s ease; }
.revision-clouds-panel .cloud-item:hover { box-shadow: var(--shadow); border-color: var(--color-primary); }
.revision-clouds-panel .cloud-item-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }

.revision-clouds-panel .cloud-color-indicator {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.revision-clouds-panel .cloud-content-wrapper {
  flex: 1;
  min-width: 0;
}

.revision-clouds-panel .cloud-content {
  font-size: var(--font-size-md);
  font-weight: 500;
  color: var(--text-color);
  line-height: 1.4;
  word-wrap: break-word;
}

.revision-clouds-panel .cloud-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: var(--font-size-base);
  color: var(--text-muted);
}

.revision-clouds-panel .cloud-element {
  font-family: 'Courier New', monospace;
}

.revision-clouds-panel .cloud-date {
  font-size: var(--font-size-xs);
}

.revision-clouds-panel .cloud-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-200);
}

.revision-clouds-panel .cloud-color-input {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
}

.revision-clouds-panel .cloud-item-actions .btn {
  font-size: var(--font-size-base);
  padding: 6px 12px;
  min-height: 32px;
}

.revision-clouds-panel .cloud-item-actions .btn-danger {
  background-color: var(--danger-color);
  color: white;
  border-color: var(--danger-color);
}

.revision-clouds-panel .cloud-item-actions .btn-danger:hover {
  background-color: var(--color-danger-dark);
  border-color: var(--color-danger-dark);
}

.revision-clouds-panel .cloud-item-actions .btn-primary {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.revision-clouds-panel .cloud-item-actions .btn-primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

.revision-clouds-panel .loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.revision-clouds-panel .error {
  color: var(--danger-color);
  padding: 20px;
  text-align: center;
}

/* ==================== TOPICS PANEL ==================== */
.topics-panel { display: flex; flex-direction: column; height: 100%; background-color: var(--bg-surface); }
.topics-panel-header { padding: 16px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background-color: var(--gray-50); }
.topics-header-left { display: flex; align-items: center; gap: 16px; }
.topics-header-left h2 { margin: 0; font-size: var(--font-size-xxl); font-weight: 600; color: var(--text-color); }
.topics-view-selector { display: flex; align-items: center; gap: 8px; }
.view-label { font-size: var(--font-size-md); color: var(--text-muted); }
.topics-filter-select {
    padding: var(--select-padding-y, 6px) var(--spacing-xl, 18px) var(--select-padding-y, 6px) var(--select-padding-x, 10px);
    border: 1px solid var(--select-border-color, var(--border-color));
    border-radius: var(--select-border-radius-sm, 4px);
    font-size: var(--select-font-size, 13px);
    background-color: var(--select-bg-color, var(--bg-surface));
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: var(--select-transition);
    color: var(--select-text-color, var(--text-primary));
    min-width: 100px;
    box-sizing: border-box;
}
.topics-filter-select:hover {
    border-color: var(--select-hover-border, var(--primary-blue-lighter));
}
.topics-filter-select:focus {
    outline: none;
    border-color: var(--select-focus-border, var(--cde-blue));
    box-shadow: 0 0 0 3px var(--select-focus-shadow, rgba(20, 96, 184, 0.15));
}
.topics-header-right { display: flex; align-items: center; gap: 8px; }
.topics-header-actions { display: flex; align-items: center; gap: 4px; }
.topics-filters-bar { padding: 12px 16px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background-color: var(--gray-50); }
.topics-filters-left { display: flex; align-items: center; gap: 12px; }
.topics-checkbox-label { display: flex; align-items: center; gap: 6px; font-size: var(--font-size-md); color: var(--text-color); cursor: pointer; }
.topics-checkbox-label input[type="checkbox"] { cursor: pointer; }
.topics-list { flex: 1; overflow-y: auto; padding: 12px; }
.topic-item { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 12px; cursor: pointer; transition: all 0.2s ease; background-color: var(--bg-surface); }
.topic-item:hover { box-shadow: var(--shadow); border-color: var(--color-primary); }
.topic-thumbnail { width: 120px; height: 90px; flex-shrink: 0; border-radius: 4px; overflow: hidden; background-color: var(--gray-200); }
.topic-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.topic-thumbnail-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, var(--gray-200) 0%, var(--gray-100) 100%); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: var(--font-size-base); }
.topic-content { flex: 1; min-width: 0; }
.topic-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.topic-id { font-size: var(--font-size-xl); font-weight: 600; color: var(--text-color); }
.topic-status-badge { padding: 4px 8px; border-radius: 4px; font-size: var(--font-size-base); font-weight: 500; }
.topic-status-new { background-color: var(--color-primary); color: var(--bg-surface); }
.topic-status-active { background-color: var(--color-success); color: var(--bg-surface); }
.topic-status-resolved { background-color: var(--gray-500); color: var(--bg-surface); }
.topic-status-closed { background-color: var(--gray-500); color: var(--bg-surface); }
.topic-description { font-size: var(--font-size-md); color: var(--text-color); margin-bottom: 8px; line-height: 1.4; }
.topic-meta { display: flex; justify-content: space-between; align-items: center; font-size: var(--font-size-base); color: var(--text-muted); margin-bottom: 8px; }
.topic-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-tag { padding: 2px 8px; background-color: var(--gray-200); border-radius: 12px; font-size: var(--font-size-xs); color: var(--text-color); }
.topic-item-actions { display: flex; align-items: flex-start; }

.topic-action-btn { background: transparent; border: none; cursor: pointer; padding: 4px; border-radius: 4px; color: var(--text-muted); }
.topic-action-btn:hover { background-color: var(--gray-100); color: var(--text-color); }
.no-topics-message { text-align: center; padding: 40px; color: var(--text-muted); }

/* ==================== TOPICS PANEL (COMPACT - 3D VIEWER) ==================== */
.topics-panel-compact { height: 100%; width: 100%; overflow-x: hidden; padding: 8px 10px; }
.topics-compact-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.topics-compact-title { font-size: var(--font-size-md); font-weight: 600; color: var(--text-color); }
.topics-compact-new-btn { width: 24px; height: 24px; border-radius: 4px; border: 1px solid var(--border-color); font-size: var(--font-size-xl); line-height: 1; display: flex; align-items: center; justify-content: center; background-color: var(--bg-surface); }
.topics-compact-new-btn:hover { background-color: var(--gray-100); }
.topics-compact-filters { display: flex; gap: 6px; margin-bottom: 8px; }
.topics-compact-select {
    flex: 1;
    min-width: 0;
    padding: var(--select-padding-y-sm, 4px) var(--spacing-lg, 14px) var(--select-padding-y-sm, 4px) var(--select-padding-x-sm, 8px);
    font-size: var(--select-font-size-sm, 12px);
    border-radius: var(--select-border-radius-sm, 4px);
    border: 1px solid var(--select-border-color, var(--border-color));
    background-color: var(--select-bg-color, var(--bg-surface));
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 10px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: var(--select-transition);
    color: var(--select-text-color, var(--text-primary));
    box-sizing: border-box;
}
.topics-compact-select:hover {
    border-color: var(--select-hover-border, var(--primary-blue-lighter));
}
.topics-compact-select:focus {
    outline: none;
    border-color: var(--select-focus-border, var(--cde-blue));
    box-shadow: 0 0 0 2px var(--select-focus-shadow, rgba(20, 96, 184, 0.1));
}
.topics-compact-list { flex: 1; overflow-y: auto; }
.topic-compact-item { padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border-color); background-color: var(--bg-surface); margin-bottom: 6px; cursor: pointer; transition: background-color 0.15s ease, box-shadow 0.15s ease; }
.topic-compact-item:hover { background-color: var(--gray-50); box-shadow: var(--shadow); }
.topic-compact-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.topic-compact-id { font-size: var(--font-size-base); font-weight: 600; color: var(--text-color); }
.topic-compact-status { font-size: var(--font-size-xs); padding: 1px 6px; border-radius: 10px; background-color: var(--gray-200); }
.topic-compact-description { font-size: var(--font-size-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topics-compact-empty { font-size: var(--font-size-base); color: var(--text-muted); text-align: center; padding: 16px 8px; }

/* ==================== CONFLICTS PANEL (PLACEHOLDER) ==================== */
.conflicts-panel { display: flex; flex-direction: column; height: 100%; width: 100%; max-width: 100%; background: var(--bg-surface); padding: 10px 12px; overflow: hidden; box-sizing: border-box; }
.conflicts-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.conflicts-panel-header h3 { margin: 0; font-size: var(--font-size-md); font-weight: 600; }
.conflicts-filters { display: flex; gap: 6px; margin-bottom: 8px; }
.conflict-select { flex: 1; min-width: 0; padding: 6px 8px; font-size: var(--font-size-base); border: 1px solid var(--border-color); border-radius: 4px; }
.conflicts-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.conflict-item { border: 1px solid var(--border-color); border-radius: 8px; padding: 8px; background: var(--bg-surface); box-shadow: 0 1px 2px rgba(0,0,0,0.04); }

.conflict-title-row { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.conflict-id { font-weight: 600; font-size: var(--font-size-base); color: var(--text-color); }
.conflict-status, .conflict-severity { font-size: var(--font-size-xs); padding: 2px 6px; border-radius: 10px; line-height: 1.2; }
.conflict-status-open { background: var(--color-danger-bg); color: var(--color-danger); }
.conflict-status-new { background: var(--color-primary-lightest); color: var(--color-primary); }
.conflict-status-resolved { background: var(--color-success-bg); color: var(--color-success); }
.conflict-severity-high { background: var(--color-danger-bg); color: var(--color-danger); }
.conflict-severity-medium { background: var(--color-warning-bg); color: var(--color-warning); }
.conflict-severity-low { background: var(--color-info-bg); color: var(--color-info); }
.conflict-title { font-size: var(--font-size-base); font-weight: 600; margin-bottom: 4px; color: var(--text-color); }
.conflict-meta { font-size: var(--font-size-xs); color: var(--text-muted); display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.conflict-actions { display: flex; gap: 6px; justify-content: flex-start; }
.conflicts-empty { text-align: center; color: var(--text-muted); font-size: var(--font-size-base); padding: 12px 8px; }

/* ==================== CLASH DETECTION DIALOG STYLES ==================== */
.form-dialog-form .form-section { margin-bottom: 24px; }
.form-dialog-form .form-section:last-child { margin-bottom: 0; }
.form-dialog-form .section-title { font-size: var(--font-size-xl); font-weight: 600; margin-bottom: 16px; color: var(--text-color); border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.form-dialog-form .form-group { margin-bottom: 16px; }
.form-dialog-form .form-group:last-child { margin-bottom: 0; }
.form-dialog-form .form-label { display: block; font-size: var(--font-size-md); font-weight: 500; margin-bottom: 8px; color: var(--text-color); }
.form-dialog-form .form-label .required { color: var(--color-danger); margin-left: 4px; }
.form-dialog-form input[type="text"], .form-dialog-form input[type="number"], .form-dialog-form select { width: 100%; padding: 8px 12px; font-size: var(--font-size-md); border: 1px solid var(--border-color); border-radius: 4px; box-sizing: border-box; }
.form-dialog-form input[type="text"]:focus, .form-dialog-form input[type="number"]:focus, .form-dialog-form select:focus { outline: none; border-color: var(--primary-blue); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1); }
.form-dialog-form .model-select-container { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; padding: 8px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--gray-50); }
.form-dialog-form .checkbox-label { display: flex; align-items: center; gap: 8px; padding: 8px; cursor: pointer; border-radius: 4px; transition: background-color 0.2s; }
.form-dialog-form .checkbox-label:hover { background-color: var(--gray-100); }
.form-dialog-form .checkbox-label input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; }
.form-dialog-form .checkbox-label .model-category { font-size: var(--font-size-base); color: var(--text-muted); margin-left: auto; }
.form-dialog-form .rules-container { display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--gray-50); }

/* ==================== VIEWPOINTS PANEL ==================== */
.viewpoints-panel { display: flex; flex-direction: column; height: 100%; background-color: var(--bg-surface); }
.viewpoints-panel-header { padding: 12px 16px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background-color: var(--gray-50); }
.viewpoints-panel-header h3 { margin: 0; font-size: var(--font-size-xl); font-weight: 600; color: var(--text-color); }
.viewpoint-item { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 12px; background-color: var(--bg-surface); }
.viewpoint-snapshot { width: 120px; height: 90px; flex-shrink: 0; border-radius: 4px; object-fit: cover; background-color: var(--gray-200); }
.viewpoint-content { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }

.viewpoint-header {
  margin-bottom: 12px;
}

.viewpoint-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--text-color);
}

.viewpoint-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.viewpoint-actions .btn {
  font-size: var(--font-size-base);
  padding: 6px 12px;
  min-height: 32px;
}
