/*
 * Custom Overrides CSS
 * 
 * This file loads LAST and contains ALL custom style overrides.
 * Because it loads after all other CSS, these rules naturally win
 * without needing !important.
 * 
 * DO NOT add overrides to other CSS files - put them ALL here.
 */

/* ==========================================================================
   BUILD SIDEBAR OVERRIDES
   ========================================================================== */

/* Override .joint-inspector absolute positioning for pages-sidebar-content */
.build-sidebar .pages-sidebar-content.joint-inspector {
  position: static;
  top: auto;
  bottom: auto;
  left: auto;
  right: auto;
}

/* ==========================================================================
   STENCIL SIDEBAR (Shapes Mode) OVERRIDES
   ========================================================================== */

/* Stencil content wrapper */
.stencil-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Stencil sidebar container */
.stencil-sidebar-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
}

/* Remove padding from stencil component (stencil-sidebar-container IS the joint-stencil element) */
.stencil-sidebar-container.joint-stencil.joint-theme-light {
  padding: 0 !important;
}

/* Hide the built-in groups toggle header (we have our own) */
.stencil-sidebar-container.joint-stencil.joint-theme-light .groups-toggle {
  display: none;
}

/* Fix search wrap padding */
.stencil-sidebar-container.joint-stencil.joint-theme-light .search-wrap {
  padding-right: 0;
}

/* Fix content positioning - remove the 80px top offset */
/* Note: !important needed to override framework's !important rules */
.stencil-sidebar-container.joint-stencil.joint-theme-light .content {
  position: relative !important;
  top: 0 !important;
  height: auto !important;
  flex: 1;
  min-height: 0;
  padding: 0 !important;
  margin: 0 !important;
}

/* Remove padding/margin from groups and make them fit content */
/* Note: !important needed to override framework padding */
.stencil-sidebar-container.joint-stencil.joint-theme-light .content .group {
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
  flex: none !important;
}

/* Add spacing below group labels */
.stencil-sidebar-container.joint-stencil.joint-theme-light .content .group-label {
  margin-bottom: 10px;
}

/* Remove margin-top from joint-paper inside groups */
.stencil-sidebar-container.joint-stencil.joint-theme-light .content .group .joint-paper {
  margin-top: 0;
}

