.content-wrapper {
  background: #f4f6f9;
}

.site-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.site-brand-logo {
  flex: 0 0 auto;
  width: 84px;
  height: 34px;
  object-fit: cover;
  object-position: 50% 82%;
  border-radius: 6px;
  background: #2d3280;
}

.main-sidebar .site-brand-logo {
  width: 74px;
  height: 30px;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  white-space: nowrap;
}

.site-brand-text strong {
  color: inherit;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.site-brand-text small {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.75);
}

.main-header .site-brand-text small {
  color: #64748b;
}

.card {
  border: 0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.main-sidebar {
  background: #1f2937;
}

.brand-link {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.nav-sidebar .nav-link.active {
  background: #0f766e !important;
}

.small-box {
  border-radius: 14px;
}

.instruction-preview {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  padding: 0;
  overflow: hidden;
}

.preview-warning {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
  padding: 8px 12px;
  border-radius: 8px;
  color: #78350f;
  background: rgba(254, 243, 199, 0.96);
  border: 1px solid rgba(245, 158, 11, 0.55);
  font-size: 13px;
}

.preview-frame {
  width: 100%;
  height: 640px;
  border: 0;
  background: #fff;
}

.preview-image {
  max-width: 100%;
  max-height: 640px;
  object-fit: contain;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
    linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
  image-rendering: auto;
  min-width: 160px;
  min-height: 160px;
}

.image-preview-stage,
.text-preview-panel,
.table-preview-panel,
.office-preview-panel,
.model-preview-panel {
  width: 100%;
  min-height: 640px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-preview-panel,
.table-preview-panel {
  display: block;
  overflow: auto;
  background: #fff;
  color: #111827;
  padding: 18px;
}

.office-preview-panel {
  display: block;
  background: #e5e7eb;
  padding: 18px;
}

.dwg-preview-panel {
  width: 100%;
  min-height: 640px;
  display: block;
  background: #e5e7eb;
  padding: 18px;
}

.office-preview-frame {
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
  border-radius: 4px;
}

.text-preview-panel pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.55;
}

.preview-note {
  display: block;
  margin-bottom: 12px;
  color: #64748b;
  font-size: 13px;
}

.preview-table-wrap {
  overflow: auto;
  margin-bottom: 18px;
}

.preview-table {
  background: #fff;
  white-space: nowrap;
}

.model-preview-panel {
  position: relative;
  background: radial-gradient(circle at 50% 30%, #1e293b, #020617 72%);
  color: #cbd5e1;
  flex-direction: column;
}

.model-preview-panel model-viewer,
.three-model-viewer {
  width: 100%;
  min-height: 600px;
}

.three-model-viewer canvas {
  display: block;
}

.empty-preview {
  color: #cbd5e1;
  text-align: center;
}

.empty-preview i {
  display: block;
  font-size: 48px;
  margin-bottom: 16px;
}

.web2py_grid table {
  width: 100%;
}

html.mes-sidebar-state-loading.mes-sidebar-collapsed body:not(.sidebar-collapse) {
  visibility: hidden;
}
