/* Navigation grouping only; all application colors and card styles stay original. */

.aside .el-menu--inline:has(.tac-menu-group-heading) {
  padding: 4px 8px 10px !important;
}

/* System management is a permanent navigation section, not a collapsible menu. */
.aside .el-sub-menu.tac-settings-fixed-open > .el-sub-menu__title .el-sub-menu__icon-arrow,
.aside .tac-settings-root-entry .el-sub-menu__icon-arrow {
  display: none !important;
}

.aside .el-sub-menu.tac-settings-fixed-open > .el-menu--inline {
  display: block !important;
  height: auto !important;
}

.aside .tac-menu-root-item {
  padding-left: 30px !important;
}

.aside .tac-menu-group-heading {
  box-sizing: border-box;
  width: 100%;
  height: 42px;
  margin: 2px 0;
  padding: 0 10px 0 30px;
  display: flex;
  align-items: center;
  color: var(--el-menu-text-color, #bfd7ed);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  user-select: none;
}

.aside .tac-menu-group-heading:hover,
.aside .tac-menu-group-heading:focus-visible {
  color: var(--el-menu-active-color, #fff);
  background: rgba(255, 255, 255, .06);
  outline: none;
}

.aside .tac-menu-group-icon {
  width: 16px;
  height: 16px;
  margin-right: 10px;
  display: inline-flex;
  flex: 0 0 16px;
}

.aside .tac-menu-group-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aside .tac-menu-group-label {
  min-width: 0;
  white-space: nowrap;
}

.aside .tac-menu-group-arrow {
  margin-left: auto;
  padding-left: 6px;
  font-size: 14px;
  transition: transform .18s ease;
}

.aside .tac-menu-group-heading.is-open .tac-menu-group-arrow {
  transform: rotate(180deg);
}

.aside .tac-menu-group-item {
  box-sizing: border-box;
  width: 100%;
  height: 40px !important;
  line-height: 40px !important;
  margin: 1px 0 !important;
  padding-left: 58px !important;
  font-size: 13px;
  white-space: nowrap;
}

/* Vue may replace an active menu VNode after navigation. Keep every non-root item in the
   grouped System Management menu on the same indentation line even if that replacement
   temporarily loses the enhancement class. */
.aside .el-menu--inline:has(> .tac-menu-group-heading) > .el-menu-item:not(.tac-menu-root-item) {
  box-sizing: border-box;
  width: 100%;
  height: 40px !important;
  line-height: 40px !important;
  margin: 1px 0 !important;
  padding-left: 58px !important;
  display: flex !important;
  align-items: center;
  font-size: 13px;
}

.aside .el-menu--inline:has(> .tac-menu-group-heading) > .el-menu-item:not(.tac-menu-root-item) > .el-icon {
  width: 15px;
  margin-right: 10px;
  flex: 0 0 15px;
}

.aside .tac-menu-root-item,
.aside .tac-menu-group-item {
  display: flex !important;
  align-items: center;
}

.aside .tac-menu-item-icon {
  width: 15px;
  height: 15px;
  margin-right: 10px;
  display: inline-flex;
  flex: 0 0 15px;
  color: currentColor;
}

.aside .tac-menu-item-icon svg,
.tac-settings-section-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aside .tac-menu-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aside .tac-menu-group-hidden {
  display: none !important;
}

/* The alignment rule above has a more specific selector. Match that
   specificity so a collapsed group always hides its own child items. */
.aside .el-menu--inline:has(> .tac-menu-group-heading) > .el-menu-item.tac-menu-group-hidden {
  display: none !important;
}

/* Management home: group the existing cards without changing their click handlers. */
.tac-settings-groups {
  display: block !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.tac-settings-section {
  margin-top: 24px;
}

.tac-settings-section:first-child {
  margin-top: 0;
}

.tac-settings-section-title {
  height: 38px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #303133;
  border-bottom: 1px solid #ebeef5;
  font-size: 16px;
  font-weight: 600;
}

.tac-settings-section-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  color: var(--el-color-primary);
}

.tac-settings-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.tac-settings-grid > .el-col {
  width: auto !important;
  max-width: none !important;
  margin-bottom: 0 !important;
}

.tac-settings-grid .el-card {
  height: 100%;
}

.tac-settings-placeholder {
  min-width: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .aside .tac-menu-group-arrow { transition: none; }
}

/* Stable menu projection (v21): the Vue nodes stay mounted as the routing and
   permission source, but only the single projected menu is presented. */
.aside .el-menu--inline.tac-menu-source-managed > .el-menu-item {
  display: none !important;
}

.aside .el-menu--inline.tac-menu-source-managed > .tac-menu-projection-root {
  display: block !important;
  margin: 0;
  padding: 4px 8px 10px;
  list-style: none;
}

.aside .tac-menu-section {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aside button.tac-menu-group-heading {
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
}

.aside .tac-menu-group-list {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aside .tac-menu-group-list[hidden] {
  display: none !important;
}

.aside .tac-menu-projected-item {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  margin: 1px 0;
  padding: 0 10px 0 50px;
  display: flex;
  align-items: center;
  color: var(--el-menu-text-color, #bfd7ed);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  line-height: 40px;
  white-space: nowrap;
  list-style: none;
}

.aside .tac-menu-projected-item:hover,
.aside .tac-menu-projected-item:focus-visible {
  color: var(--el-menu-active-color, #fff);
  background: rgba(255, 255, 255, .06);
  outline: none;
}

.aside .tac-menu-projected-item.is-active {
  color: var(--el-menu-active-color, #fff);
  background: rgba(255, 255, 255, .10);
  font-weight: 600;
}

/* Keep approval actions close to the date fields on desktop. */
@media (min-width: 769px) {
  .tac-approval-actions .el-form-item__content {
    justify-content: flex-end;
    padding-right: 24px;
  }
}

/* Element Plus adds a left margin to adjacent buttons; vertical quick actions must share one left edge. */
.quick-actions > .el-button,
.quick-actions > .el-button + .el-button {
  box-sizing: border-box;
  width: 100%;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
